views:

8

answers:

1

I want to define a constant globally within my pspicture environment as follows:

Not working example:

\begin{pspicture}(10,10)
\psgrid
\SpecialCoor
\def\length{1.2}
\pnode(!80 sin 2 exp \length mul 40 sin div 70 sin div 0){C}\uput[-45](C){$C$}
% other codes truncated here for simplicity.
\end{pspicture}

The above example does not work.

What is the correct way to do that?

Thank you advance.

A: 

This is the solution given by Localghost http://www.latex-community.org/forum/viewtopic.php?f=5&t=9960

\documentclass{minimal}
\usepackage{pstricks-add}

\begin{document}
  \begin{pspicture}[showgrid=true](10,10)
    \SpecialCoor
    \pstVerb{/length 1.2 def}
    \pnode(!80 sin 2 exp length mul 40 sin div 70 sin div 0){C}
    \uput[-45](C){$C$}
  \end{pspicture}
\end{document}
xport