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.

Scenario

\pspicture with showgrid will be regarded as a PERMANENT grid.

\psgrid in \pspicture WITHOUT showgrid will be regarded as a TEMPORARY grid.

If I want to remove all temporary grids, I just need to redefine \psgrid as follows in the preamble.

\let\psgrid\relax

However, if I do this, the \pspicture with showgrid will produce strange output.


Question

How to resolve this issue?


Minimal Code

\documentclass{article}
\usepackage{pstricks}

%If I uncomment out this, 
%all temporary grids must disappear.
%\let\psgrid\relax

\begin{document}

%permanent grid
\pspicture[showgrid](2,2)
\psframe*(1,1)
\endpspicture


%temporary grid
\pspicture(2,2)
\psgrid
\psframe*(1,1)
\endpspicture

\end{document}
share|improve this question
    
I already gave you an answer how to deal with two macros.you can't say \let\foo\relax when foo expects some optional parameter. –  Herbert Jan 10 '11 at 16:58
    
I've merged the two questions. Could you please accept the answer here? –  Juan A. Navarro Jan 10 '11 at 17:26

1 Answer 1

up vote 1 down vote accepted
\documentclass{article}
\usepackage{pstricks}
\makeatletter
\def\psgrid@iv(#1)(#2)(#3){}
\makeatother
\begin{document}

\pspicture[showgrid](2,2)
\psframe*(1,1)
\endpspicture

\pspicture(2,2)
\psgrid
\psframe*(1,1)
\endpspicture

\end{document}
share|improve this answer
1  
@xport: see changed code –  Herbert Jan 10 '11 at 16:18
    
@xport: then you have to copy all \psgrid commands (see pstricks.tex) to won macros and use this for a permanent grid. –  Herbert Jan 10 '11 at 16:48
    
Why cannot we use \psset{showgrid=true/false/top/bottom} at the preamble? –  Please don't touch Nov 21 '13 at 15:29

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.