[pstricks] declare variable and initialize with a value

Herbert Voss LaTeX at ZEDAT.FU-Berlin.DE
Sat Sep 15 15:00:47 CEST 2007

Doris Wagner schrieb:

> I have a picture and in this picture a terrible coordinate which I have
> to use often, for example the square root of 2.
> How can I avoid always typing 1.4142...? (And how many digits does
> PostScript take, by the way?)
> is there something similar to
> double x=1.41421356;
> such that I can use x in the code, for example \psline(1,1)(1,\x)

\pstVerb{/r2 { 2 sqrt } bind def

\psline(1,1)(!1 r2)

then you have all digits wich are possible, depending to
your PS level.


More information about the PSTricks mailing list