pstricks and calc

Werenfried Spit w.spit at witbo.nl
Thu Aug 6 14:13:47 CEST 1998


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

Wouldn't it be nice if the functionality of calc and pstricks
were integrated. So one could do stuff like
\def\leftshift{-1}
\def\rightshift{1}
\rput(1+\leftshift,0){left}
\rput(1+\rightshift,0}{right}
\rput(1+\leftshift,1){once more}
\rput(1+\rightshift,1){and again}

Alas, I tried but it didn't work. Not even wrapped up a little bit 
in a macro:

\usepackage{pstricks,calc}
\newcounter{tmpc}
\def\num#1{\setcounter{tmpc}{#1}\thetmpc}
\num{1+1}
\begin{pspicture}(5,5)
\rput(1,1){1}
\rput(1,\num{1+1}){1+1}
\end{pspicture}


leading to

! Undefined control sequence.
\calc at pre@scan ...calc at open \else \let \calc at next 
                                                  \calc at numeric \fi \calc at ne...
l.10 \rput(1,\num{1+1}){1+1}
                            
? 
! Undefined control sequence.
\GenericError  ...                                
                                                    #4  \errhelp \@err@     ...
l.10 \rput(1,\num{1+1}){1+1}
                            
? 

Is pstricks expanding the \num macro too far? Not far enough? Anyone
else tried this?
---
Werenfried Spit                            e-mail  W.Spit at witbo.nl
Witteveen+Bos Consulting Engineers         phone   +31-70-3.700.709
Den Haag, The Netherlands                  fax     +31-70-3.600.098


-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list