Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following code is trivial but important to show the problem. When I activate the showgrid with true or top option, my graphics object gets shifted to right as shown in the following animation.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}

\def\Atom{\psframe(1,2)(2,3)}

\begin{document}

% NO problem WITHOUT showgrid or with showgrid=bottom
\begin{pspicture}[showgrid=bottom](2,4)
    \begin{psclip}{\Atom}
        \psframe*(2,4)
    \end{psclip}
\end{pspicture}

% get shifted to the right with showgrid=true or showgrid=top
\begin{pspicture}[showgrid=true](2,4)
    \begin{psclip}{\Atom}
        \psframe*(2,4)
    \end{psclip}
\end{pspicture}

\end{document}

Warning:

  • showgrid=true is equal to showgrid=top rather than showgrid=bottom.
  • The statement on page 4 of pst-news12.pdf might wrongly be typed.

What makes this displacement?

share|improve this question
    
What does showgrid=top leads to? It will include \psgrid at the end of the pspicture-environment. This may be the problem, as everything gets shifted by drawing the grid at the very end... –  DL6ER Apr 4 '13 at 12:27

2 Answers 2

up vote 3 down vote accepted

use this version: http://texnik.dante.de/tex/generic/pstricks/pstricks.tex It has a bugfix for that.

share|improve this answer
    
The documentation was also incorrectly typed. showgrid=true should be identical to showgrid=top rather than showgrid=bottom. See page 4 of pst-news12.pdf. –  Oh my ghost Apr 4 '13 at 12:33
    
There is one more bug: chat.stackexchange.com/transcript/message/8793447#8793447 –  Oh my ghost Apr 4 '13 at 13:22
    
Yes. But in general, showgrid activated in pspicture is for navigational purposes when constructing the diagram. For me, showgrid=bottom or showgrid=top should take unit defined outside the pspicture. And \psgrid should be used for other purposes. It is just an opinion. :-) –  Oh my ghost Apr 4 '13 at 13:51

Notice my comment above:

What does showgrid=top leads to? It will include \psgrid at the end of the pspicture-environment. This may be the problem, as everything gets shifted by drawing the grid at the very end...

This solution will produce a correct version (draw grid first to set everything right and draw another one at the end to get it on top):

\begin{pspicture}[showgrid=bottom](2,4)
    \begin{psclip}{\Atom}
        \psframe*(2,4)
    \end{psclip}
    \psgrid[style=gridstyle]
\end{pspicture}

There is a white space at the end of

      \ifx#1t

in the following code snippet.

% -----------  hv 20120219 -------------------
\newpsstyle{gridstyle}{subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=8pt}
%\define@boolkey[psset]{pstricks}[]{showgrid}[true]{}
\newif\ifshowgrid
\define@key[psset]{pstricks}{showgrid}[b]{\pst@@showgrid#1\@nil}
\def\pst@@showgrid#1#2\@nil{%
  \ifx#1b\showgridtrue\def\showgridp@s{0}\else%            bottom
    \ifx#1f\showgridfalse\else
      \ifx#1t
        \ifx#2r\showgridtrue\def\showgridp@s{0}\else%      true->bottom
               \showgridtrue\def\showgridp@s{1}\fi%        top
  \fi\fi\fi%
}
share|improve this answer
    
+1: Oh my ghost, you noticed the white space. :-) –  Oh my ghost Apr 4 '13 at 12:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.