[pstricks] expansion problem
Herbert Voss
LaTeX at zedat.fu-berlin.de
Fri Dec 9 15:52:23 CET 2005
John Frampton wrote:
>
> \psplot{0}{10}{\psexp(0,1)(10,8)}
>
> Unfortunately, it doesn't work. There is some complication in
> the timing of expansion that I cannot understand. I am hoping
> that someone can help me out.
>
> Thanks, John Frampton
>
> Example (run to see it work correctly with \psexpA and \psexpB,
> then uncomment the commented line to see the problem):
\input pstricks
\input pst-plot
\catcode`@=11
\def\psPlot#1#2{%
\@ifnextchar[{\psPlot at i{#1}{#2}}{\psPlot at ii{#1}{#2}}}
\def\psPlot at i#1#2[#3,#4]{\psplot{#1}{#2}{#4 x exp #3 mul}}
\def\psPlot at ii#1#2(#3,#4)(#5,#6){%
\psplot{#1}{#2}{#6 #4 div x #3 sub #5 #3 sub div exp #4 mul}}
\catcode`@=12
\pspicture(0,0)(2,4)
\psPlot{0}{2}[1,2]
\psPlot{0}{2}(0,1)(2,3.5)
\psPlot{0}{2}(0,1)(1,4)
\endpspicture
\bye
Herbert
More information about the PSTricks
mailing list