GeneralHow to define a global constant in postscript statement?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

How to define a global constant in postscript statement?

Post by yoyoimut »

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


Not working example:

Code: Select all

\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.
Last edited by yoyoimut on Tue Aug 31, 2010 12:30 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to define a global constant in postscript statement?

Post by localghost »

The definition has to be done on postscript code.

Code: Select all

\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}

Thorsten
Post Reply