[pstricks] Problem with pst-pdf?
McGarry Vince
vmcgarry at austin.rr.com
Tue May 2 00:38:05 CEST 2006
I've noted a problem with pst-pdf (I think); I don't think the
problem is with psgraph nor with the script I'm using. See the
examples below.
The following compiles using Latex.
%%%%% Example 1
\listfiles
\documentclass{article}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\begin{document}
\psset{llx=-0.8cm,urx=0.5cm,lly=-0.5cm,ury=0.5cm}
\psgraph(0,0)(0,-4)(20,4){\linewidth}{6cm}
\psset{algebraic=true}
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0.01}{20}{ln(x)}%
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{20}{cos(x)*2.71^
(-x/10)}
\psplot[linecolor=blue,showpoints=true]{0}{20}{cos(x)*2.71^(-x/10)}
\endpsgraph
\end{document}
%%%%%
Using the script attached at the end, the following fails with error
Runaway argument?
linewidth=4\pslinewidth ]{0.01}{20}{ln(x)}\psplot [linecolor=yellow,l
\ETC.
! File ended while scanning use of \psgraph at ii.
%%%%% Example 2
\listfiles
\documentclass{article}
\usepackage{pst-pdf}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\begin{document}
\psset{llx=-0.8cm,urx=0.5cm,lly=-0.5cm,ury=0.5cm}
\psgraph(0,0)(0,-4)(20,4){\linewidth}{6cm}
\psset{algebraic=true}
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0.01}{20}{ln(x)}%
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{20}{cos(x)*2.71^
(-x/10)}
\psplot[linecolor=blue,showpoints=true]{0}{20}{cos(x)*2.71^(-x/10)}
\endpsgraph
\end{document}
%%%%%
but the following works using the same script:
%%%%% Example 3
\listfiles
\documentclass{article}
\usepackage{pst-pdf}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(0,0)(20,8)
\psset{llx=-0.8cm,urx=0.5cm,lly=-0.5cm,ury=0.5cm}
\psgraph(0,0)(0,-4)(20,4){\linewidth}{6cm}
\psset{algebraic=true}
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0.01}{20}{ln(x)}%
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{20}{cos(x)*2.71^
(-x/10)}
\psplot[linecolor=blue,showpoints=true]{0}{20}{cos(x)*2.71^(-x/10)}
\endpsgraph
\end{pspicture}
\end{document}
%%%%%
and the following works with either the pspicture wrapper or without:
%%%%% Example 4
\listfiles
\documentclass{article}
%\usepackage{pst-pdf}
\usepackage{ps4pdf} % deprecated, but works where pst-pdf fails
\PSforPDF{%
\usepackage{pst-plot}
\usepackage{pstricks-add}
}
\begin{document}
\PSforPDF{%
%\begin{pspicture}(0,0)(20,8) % not needed when using ps4pdf.sty
\psset{llx=-0.8cm,urx=0.5cm,lly=-0.5cm,ury=0.5cm}
\psgraph(0,0)(0,-4)(20,4){\linewidth}{6cm}
\psset{algebraic=true}
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0.01}{20}{ln(x)}%
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{20}{cos(x)*2.71^
(-x/10)}
\psplot[linecolor=blue,showpoints=true]{0}{20}{cos(x)*2.71^(-x/10)}
\endpsgraph
%\end{pspicture}
}
\end{document}
%%%%%
This is the script I use. (Herb Schulz's ps4pdf.engine)
%%%%%
#!/bin/sh
basefname=$(basename "$1" .tex)
# process the figures
latex --shell-escape "$1"
dvips -Ppdf -o "${basefname}-pics.ps" "${basefname}.dvi"
ps2pdf13 -dAutoRotatePages=/None "${basefname}-pics.ps" "${basefname}-
pics.pdf"
pdfcrop "${basefname}-pics.pdf"
/bin/mv "${basefname}-pics-crop.pdf" "${basefname}-pics.pdf"
/bin/rm "${basefname}-pics.ps" "${basefname}.dvi"
#process the file
pdflatex --shell-escape "$1"
%%%%%
Here's the file list for the above (Example 3)
*File List*
article.cls 2005/09/16 v1.4f Standard LaTeX document class
size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
pst-pdf.sty 2005/06/29 v1.1i PS graphics for pdfLaTeX (RN,HjG)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive
pdftex.def 2002/06/19 v0.03k graphics/color for pdftex
pstricks.sty 2005/12/19 v0.31 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex 2005/12/22 v1.14 `PSTricks' (tvz)
xcolor.sty 2005/12/21 v2.09 LaTeX color extensions (UK)
color.cfg 2005/02/03 v1.3 color configuration of teTeX/TeXLive
preview.sty 2005/09/25 11.81 (AUCTeX/preview-latex)
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pst-plot.sty 2004/07/15 package wrapper for pst-plot.tex
pst-plot.tex 2004/05/18 1.41 `pst-plot' (tvz)
pstricks-add.sty 2005/03/03 package wrapper for pstricks-add.tex (hv)
pstricks-add.tex 2006/04/22 v2.74i `PSTricks-add' (hv)
pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
xkeyval.sty 2005/11/25 v2.5e package option processing (HA)
xkeyval.tex 2005/11/25 v2.5e key=value parser (HA)
supp-pdf.tex
Vawter-pics.pdf Graphic file (type pdf)
***********
Vince McGarry
More information about the PSTricks
mailing list