summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex72
1 files changed, 39 insertions, 33 deletions
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} & <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 @@ 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
-}