texlive[45451] Master/texmf-dist: pst-tools (1oct17)
commits+karl at tug.org
commits+karl at tug.org
Mon Oct 2 23:58:12 CEST 2017
Revision: 45451
http://tug.org/svn/texlive?view=revision&revision=45451
Author: karl
Date: 2017-10-02 23:58:12 +0200 (Mon, 02 Oct 2017)
Log Message:
-----------
pst-tools (1oct17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/pst-tools/Changes
trunk/Master/texmf-dist/doc/generic/pst-tools/README
trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf
trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex
trunk/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex
trunk/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty
Modified: trunk/Master/texmf-dist/doc/generic/pst-tools/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-tools/Changes 2017-10-02 21:57:58 UTC (rev 45450)
+++ trunk/Master/texmf-dist/doc/generic/pst-tools/Changes 2017-10-02 21:58:12 UTC (rev 45451)
@@ -1,4 +1,5 @@
..... pst-tools.tex
+0.08 2017-10-02 - new macro \psGetElement
0.07 2017-08-23 - use always URW fonts instead of PostScript, eg Helvetica-NimbusSanL
0.06 2017-05-12 - added style mmpaper
0.05 2014-05-12 - new optional arguments for printing values
Modified: trunk/Master/texmf-dist/doc/generic/pst-tools/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-tools/README 2017-10-02 21:57:58 UTC (rev 45450)
+++ trunk/Master/texmf-dist/doc/generic/pst-tools/README 2017-10-02 21:58:12 UTC (rev 45451)
@@ -1,7 +1,7 @@
pst-tools: helper functions
--- psPrintValue
+-- psPrintValue on PostScript level
+-- \psGetElement of a comma separated list
-
Save the files pst-tools.sty|pro|tex in a directory, which is part of your
local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/
Then do not forget to run texhash to update this tree.
@@ -10,7 +10,7 @@
TeX Frequently Asked Questions:
(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages).
-pst-func needs pst-plot (pstricks-add) and pstricks, which should
+pst-tools needs pst-plot (pstricks-add) and pstricks, which should
be part of your local TeX installation, otherwise get it from a
CTAN server, http://mirror.ctan.org
@@ -17,4 +17,9 @@
PSTricks is PostScript Tricks, the documentation cannot be run
with pdftex, use the sequence latex->dvips->ps2pdf.
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+
+
%% $Id: README 286 2010-02-11 09:40:41Z herbert $
Modified: trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex 2017-10-02 21:57:58 UTC (rev 45450)
+++ trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex 2017-10-02 21:58:12 UTC (rev 45451)
@@ -1,21 +1,23 @@
-%% $Id: pst-tools-doc.tex 527 2017-08-23 14:14:45Z herbert $
+%% $Id: pst-tools-doc.tex 607 2017-10-02 17:56:55Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,
smallheadings, headexclude,footexclude,oneside]{pst-doc}
\usepackage[utf8]{inputenc}
\usepackage{pst-tools}
\let\pstToolsFV\fileversion
-\usepackage{ltablex}
+\usepackage{xltabular}
+\usepackage{pst-plot}
\renewcommand\bgImage{}
\lstset{language=PSTricks,
morekeywords={psPrintValue},basicstyle=\footnotesize\ttfamily}
%
+\usepackage{biblatex}
\addbibresource{pst-tools-doc.bib}
\begin{document}
\title{\texttt{pst-tools}}
\subtitle{Helper functions; v.\pstToolsFV}
-\author{Herbert Vo\ss}
+\author{Herbert Voß}
\docauthor{}
\date{\today}
\maketitle
@@ -56,7 +58,7 @@
There are the following valid options for \Lcs{psPrintValue}:
\noindent\medskip
-\begin{tabularx}{\linewidth}{@{}l|>{\ttfamily}l>{\ttfamily}lX@{}}
+\begin{xltabular}{\linewidth}{@{}l|>{\ttfamily}l>{\ttfamily}lX@{}}
\textrm{name} & \textrm{value} & \textrm{default}\\\hline
\endhead
\Lkeyword{PSfont} & PS font name & Times & only valid \PS\ font names are possible, e.g.
@@ -74,7 +76,7 @@
\Lkeyword{algebraic} & <boolean> & false & function in algebraic notation.\\
\Lkeyword{VarName} & <string> & \{\} & saves the value in /<VarName> for further use\\
\Lkeyword{comma} & <boolean> & false & comma instead of the dor for decimals\\
-\end{tabularx}
+\end{xltabular}
\begin{center}
\psset{fontscale=12}
@@ -157,9 +159,42 @@
+\section{\nxLcs{psGetElement}}\label{sec:getElement}
+The macro returns the n-th Element of a comma separated list into the
+user definied Macro \Lcs{\Larga{Element}}.
+\begin{BDef}
+\Lcs{psGetElement}\Largb{Index}\Largb{value list}\nxLcs{\Larga{Element}}\\
+\end{BDef}
+\begin{lstlisting}
+\def\ColorList{,violet,blue,green,red}% Index starts at 0
+\begin{pspicture}(-7,-4)(7,5)
+\psaxes(0,0)(-6.5,-4)(6.5,5)
+\psset{plotpoints=400,algebraic}
+\psforeach{\iA}{1,2,3,4}{%
+ \psGetElement{\iA}{\ColorList}\foo
+ \psplot[linecolor=\foo]{-6.28}{6.28}{\iA*sin(\iA*x)}}
+\end{pspicture}
+\end{lstlisting}
+
+\def\ColorList{,violet,blue,green,red}% Index starts at 0
+\begin{pspicture}(-7,-4)(7,5)
+\psaxes(0,0)(-6.5,-4)(6.5,5)
+\psset{plotpoints=400,algebraic}
+\psforeach{\iA}{1,2,3,4}{%
+ \psGetElement{\iA}{\ColorList}\foo
+ \psplot[linecolor=\foo]{-6.28}{6.28}{\iA*sin(\iA*x)}}
+\end{pspicture}
+
+
+
+
+
+
+
+
\clearpage
\section{List of all optional arguments for \texttt{pst-tools}}
@@ -181,4 +216,18 @@
\end{document}
-
+\def\psGetElement#1#2{% #1 natural number; #2 comma separated list
+ \pst at cnto=0\relax
+ \pst at cntp=#1\relax
+ \expandafter\psGetElement at i#2,,\@nil
+}
+\iftrue
+\def\psGetElement at i#1,#2,#3\@nil{%
+ \ifnum\the\pst at cnto<\pst at cntp\relax
+ \advance\pst at cnto by \@ne
+ \def\ps at next{\psGetElement at i#2,#3\@nil}%
+ \else
+ \def\ps at next{#1}%
+ \fi
+ \ps at next
+}
Modified: trunk/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex 2017-10-02 21:57:58 UTC (rev 45450)
+++ trunk/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex 2017-10-02 21:58:12 UTC (rev 45451)
@@ -1,4 +1,4 @@
-%% $Id: pst-tools.tex 527 2017-08-23 14:14:45Z herbert $
+%% $Id: pst-tools.tex 606 2017-10-02 17:34:18Z herbert $
%%
%% This is file `pst-tools.tex',
%%
@@ -26,8 +26,8 @@
% interface to the `xkeyval' package
\pst at addfams{pst-tools}
%
-\def\fileversion{0.07}
-\def\filedate{2017/08/23}
+\def\fileversion{0.08}
+\def\filedate{2017/10/02}
\message{`PST-tools' v\fileversion, \filedate\space (hv)}
%
\define at key[psset]{pst-tools}{decimalSeparator}[.]{\def\psk at decimalSeparator{#1}}%
@@ -122,6 +122,16 @@
\end at SpecialObj
}
%
+\def\psGetElement#1#2#3{% #1 index; #2 comma separated list; #3: Element as macro
+ \pst at cnto=\number#1
+ \@for\pst at tempA:=#2\do{%
+ \ifnum\pst at cnto=0 %
+ \edef#3{\pst at tempA}%
+ \fi
+ \advance\pst at cnto by -1
+ }%
+}
+
\catcode`\@=\PstAtCode\relax
%
%% END: pst-tools.tex
Modified: trunk/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty 2017-10-02 21:57:58 UTC (rev 45450)
+++ trunk/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty 2017-10-02 21:58:12 UTC (rev 45451)
@@ -4,5 +4,9 @@
\input{pst-tools.tex}
\ProvidesFile{pst-tools.tex}
[\filedate\space v\fileversion\space `PST-tools' (hv)]
+\IfFileExists{pst-tools.pro}{%
+ \ProvidesFile{pst-tools.pro}[2013/10/26 v 0.04, PostScript prologue file]
+ \@addtofilelist{pst-tools.pro}}{}%
+
\endinput
-%% $Id: pst-tools.sty 456 2017-05-12 19:35:55Z herbert $
+%% $Id: pst-tools.sty 606 2017-10-02 17:34:18Z herbert $
More information about the tex-live-commits
mailing list