texlive[45475] Master/texmf-dist: pst-tools (4oct17)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 5 02:42:49 CEST 2017


Revision: 45475
          http://tug.org/svn/texlive?view=revision&revision=45475
Author:   karl
Date:     2017-10-05 02:42:49 +0200 (Thu, 05 Oct 2017)
Log Message:
-----------
pst-tools (4oct17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-tools/Changes
    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

Modified: trunk/Master/texmf-dist/doc/generic/pst-tools/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-tools/Changes	2017-10-05 00:42:38 UTC (rev 45474)
+++ trunk/Master/texmf-dist/doc/generic/pst-tools/Changes	2017-10-05 00:42:49 UTC (rev 45475)
@@ -1,4 +1,5 @@
 ..... pst-tools.tex
+0.09  2017-10-04  - renamed macro \psGetElement to \psRegisterList
 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

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-05 00:42:38 UTC (rev 45474)
+++ trunk/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex	2017-10-05 00:42:49 UTC (rev 45475)
@@ -1,4 +1,4 @@
-%% $Id: pst-tools-doc.tex 607 2017-10-02 17:56:55Z herbert $
+%% $Id: pst-tools-doc.tex 612 2017-10-04 06:25:18Z herbert $
 \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,
    smallheadings, headexclude,footexclude,oneside]{pst-doc}
 \usepackage[utf8]{inputenc}
@@ -22,6 +22,17 @@
 \date{\today}
 \maketitle
 
+\begin{abstract}
+This package defines some tools which are useful for all packages not only the PSTricks like packages.
+
+\vfill
+\noindent
+Thanks to:  
+Rolf Niepraschk;
+\end{abstract}
+
+\newpage
+
 \tableofcontents
 \psset{unit=1cm}
 
@@ -55,6 +66,7 @@
 zero dimension. This is the reason why you have to put it into a box, which reserves horizontal
 space.
 
+
 There are the following valid options for \Lcs{psPrintValue}:
 
 \noindent\medskip
@@ -78,6 +90,7 @@
 \Lkeyword{comma}  & <boolean>     & false     & comma instead of the dor for decimals\\ 
 \end{xltabular}
 
+
 \begin{center}
 \psset{fontscale=12}
 \makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[4em]{$\cos x$}\hspace{1em}
@@ -111,6 +124,10 @@
 number on the stack. The second part is the function described in algebraic notation.
 Pay attention, in algebraic notation angles must be in radian and not degrees.
 
+
+\clearpage
+
+
 \begin{center}
 \psset{algebraic, fontscale=12}% All functions now in algebraic notation
 \makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[4em]{$\cos x$}\hspace{1em}
@@ -158,34 +175,41 @@
 \end{lstlisting}
 
 
+\clearpage
 
-\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}}.
+\section{\nxLcs{psRegisterList}}\label{sec:getElement}
+The macro defines for every list item an own macro for an easy access to the items. 
+It must be a comma separated list.
 
 \begin{BDef}
-\Lcs{psGetElement}\Largb{Index}\Largb{value list}\nxLcs{\Larga{Element}}\\
+\Lcs{psRegisterList}\Largb{Name}\Largb{value list}\\
+\nxLcs{\Larga{Name}}\Largb{Index}
 \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)
+\psRegisterList{Color}{violet,blue,green,red}% defines macro \Color
+\begin{pspicture}(-7,-4.5)(7,5.5)
+\psaxes{->}(0,0)(-6.5,-4.5)(6.75,5)
+\psset{plotpoints=400,algebraic,linewidth=1pt,fillstyle=solid,opacity=0.4}
+\multido{\iA=1+1}{4}{%
+  \psplot[linecolor=\Color{\iA},
+     fillcolor=\Color{\iA}!60]{-6.283}{6.283}{\iA*sin(\iA*x)}}%
 \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)}}
+  \psplot[linecolor=\Color{\iA}]{-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)
+\psRegisterList{Color}{violet,blue,green,red}% defines macro \Color
+\begin{pspicture}(-7,-4.5)(7,5.5)
+\psaxes{->}(0,0)(-6.5,-4.5)(6.75,5)
+\psset{plotpoints=400,algebraic,linewidth=1pt,fillstyle=solid,opacity=0.4}
+\multido{\iA=1+1}{4}{%
+	\psplot[linecolor=\Color{\iA},fillcolor=\Color{\iA}!60]{-6.283}{6.283}{\iA*sin(\iA*x)}}%
 \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)}}
+  \psplot[linecolor=\Color{\iA}]{-6.28}{6.28}{\iA*sin(\iA*x)}}
 \end{pspicture}
 
 
@@ -192,9 +216,6 @@
 
 
 
-
-
-
 \clearpage
 \section{List of all optional arguments for \texttt{pst-tools}}
 
@@ -216,18 +237,3 @@
 
 \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-05 00:42:38 UTC (rev 45474)
+++ trunk/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex	2017-10-05 00:42:49 UTC (rev 45475)
@@ -1,4 +1,4 @@
-%% $Id: pst-tools.tex 606 2017-10-02 17:34:18Z herbert $
+%% $Id: pst-tools.tex 611 2017-10-04 06:21:41Z herbert $
 %%
 %% This is file `pst-tools.tex',
 %%
@@ -26,8 +26,8 @@
 % interface to the `xkeyval' package
 \pst at addfams{pst-tools}
 %
-\def\fileversion{0.08}
-\def\filedate{2017/10/02}
+\def\fileversion{0.09}
+\def\filedate{2017/10/04}
 \message{`PST-tools' v\fileversion, \filedate\space (hv)}
 %
 \define at key[psset]{pst-tools}{decimalSeparator}[.]{\def\psk at decimalSeparator{#1}}%
@@ -122,13 +122,13 @@
   \end at SpecialObj
 }
 %
-\def\psGetElement#1#2#3{% #1 index; #2 comma separated list; #3: Element as macro
-  \pst at cnto=\number#1 
+\def\psRegisterList#1#2{%
+  \@namedef{#1}##1{\@nameuse{#1##1}}%
+  \pst at cnto=1
   \@for\pst at tempA:=#2\do{%
-	\ifnum\pst at cnto=0 %
- 	  \edef#3{\pst at tempA}%
-	\fi
-	\advance\pst at cnto by -1
+    \edef\pst at tempB{\@namedef{#1\the\pst at cnto}{\pst at tempA}}%	
+    \pst at tempB
+    \advance\pst at cnto by 1
   }%
 }
 



More information about the tex-live-commits mailing list