summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks/pst-news10.tex
blob: e29239704097eb19903b26c548f82d3d28152526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
%% $Id: pst-news09.tex 62 2008-11-25 19:52:07Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings
    headexclude,footexclude,oneside]{pst-doc}
\listfiles
\let\Lfile\LFile
\usepackage[utf8]{inputenc}
\usepackage{pst-plot}
\let\pstplotFV\fileversion
\let\pstplotFD\filedate
\usepackage{pst-eucl,pst-func}
\renewcommand\bgImage{\psscalebox{15}{\color{blue!20}2010}}
\def\textat{\char064}
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
    escapechar=?}
\begin{document}

%\psset{PstDebug=1}
\title{\texttt{News -- 2010}\\ \Large new macros and bugfixes for the
basic packages \nxLFile{pstricks}, \nxLFile{pst-plot}, and \nxLFile{pst-node}}
\author{Herbert Voß}
\date{\today}

\maketitle

\clearpage
\tableofcontents

\clearpage
\part{\texttt{pstricks} -- package}

\section{General}
There exists a new document class \LClass{pst-doc} for writing PSTricks documentations,
like this news document. It depends on the KOMA-Script document class \LClass{scrartcl}.
\LClass{pst-doc} defines a lot of special macros to create a good index. Take one of
the already existing package documentation and look into the source file. Then it will be
easy to understand, how all these macros have to be used.

When running \Lprog{pdflatex} the title page is created with boxes and inserted 
with the macro \Lcs{AddToShipoutPicture} from the package \LPack{eso-pic}. It
inserts the background title page image \Lfile{pst-doc-pdf} to use directly
\Lprog{pdflatex}.
When running \Lprog{latex} the title page
 is created with \PST\ macros.This allows to use the Perl script \Lprog{pst2pdf} or
the package \LPack{pst-pdf} or \LPack{auto-pst-pdf} or any other program/package which
supports \PS\ code in the document.


%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.sty}}
%--------------------------------------------------------------------------------------
%\subsection{New optional argument}
No changes

%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.tex} (\pstricksFV -- \pstricksFD)}
%--------------------------------------------------------------------------------------

\subsection{Option \nxLkeyword{algebraic}}
The option \Lkeyword{algebraic} moved from the other packages into
the main package \LPack{pstricks} to get rid of the dependencies.

By default the function in \Lcs{psplot} has to be described in
Reversed Polish Notation. The option \Lkeyword{algebraic} allows you
to do this in the common algebraic notation. E.g.:

\begin{tabular}{l|l}
RPN & algebraic\\\hline
\verb+x ln+ & \verb+ln(x)+\\
\verb+x cos 2.71 x neg 10 div exp mul+ & \verb+cos(x)*2.71^(-x/10)+\\
\verb+1 x div cos 4 mul+ & \verb+4*cos(1/x)+\\
\verb+t cos t sin+ & \verb+cos(t)|sin(t)+
\end{tabular}

Setting the option \Lkeyword{algebraic}, allow the user
to describe all expression to be written in the classical
algebraic notation (infix notation). The four arithmetic
operations are obviously defined \verb$+-*/$, and also the
exponential operator \verb$^$. The natural priorities are used :
$3+4\times 5^5=3+(4\times (5^5))$, and by default the computation
is done from left to right. The following functions are defined :

\medskip
\begin{tabular}{ll}
\verb$sin$, \verb$cos$, \verb$tan$, \verb$acos$, \verb$asin$ & in radians\\
\verb$log$, \verb$ln$\\
\verb$ceiling$, \verb$floor$, \verb$truncate$, \verb$round$\\
\verb$sqrt$ & square root\\
\verb$abs$ & absolute value\\
\verb$fact$ & for the factorial\\
\verb$Sum$ & for building sums\\
\verb$IfTE$ & for an easy case structure
\end{tabular}

\medskip
These options can be used with \textbf{all} plot macros.

{\bfseries Using the option \Lkeyword{algebraic} implies that all
angles have to be in radians! }

For the \Lcs{parametricplot} the two parts must be divided by the \Lnotation{|} character:

\begin{LTXexample}[width=2cm]
\begin{pspicture}(-0.5,-0.5)(0.5,0.5)
\parametricplot[algebraic,linecolor=red]{-3.14}{3.14}{cos(t)|sin(t)}
\end{pspicture}
\end{LTXexample}

\bigskip
\begingroup
\psset{lly=-0.5cm}
\psgraph[trigLabels,dx=\psPi,dy=0.5,Dy=0.5]{->}(0,0)(-10,-1)(10,1){\linewidth}{6cm}
  \psset{algebraic,plotpoints=1000}
  \psplot[linecolor=yellow,linewidth=2pt]{-10}{10}{0.75*sin(x)*cos(x/2)}
  \psplot[linecolor=red,showpoints=true,plotpoints=101]{-10}{10}{0.75*sin(x)*cos(x/2)}
\endpsgraph
\endgroup

\bigskip
\begin{lstlisting}
\psset{lly=-0.5cm}
\psgraph[trigLabels,dx=\psPi,dy=0.5,Dy=0.5]{->}(0,0)(-10,-1)(10,1){\linewidth}{6cm}
  \psset{algebraic,plotpoints=1000}
  \psplot[linecolor=yellow,linewidth=2pt]{-10}{10}{0.75*sin(x)*cos(x/2)}
  \psplot[linecolor=red,showpoints=true,plotpoints=101]{-10}{10}{0.75*sin(x)*cos(x/2)}
\endpsgraph
\end{lstlisting}


\bigskip
%\begin{LTXexample}[pos=t]
\bgroup
\psset{lly=-0.5cm,unit=1cm}
\psgraph(0,-5)(18,3){0.9\linewidth}{5cm}
  \psset{algebraic,plotpoints=501}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.01}{18}{ln(x)}
  \psplot[linecolor=red]{0.01}{18}{ln(x)}
  \psplot[linecolor=green,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
  \psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
\endpsgraph
\egroup
%\end{LTXexample}


\bigskip
\begin{lstlisting}
\psset{lly=-0.5cm}
\psgraph(0,-5)(18,3){0.9\linewidth}{5cm}
  \psset{algebraic,plotpoints=501}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.01}{18}{ln(x)}
  \psplot[linecolor=red]{0.01}{18}{ln(x)}
  \psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
  \psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
\endpsgraph
\end{lstlisting}


%--------------------------------------------------------------------------------------
\section{Numeric functions}
%--------------------------------------------------------------------------------------

All macros have a \textat{} in their name, because they are
only for internal use, but it is no problem to use them like other
macros. One can define another name without a \textat{}:
\begin{lstlisting}[style=syntax]
\makeatletter
\let\pstdivide\pst@divide
\makeatother
\end{lstlisting}

or put the macro inside the \Lcs{makeatletter} -- \Lcs{makeatother} sequence.


%--------------------------------------------------------------------------------------
\section{Numeric functions}
%--------------------------------------------------------------------------------------

By default \PST\ loads the file \Lfile{pst-fp} which is derived from the
\LPack{fp} package. It supports the following macros:

%--------------------------------------------------------------------------------------
\subsection{\nxLcs{pstFPadd}, \nxLcs{pstFPsub}, \nxLcs{pstFPmul}, and \nxLcs{pstFPdiv}}
%--------------------------------------------------------------------------------------
Multiplication and division:

\begin{BDef}
\Lcs{pstFPadd}\Largb{result}\Largb{number}\Largb{number}\\
\Lcs{pstFPsub}\Largb{result}\Largb{number}\Largb{number}\\
\Lcs{pstFPmul}\Largb{result}\Largb{number}\Largb{number}\\
\Lcs{pstFPdiv}\Largb{result}\Largb{number}\Largb{number}
\end{BDef}

\begin{LTXexample}[width=5cm]
\pstFPmul\Result{-3.405}{0.02345} \Result\quad
\pstFPdiv\Result{-3.405}{0.02345} \Result\\
\pstFPmul\Result{0.02345}{-3.405} \Result\quad
\pstFPdiv\Result{0.02345}{-3.405} \Result\\
\pstFPmul\Result{234.123}{33} \Result\quad
\pstFPdiv\Result{234.123}{33} \Result\\
\pstFPadd\Result{234.123}{33} \Result\quad
\pstFPadd\Result{234.123}{-33} \Result\\
\pstFPsub\Result{234.123}{33} \Result\quad
\pstFPsub\Result{-234.123}{33} \Result
\end{LTXexample}

The zeros can be stripped with the macro \Lcs{pstFPstripZeros}. Expect 
always rounding errors, \TeX\ was not made for calculations \ldots
The value is converted into a length and then reconverted to a 
number by stripping the unit. Which also strips the zeros.

\begin{LTXexample}[width=5cm]
\pstFPmul\Result{-3.405}{0.02345} 
\pstFPstripZeros{\Result}{\Result}\Result\quad
\pstFPdiv\Result{-3.405}{0.02345} 
\pstFPstripZeros{\Result}{\Result}\Result\\
\pstFPmul\Result{0.02345}{-3.405} 
\pstFPstripZeros{\Result}{\Result}\Result\quad
\pstFPdiv\Result{0.02345}{-3.405} 
\pstFPstripZeros{\Result}{\Result}\Result
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\nxLcs{pstFPMul} and \nxLcs{pstFPDiv}}
%--------------------------------------------------------------------------------------
Integer multiplication and division:

\begin{BDef}
\Lcs{pstFPMul}\Largb{result as a truncated integer}\Largb{number}\Largb{number}\\
\Lcs{pstFPDiv}\Largb{result as a truncated integer}\Largb{number}\Largb{number}
\end{BDef}

\begin{LTXexample}[width=5cm]
\makeatletter
\pstFPMul\Result{-34.05}{0.02345} \Result\quad
\pstFPDiv\Result{-3.405}{0.02345} \Result\\
\pstFPMul\Result{23.45}{-3.405} \Result\quad
\pstFPDiv\Result{0.2345}{-0.03405} \Result\\
\pstFPMul\Result{234.123}{33} \Result\quad
\pstFPDiv\Result{234.123}{33} \Result
\makeatother
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{The PostScript header files}
\subsection{\nxLFile{pstricks.pro}}
%--------------------------------------------------------------------------------------
It contains now most of the stuff from \LPack{pstricks-add} and the new routines
for plotting lines/curves with symbols.

%--------------------------------------------------------------------------------------
\subsection{\nxLFile{pst-algparser.pro}}
\subsubsection{Using the \nxLkeyword{Sum} function}
%--------------------------------------------------------------------------------------

\begin{BDef}
\Lcs{Sum}\Largr{<index name>,<start>,<step>,<end>,<function>}
\end{BDef}

Let's plot the first development of cosine with polynomials:
$\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$.

\begin{center}
\bgroup
\psset{algebraic=true, plotpoints=501, yunit=3}
\def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psclip{\psframe(-7,-1.5)(7,1.5)}
    \psplot{-7}{7}{cos(x)}
    \multido{\n=1+1}{10}{%
      \psplot[linewidth=1pt,linecolor=\getColor{\n}]{-7}{7}{%
         Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
   \endpsclip
  \psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
\egroup
\end{center}
\begin{lstlisting}
\psset{algebraic=true, plotpoints=501, yunit=3}
\def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psclip{\psframe(-7,-1.5)(7,1.5)}
    \psplot{-7}{7}{cos(x)}
    \multido{\n=1+1}{10}{%
      \psplot[linewidth=1pt,linecolor=\getColor{\n}]{-7}{7}{%
         Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
   \endpsclip
  \psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
\end{lstlisting}

\clearpage
%--------------------------------------------------------------------------------------
\subsection[\nxLps{IfTE}]{The variable step algorithm together with the PostScript function \nxLps{IfTE}}
%--------------------------------------------------------------------------------------
\xLps{IfTE}\xLkeyword{VarStep}\xLkeyword{VarStepEpsilon}

\begin{BDef}
\Lps{IfTE}\Largr{<condition>,<true part>,<false part>}
\end{BDef}

Nesting of several \Lps{IfTE} is possible and seen in the
following examples. A classic example is a piece-wise linear
function.

\begin{center}
\begin{pspicture}(-7.5,-2.5)(7.5,6)
  \psaxes{->}(0,0)(-7,-2)(7.5,6)[x,-90][y,0]
  \psset{algebraic=true, plotpoints=21,linewidth=2pt}
  \psplot[linecolor=blue]{-7.5}{7.5}{IfTE(x<-6,8+x,IfTE(x<0,-x/3,IfTE(x<3,2*x,9-x)))}
  \psplot[linecolor=red, plotpoints=101]{-7.5}{7.5}{%
      IfTE(2*x<-2^2*sqrt(9),7+x,IfTE(x<0,x^2/18-1,IfTE(x<3,2*x^2/3-1,8-x)))}%
\end{pspicture}
\end{center}


\begin{lstlisting}
\psset{unit=1.5, algebraic, ?\ON?VarStep?\OFF?, showpoints, ?\ON?VarStepEpsilon?\OFF?=.001}
\begin{pspicture}[showgrid=true](-7,-2)(2,4)
  \psplot{-7}{2}{?\ON?IfTE?\OFF?(x<-5,-(x+5)^3/2,?\ON?IfTE?\OFF?(x<0,0,x^2))}
  \psplot{-7}{2}{5*x/9+26/9}
  \psplot[linecolor=blue]{-7}{2}{(x+7)^30/9^30*4.5-1/2}
  \psplot[linecolor=red]{-6.9}{2}
      {?\ON?IfTE?\OFF?(x<-6,ln(x+7),?\ON?IfTE?\OFF?(x<-3,x+6,?\ON?IfTE?\OFF?(x<0.1415926,sin(x+3)+3,3.1415926-x)))}
\end{pspicture}
\end{lstlisting}

When you program a piece-wise defined function you must take care
that a plotting point must be put at each point where the
description changes. Use \Lkeyword{showpoints}=true to see what's
going on when there is a problem. You are on the safe side when
you choose a big number for \Lkeyword{plotpoints}.


\begin{center}
\psset{unit=0.75}
\begin{pspicture}(-8,-8)(8,8)
  \psaxes{->}(0,0)(-8,-8)(8,8)[x,-90][y,0]
  \psset{plotpoints=1000,linewidth=1pt}
  \psplot[algebraic=true]{-8}{8}{ceiling(x)}
  \psplot[algebraic=true, linecolor=yellow]{-8}{8}{rand/(2^31-1)+x}
  \psplot[algebraic=true, linecolor=red]{-8}{8}{floor(x)}
  \psplot[algebraic=true, linecolor=blue]{-8}{8}{round(x)}
  \psplot[algebraic=true, linecolor=green]{-8}{8}{truncate(x)}
  \psplot[algebraic=true, linecolor=cyan]{-8}{8}{div(mul(4,x),7)}
  \psplot[algebraic=true, linecolor=gray]{-8}{8}{abs(x)+abs(x-3)-abs(5-5*x/7)}
  \psplot[algebraic=true, linecolor=gray]{-8}{8}{abs(3*cos(x)+1)}
  \psplot[algebraic=true, linecolor=magenta]{-8}{8}{floor(8*cos(x))}
\end{pspicture}
\end{center}

\begin{lstlisting}
\psset{unit=0.75}
\begin{pspicture}(-8,-8)(8,8)
  \psaxes{->}(0,0)(-8,-8)(8,8)[x,-90][y,0]
  \psset{plotpoints=1000,linewidth=1pt}
  \psplot[algebraic=true, linecolor=yellow]{-8}{8}{rand/(2^31-1)+x}
  \psplot[algebraic=true]{-8}{8}{ceiling(x)}
  \psplot[algebraic=true, linecolor=red]{-8}{8}{floor(x)}
  \psplot[algebraic=true, linecolor=blue]{-8}{8}{round(x)}
  \psplot[algebraic=true, linecolor=green]{-8}{8}{truncate(x)}
  \psplot[algebraic=true, linecolor=cyan]{-8}{8}{div(mul(4,x),7)}
  \psplot[algebraic=true, linecolor=gray]{-8}{8}{abs(x)+abs(x-3)-abs(5-5*x/7)}
  \psplot[algebraic=true, linecolor=gray]{-8}{8}{abs(3*cos(x)+1)}
  \psplot[algebraic=true, linecolor=magenta]{-8}{8}{floor(8*cos(x))}
\end{pspicture}
\end{lstlisting}


\subsection[\nxLps{Derive} function]{Successive derivatives of a polynomial with the PostScript function \nxLps{Derive}}

\begin{center}
\bgroup
\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
  OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
  \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
  \multido{\in=0+1}{16}{%
    \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
    {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
  \endpsclip
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
  OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
  \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
  \multido{\in=0+1}{16}{%
    \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
    {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
  \endpsclip
\end{pspicture}
\end{lstlisting}


\subsection{Special arrow option \texttt{arrowLW}}

Only for the arrowtype \Lnotation{o}, \Lnotation{oo}, \Lnotation{*}, and \Lnotation{**} it is possible to
set the arrowlinewidth with the optional keyword \Lkeyword{arrowLW}.
When scaling an arrow by the keyword \Lkeyword{arrowscale} the width
of the borderline is also scaled. With the optional argument
\Lkeyword{arrowLW} the line width can be set separately and is not
taken into account by the scaling value.

\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,6)
\psline[arrowscale=3,arrows=*-o](0,5)(4,5)
\psline[arrowscale=3,arrows=*-o,
  arrowLW=0.5pt](0,3)(4,3)
\psline[arrowscale=3,arrows=*-o,
  arrowLW=0.3333\pslinewidth](0,1)(4,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,6)
\psline[arrowscale=3,arrows=**-oo](0,5)(4,5)
\psline[arrowscale=3,arrows=**-oo,
  arrowLW=0.5pt](0,3)(4,3)
\psline[arrowscale=3,arrows=**-oo,
  arrowLW=0.3333\pslinewidth](0,1)(4,1)
\end{pspicture}
\end{LTXexample}



%--------------------------------------------------------------------------------------
\clearpage
\section{\nxLcs{psforeach} and \nxLcs{psForeach}}
%--------------------------------------------------------------------------------------

The macro \Lcs{psforeach} allows a loop with an individual increment.

\begin{BDef}
\Lcs{psforeach}\Largb{variable}\Largb{value list}\Largb{action}\\
\Lcs{psForeach}\Largb{variable}\Largb{value list}\Largb{action}
\end{BDef}

With \Lcs{psforeach} the \Larg{action} is done inside a group and for \Lcs{psForeach} not.
This maybe useful when using the macro to create tabular cells, which are
alread grouped itself.

\begin{LTXexample}
\begin{pspicture}[showgrid=true](5,5)
  \psforeach{\nA}{0, 1, 1.5, 3, 5}{%
    \psdot[dotscale=3](\nA,\nA)}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t]
%\usepackage{pst-func}
\makeatletter
\newcommand*\InitToks{\toks@={}}
\newcommand\AddToks[1]{\toks@=\expandafter{\the\toks@ #1}}
\newcommand*\PrintToks{\the\toks@}
\newcommand*{\makeTable}[4][5mm]{%
  \begingroup
    \InitToks%
    \AddToks{\begin{tabular}{|*{#2}{>{\RaggedLeft}p{#1}|}@{}l@{}}\cline{1-#2}}
    \psForeach{\iA}{#3}{\expandafter\AddToks\expandafter{\iA & }}
    \AddToks{\\\cline{1-#2}}%
    \psForeach{\iA}{#3}{\expandafter\AddToks\expandafter{\expandafter%
      \psPrintValue\expandafter{\iA\space /x ED #4} & }}
    \AddToks{\\\cline{1-#2}\end{tabular}}%
    \PrintToks
  \endgroup
}
\makeatother

\sffamily
\psset{decimals=2,valuewidth=7,xShift=-20}
$y=2^x$\\
\makeTable[1cm]{6}{2,4,6,8,10,12}{2 x exp}
\end{LTXexample}

The value List can also be given by the first two and the last value, e.\,g. \verb=1,4,..,31=,
then \PST calculates all values with the distance given by the first two values.

\begin{LTXexample}[pos=t]
\psset{xunit=0.3cm,yunit=2cm}
\begin{pspicture}[showgrid](0,-5mm)(40,1)
  \psforeach{\nA}{0, 3.14,..,25}{\psline(\nA,0)(\nA,1)}
\end{pspicture}
\end{LTXexample}

The internal counter for the steps is named \LCtr{psLoopIndex} and can be used for own purposes.

\begin{LTXexample}[pos=l]
\begin{pspicture}[showgrid=true](5,5)
\psforeach{\nA}{0, 1, 1.5, 2.25, 5}{%
  \psdot[dotscale=3](\the\psLoopIndex,\nA)}
\end{pspicture}
\end{LTXexample}




\part{\nxLPack{pst-node} -- package}

\section{\nxLFile{pst-node.tex}}

The package \LPack{pst-node} now uses the advanced key handling from \LPack{xkeyval}. The reason
why it moved from the base into the contrib sections, where all packages uses \LPack{xkeyval}.

\part{\nxLPack{pst-plot} -- package}

\section{\nxLFile{pst-plot.tex}}

The package \LPack{pst-plot} now uses the advanced key handling from \LPack{xkeyval}. The reason
why it moved from the base into the contrib sections, where all packages uses \LPack{xkeyval}.

\nocite{*}
\bibliographystyle{plain}
\bibliography{PSTricks}

\printindex


\end{document}