[pstricks] recursion

Manfred Braun manfred.braun at uni-due.de
Sat Oct 27 22:23:12 CEST 2007


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 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20071027/82021660/attachment.html 


More information about the PSTricks mailing list