[pstricks] psaxes and % at the end

Michael Sharpe mchl.sharpe at gmail.com
Thu Aug 13 01:39:03 CEST 2009


When TeX parses a file, line endings are converted to spaces unless  
commented with %. That is,

a
b

has the same effect as a b. The presence of a space character in a  
pspicture may or may not have an effect, depending on the command that  
follows the space. Many PSTricks drawing commands contain a command  
\pst at killglue which swallows preceding space characters. As your  
example points out, \cnode is not among them. Indeed, most node  
setting commands do not kill preceding spaces. Because I don't  
remember exactly which commands don't contain \pst at killglue, I usually  
add a % after practically all PSTricks commands in a pspicture, just  
to avoid the possibility of extraneous spaces.

Michael

On Aug 12, 2009, at 3:00 PM, robert.fischer10 at arcor.de wrote:

> Hello All,
>
> I have recognized, that psaxes shifts objects below. Maybe sets a  
> space or something else. Effect is not available, if % is set  
> directly behind complete psaxes statement (or trivial case: using  
> psaxes at the end of the picture).
>
> What could be the effect of % at the end of a ps-statement ?
>
> Example without Shift (node is exactly centered (2,-2))
>
> \documentclass{minimal}
> \usepackage{pst-pdf}
> \usepackage{pst-3dplot}
> \pagestyle{empty}
>
> \begin{document}
>
> \def\MRa{10mm}
> \begin{pspicture}(-0.5,-4.5)(3.5,0.5)
> \psgrid[gridcolor=gray,subgridcolor=lightgray]
> %Axes
> \psaxes[arrowinset=0,arrowscale=1.5,labels=none,
>  ticks=none]{->}(3,-4)[$x$,0][$y$,270]%
> %Nodes
> \cnode[linestyle=solid](2,-2){\MRa}{MyPointM1}
> \end{pspicture}
>
> \end{document}
>
> Example with Shift (node is not centered (2,-2) more (2.1,-2))
>
> \documentclass{minimal}
> \usepackage{pst-pdf}
> \usepackage{pst-3dplot}
> \pagestyle{empty}
>
> \begin{document}
>
> \def\MRa{10mm}
> \begin{pspicture}(-0.5,-4.5)(3.5,0.5)
> \psgrid[gridcolor=gray,subgridcolor=lightgray]
> %Axes
> \psaxes[arrowinset=0,arrowscale=1.5,labels=none,
>  ticks=none]{->}(3,-4)[$x$,0][$y$,270]
> %Nodes
> \cnode[linestyle=solid](2,-2){\MRa}{MyPointM1}
> \end{pspicture}
>
> \end{document}
>
> Best Regards,
> Robert.



More information about the PSTricks mailing list