From a5a99f284013e927aba9eb64c0c533aaf52bb178 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 5 Oct 2017 00:42:49 +0000 Subject: pst-tools (4oct17) git-svn-id: svn://tug.org/texlive/trunk@45475 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-tools/Changes | 1 + .../doc/generic/pst-tools/pst-tools-doc.pdf | Bin 99637 -> 112145 bytes .../doc/generic/pst-tools/pst-tools-doc.tex | 72 +++++++++++---------- .../texmf-dist/tex/generic/pst-tools/pst-tools.tex | 18 +++--- 4 files changed, 49 insertions(+), 42 deletions(-) diff --git a/Master/texmf-dist/doc/generic/pst-tools/Changes b/Master/texmf-dist/doc/generic/pst-tools/Changes index d9f2277fe93..b40f9013fb8 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/Changes +++ b/Master/texmf-dist/doc/generic/pst-tools/Changes @@ -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 diff --git a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf index 42823552b56..fd6d6ea90e6 100644 Binary files a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf and b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex index 17db1dd5597..364a850b0b9 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex @@ -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 @@ Important is the fact, that \Lcs{psPrintValue} works on \PS\ side. For \TeX\ it 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 @@ may vary on different operating systems.\\ \Lkeyword{comma} & & 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 @@ The first one is the x value as a number, which can also be PostScript code, whi 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,43 +175,47 @@ foo \makebox[3.5em][l]{\psPrintValue[PSfont=StandardSymL,decimals=6, \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} - - - \clearpage \section{List of all optional arguments for \texttt{pst-tools}} @@ -216,18 +237,3 @@ user definied Macro \Lcs{\Larga{Element}}. \end{document} -\def\psGetElement#1#2{% #1 natural number; #2 comma separated list - \pst@cnto=0\relax - \pst@cntp=#1\relax - \expandafter\psGetElement@i#2,,\@nil -} -\iftrue -\def\psGetElement@i#1,#2,#3\@nil{% - \ifnum\the\pst@cnto<\pst@cntp\relax - \advance\pst@cnto by \@ne - \def\ps@next{\psGetElement@i#2,#3\@nil}% - \else - \def\ps@next{#1}% - \fi - \ps@next -} diff --git a/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex index 494b9e16efd..6ab3305827f 100644 --- a/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex +++ b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex @@ -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@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@key[psset]{pst-tools}{decimalSeparator}[.]{\def\psk@decimalSeparator{#1}}% @@ -122,13 +122,13 @@ \end@SpecialObj } % -\def\psGetElement#1#2#3{% #1 index; #2 comma separated list; #3: Element as macro - \pst@cnto=\number#1 +\def\psRegisterList#1#2{% + \@namedef{#1}##1{\@nameuse{#1##1}}% + \pst@cnto=1 \@for\pst@tempA:=#2\do{% - \ifnum\pst@cnto=0 % - \edef#3{\pst@tempA}% - \fi - \advance\pst@cnto by -1 + \edef\pst@tempB{\@namedef{#1\the\pst@cnto}{\pst@tempA}}% + \pst@tempB + \advance\pst@cnto by 1 }% } -- cgit v1.2.3