pstricks and inputs

Michael J. Sharpe msharpe at euclid.UCSD.EDU
Fri Sep 24 23:31:29 CEST 1999


-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------

>Last point first. The reason
>
>
>\def\mypoints{(0,0)(1,1)}
\expandafter\psline[linewidth=1.5pt,etc.]\mypoints

doesn't work is that the entire set of parameters must be included in 
the macro, or \expandafter won't reach it. That is,

\def\mypoints{[linewidth=1.5pt,etc.] (0,0)(1,1)}

Your axes macro seems to work if you remove the unnecessary \psclip 
...\endpsclip

Michael Sharpe

>-----------------------------------------------------------------------------
>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.
>-----------------------------------------------------------------------------
>
>Someone else suggested the same thing and I'm still having problems so I
>better include all of the code:
>
>
>\def\axes#1 {
>\begin{pspicture}*(\xmin,\ymin)(\xmax,\ymax)\showgrid
>
>\psline[linewidth=1pt,linecolor=gray,arrowinset=0.6,arrowsize=1.5pt
>3]{<->}(\xmin,0)(\xmax,0)
>\psline[linewidth=1pt,linecolor=gray,arrowinset=0.6,arrowsize=1.5pt
>3]{<->}(0,\ymin)(0,\ymax)
>\psaxes[Ox=\xmin% ,Oy=\ymin%
>       ,ticks=none%
>       ,tickstyle=top%
>       ,linewidth=0.25pt
>       ,axesstyle=frame](\xmin,\ymin)(\xmax,\ymax)
>
>\psclip{\psframe(\xmin,\ymin)(\xmax,\ymax)}
>	\expandafter\psline#1
>\endpsclip
>\end{pspicture}
>}
>
>
>Now when I try to call
>
>\def\opairs{(-5,1)(-3,2)(-2,0)}
>\expandafter\axes{\opairs}
>
>I get:
>
>! Bad arrows specification: (-5,1)(-3,2)(-2,0).
>\@pstrickserr ...te help.}\errmessage {#1}
>                                          \endgroup
>l.203 \expandafter\axes{\opairs}
>
>
>I've tried to call the \axes macros several differnet ways with no success.
>Follow-up question, the following worked (outside the \axes macro above):
>
>\def\mypoints{(0,0)(1,1)}
>\expandafter\psline\mypoints
>
>
>But this does not. Why would parameters give me problems here?
>
>\def\mypoints{(0,0)(1,1)}
>\expandafter\psline[linewidth=1.5pt,etc.]\mypoints
>
>
>thanks
>ricky
>
>
>
>
>
>
>
>
>-----Original Message-----
>From: Michael J. Sharpe [mailto:msharpe at euclid.UCSD.EDU]
>Sent: Friday, September 24, 1999 1:28 PM
>To: pstricks at tug.org
>Cc: hensh at math.msu.edu
>Subject: Re: pstricks and inputs
>
>
>Denis doesn't seem to be jumping on this, so I'll take a stab. If you
>want to use a macro for the (entire) list of parameters, you must do
>it making use of \expandafter, as in
>
>\def\mypoints{(0,0)(1,1)}
>\expandafter\psline\mypoints
>
>otherwise\mypoints is not expanded before the parameter-reading
>apparatus gets to work. This seems to work even with  parameters
>included within braces, as for example in
>
>\def\mypoints{*[linewidth=3pt]{->}(0,0)(1,1)}
>\expandafter\psline\mypoints
>
>Michael Sharpe
>
> >---------------------------------------------------------------------------
>--
> >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.
> >---------------------------------------------------------------------------
>--
> >
> >Can some one tell why the following generates an error?
> >
> >\def\mypoints{(0,0)(1,1)}
> >\psline\mypoints
> >
> >while this one works
> >
> >\psline(0,0)(1,1)
> >
> >??
> >
> >thanks
> >ricky
> >
> >---------------------------------------------------------------------------
>--
> >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>
> >---------------------------------------------------------------------------
>--
>
>
>
>-----------------------------------------------------------------------------
>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>
>-----------------------------------------------------------------------------


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