[pstricks] Rendering modified arguments inside a macro (Jorge Nto)

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Dec 14 12:20:55 CET 2009


Am 14.12.2009 11:50, schrieb Jorge Nto:

> I just want to display the result of numerical calculations at the given
> coordinates. Well, I have just seen that multiplication works.
> So if I put  \rput(#2,#4){Radius: #6\pst at number\psyunit}% the argument #6 is
> multiplied by yunit, but I don't know how to express the other operations
> (addition, division, etc)
> See (working) example below. What if I need the addition of #6 and
> \pst at number\psyunit instead of multiplication:

sorry, I do not understand why you can't simply print out #6
as radius? And the same for the circle? Where is the sense to
multiply the Radius with 0.02?

\makeatletter
 \newcommand\g{! 10.0 6 mul}
\def\psPrintfLikePlot{\pst at object{psPrintfLikePlot}}
\def\psPrintfLikePlot at i#1{%
  \begin at SpecialObj\expandafter\psPrintfLikePlot at ii#1}
\def\psPrintfLikePlot at ii #1{\psPrintfLikePlot at iii#1}
\def\psPrintfLikePlot at iii#1 #2 #3 #4 #5 #6 {%
 \pscircle(#2,#4){ #6 }%
 \rput(#2,#4){Radius: #6}%
   \@ifnextchar D{\psPrintfLikePlot at iii}{\end at SpecialObj}}
\makeatother

However, with package pst-func and the macro psPrintValue
you can print any expression in algebraic or postscript
notation.

Herbert


More information about the PSTricks mailing list