[pstricks] basic arithmetics in pstricks without defining nodes

Juergen Gilg gilg at acrotex.net
Fri Nov 9 08:26:05 CET 2007


Hi Patrick,

you can do that within PSTricks like:

\documentclass{article}
\usepackage{pstricks,pstricks-add}
\begin{document}

\begin{pspicture}(-4,-4)(4,4)
\psset{unit=1}
\SpecialCoor

\def\MyRadius{0.7}

\pstVerb{/MyDiameter \MyRadius\space 2 mul def}
\psline(\MyRadius,0)(!MyDiameter 0)
\end{pspicture}
\end{document}

Regards,

Juergen

Patrick Drechsler wrote:
> Hi,
>
> how do I do simple arithmetics in tex and use them in pstricks?
>
> I am thinking along the lines of:
>
> \SpecialCoor%
> \def\MyRadius{0.7cm}%
> \def\MyDiameter{! \MyRadius 2 mul}%
> %
> \psline(\MyRadius,0)(\MyDiameter,0)
>
> I know this will not work. I am wondering what the correct approach
> would look like...
>
> TIA,
>
> Patrick 
>   

-- 
  jürgen gilg
  austr. 59
  70376 stuttgart

tel       0711-59 27 88
e-mail    gilg at acrotex.net
website   www.acrotex.net
          www.gilligan-online.de
          www.brueckenkurs-physik.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20071109/29f8931e/attachment.html 


More information about the PSTricks mailing list