I ran into a problem converting the ps to pdf in a latex file using vectors fields and have finally nailed down the problem. <br><br>The following problem is closely related to the vector field code on the pstricks web site. If I set the parameter unit using:
<br>\pset{unit=0.5cm}<br>where the unit is 0.5cm I get a error: "/invalidrestore in --restore-- " (see below). If I set the unit to 1cm or larger it is fine. A guess of the problem is the following: since the code uses raw postscript, there might be an issue in scaling.
<br><br>I should also mention that there must be two pspicture environments for this to fail. If I run the code on just one pspicture environment, there is no error in converting the ps to pdf. <br><br>If anyone has any ideas on this, it would be quite helpful.
<br><br>Thanks in advance, <br>Peter Staab<br><br><br><br>I have included first the output of a run and then the code:<br><br>### This is /usr/local/teTeX/bin/powerpc-apple-darwin-current/altpdflatex, Version $Revision: 2.18
$<br>### /usr/local/teTeX/bin/powerpc-apple-darwin-current/latex test2.tex<br>This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)<br>entering extended mode<br>(./test2.tex<br>LaTeX2e <2003/12/01><br>Babel <
v3.8d> and hyphenation patterns for american, french, german, ngerman, d<br>utch, italian, norsk, portuges, spanish, swedish, nohyphenation, loaded.<br>(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/article.cls<br>
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class<br>(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/size10.clo))<br>(/Users/peter/Library/texmf/tex/latex/pst-plot.sty<br>(/Users/peter/Library/texmf/tex/latex/pstricks.sty
<br>(/Users/peter/Library/texmf/tex/latex/pstricks.tex<br>`PSTricks' v1.10 <2005/08/13> (tvz)<br>(/usr/local/teTeX/share/texmf.tetex/tex/generic/pstricks/pstricks.con))<br>(/usr/local/teTeX/share/texmf.tetex/tex/latex/xcolor/xcolor.sty
<br>(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/color.cfg)<br>(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/dvips.def)))<br>(/Users/peter/Library/texmf/tex/latex/pst-plot.tex v97 patch 2, 1999/12/12<br>
(/usr/local/teTeX/share/texmf.tetex/tex/generic/multido/multido.tex<br> v1.41, 2004/05/18 <tvz>))) (./test2.aux) [1] (./test2.aux)<br><br> *File List*<br> article.cls 2004/02/16 v1.4f Standard LaTeX document class
<br> size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)<br>pst-plot.sty 2004/07/15 package wrapper for pst-plot.tex<br>pstricks.sty 2004/05/12 v0.2l LaTeX wrapper for `PSTricks' (RN,HV)<br>pstricks.tex
2005/08/13 v1.10 `PSTricks' (tvz)<br> xcolor.sty 2004/07/04 v2.00 LaTeX color extensions (UK)<br> color.cfg 2005/02/03 v1.3 color configuration of teTeX/TeXLive<br> dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
<br>pst-plot.tex 2004/05/18 1.41 `pst-plot' (tvz)<br> ***********<br><br> )<br>Output written on test2.dvi (1 page, 146756 bytes).<br>Transcript written on test2.log.<br>### /usr/local/teTeX/bin/powerpc-apple-darwin-current/dvips -R -Poutline -o /tmp/altpdflatex.4451-1129320130/test2.ps
test2.dvi<br>This is dvips(k) 5.95a Copyright 2005 Radical Eye Software (<a href="http://www.radicaleye.com">www.radicaleye.com</a>)<br>' TeX output 2005.10.14:1602' -> /tmp/altpdflatex.4451-1129320130/test2.ps<br><
<a href="http://tex.pro">tex.pro</a>><<a href="http://pstricks.pro">pstricks.pro</a>><<a href="http://pst-dots.pro">pst-dots.pro</a>><<a href="http://texps.pro">texps.pro</a>><<a href="http://special.pro">
special.pro</a>><<a href="http://color.pro">color.pro</a>>. <br><cmsy10.pfb><cmr10.pfb>[1] <br>### ps2pdf13 /tmp/altpdflatex.4451-1129320130/test2.ps /tmp/altpdflatex.4451-1129320130/test2.pdf<br>Error: /invalidrestore in --restore--
<br>Operand stack:<br> 1426 5 (5) 1329 2583 5 (5) 1329 2583 5 (1) 1217 2373 5 (2) 1217 2255 5 (3) 1217 2137 5 (4) 1217 2019 5 (5) 1329 2583 5 (1) 1153 2842 5 (2) 1153 2960 5 (3) 1153 3078 5 (4) 1153 3196 5 (5) 1329 2583 5 --nostringval-- --nostringval--
<br>Execution stack:<br> %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 51 4 %oparray_pop --nostringval-- 51 4 %oparray_pop --nostringval--
<br>Dictionary stack:<br> --dict:1120/1686(ro)(G)-- --dict:0/20(G)-- --dict:72/200(L)-- --dict:179/300(L)--<br>Current allocation mode is local<br>Last OS error: 2<br>Current file position is 198584<br>AFPL Ghostscript
8.51: Unrecoverable error, exit code 1<br>### FAILED to generate /tmp/altpdflatex.4451-1129320130/test2.pdf ()<br><br><br>-----------CODE BELOW--------<br><br> %!TEX TS-program = latex<br>\listfiles<br>\documentclass[a4paper]{article}
<br>\usepackage{pst-plot}<br> <br><br><br>\begin{document}<br>%% if this is above 1cm no problems:<br>\psset{unit=0.5cm}<br><br>\SpecialCoor% importanmt for all examples<br>\begin{pspicture}(-6,-6)(6,6)<br> \psaxes{<->}(0,0)(-6,-6)(6,6)
<br> \psset{arrows=->}<br> \multido{\ia=-5+1}{11}{%<br> \multido{\ib=-5+1}{11}{%<br> \pstVerb{/x \ia\space def<br> /y \ib\space def<br> y 0 eq<br> {/ValueTempA 0 def
<br> /ValueTempB 0.5 def}<br> {/ValueTempZ 10 def<br> /ValueTempA y ValueTempZ div def<br> /ValueTempB x neg ValueTempZ div def}<br> ifelse}
<br> \psline(! x ValueTempA sub y ValueTempB sub)<br> (! x ValueTempA add y ValueTempB add)}}<br>\end{pspicture}<br>\begin{pspicture}(-6,-6)(6,6)<br> \psaxes{<->}(0,0)(-6,-6)(6,6)<br> \psset{arrows=->}
<br> \multido{\ia=-5+1}{11}{%<br> \multido{\ib=-5+1}{11}{%<br> \pstVerb{/x \ia\space def<br> /y \ib\space def<br> y 0 eq<br> {/ValueTempA 0 def<br> /ValueTempB
0.5 def}<br> {/ValueTempZ 2 1 x x mul y y mul div add sqrt mul def<br> /ValueTempA 1 ValueTempZ div def<br> /ValueTempB x neg y ValueTempZ mul div def}<br> ifelse}
<br> \psline(! x ValueTempA sub y ValueTempB sub)<br> (! x ValueTempA add y ValueTempB add)}}<br>\end{pspicture}<br><br><br><br>\end{document}<br><br><br><br>