[pstricks] Antw: recursion

Robert Salvador salvador at htlinn.ac.at
Sun Oct 28 08:44:39 CET 2007


Hallo Manfred!

Thanks for your additional remark on \edef and the hard white space
command \space!
All is working perfectly now.

Robert


>>> manfred.braun at uni-due.de 27.10.07 21.23 >>>
Robert Salvador wrote:

> Good evening everybody!

>  

> I want to do a recursive calculation in a LaTeX-document with 

> following PSTricks drawing. So I have defined a variable \def\x{0.0 } 

> Now I want to assign a new value to this variable (within a \whildo 

> loop). This new value is calculated from the old one like
(simplyfied):

> \def\x{\x 1 add }

> But this doesn't work (TeX capacity exceeded!)

 

As Alan has pointed out \edef, instead of \def, will do the job.
However,
you have to write

  \edef\x{\x\space 1 add }

Also the actual value of \x has to be used in the form, e.g.,

  \SpecialCoor

  \psdot(! \x\space 0 )

The usual space following \x is absorbed as indicating the end of the
command, according to TeX's rules. An additional white space has to be
inserted explicitly by \space.

Manfred 





More information about the PSTricks mailing list