[pstricks] Problem with pstricks-add (psgraph) and pst-pdf

Bruce Burlton bruceburlton at sympatico.ca
Tue Jan 1 19:03:51 CET 2008


> I have a problem that I cannot resolve when I use the psgraph together 
> with pst-pdf,as shown in the minimal example below.  The original data 
> file is much longer, and created externally.  I have truncated it and used 
> the filecontents package for brevity.  I am running WinXP/SP2 with MiKteX 
> and WinEdt.
>
> When \pst-pdf is "uncommented", I get the following error, when I compile 
> using LaTeX
>
> Runaway argument?
> {0,40})({366,70})\pr at endbox {10cm}{5cm}\readdata {\datafile }{./data/\ETC.
> ! Paragraph ended before \psgraph at ii was complete.
> <to be read again>
>                   \par
>
> If I comment the \pst-pdf line, and run LaTeX -> dvips -> pspdf, I get the 
> output I expect and desire.
>
> The reason that I wish to use \pst-pdf is that I am producing large 
> lecture notes and slides (a la beamer) which also have many .jpegs
>
> and .png included.  I seem to be able to incorporate other pstricks 
> related images, but suffer the failure when I try to use psgraph.
>
> An additional question, if I may.  I used to use the ps4pdf package 
> instead of pst-pdf.  It worked quite well, given that all the pstricks 
> code had to be "bracketted" with  PSforPDF{ ... }.  Unfortunately it seems 
> to have been removed, and near as I can tell superceded by \pst-pdf.  Can 
> anyone tell me what happened here?
>
>
> \documentclass{article}
>
> \usepackage{filecontents}
> \begin{filecontents*}{datafile1.dat}
> 0.00000000,54.188
> 1.00000000,54.164
> 2.00000000,54.136
> 3.00000000,54.105
> 4.00000000,54.071
> 5.00000000,54.033
> 6.00000000,53.992
> 7.00000000,53.947
> 8.00000000,53.899
> 9.00000000,53.847
> 10.00000000,53.792
> \end{filecontents*}
>
> \listfiles
>
> \usepackage{pst-pdf}%
>
> \usepackage{pstricks-add}%
>
> \begin{document}
>
> \psset{yAxisLabel=Beta Angle (degrees),xAxisLabel={Days from Vernal 
> Equinox},%
>  xAxisLabelPos={5cm,5.75cm},yAxisLabelPos={-1.cm,9cm}}%
> \begin{psgraph}[axesstyle=frame,{xticksize=0 30},{yticksize=0 
> 366},Dx=50,Dy=10,Oy=40](0,40)(366,70){10cm}{5cm}%
>  \readdata{\datafile}{./datafile1.dat}%
>  \listplot[linecolor=red]{\datafile1}%
> \end{psgraph}%
>
> \end{document}
>
> The output of listfile (with \pst-pdf commented)
>
> *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)
> filecontents.sty    2006/03/11 v1.1a Create an external file from within a 
> LaTeX document
> pstricks-add.sty    2007/09/03 v. 0.11 package wrapper for 
> pstricks-add.tex (hv)
> pstricks.sty    2006/08/10 v0.32 LaTeX wrapper for `PSTricks' (RN,HV)
> pstricks.tex    2006/12/22 v1.15 `PSTricks' (tvz)
>  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
>   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
>   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
> pstricks-add.tex    2008/01/01 v3.00 `PSTricks-add' (hv)
> pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
> xkeyval.sty    2006/11/18 v2.5f package option processing (HA)
> xkeyval.tex    2006/11/18 v2.5f key=value parser (HA)
> pstricks-add.pro    2007/11/18 v. 0.15, PostScript prologue file (hv)
> ***********
>
> If I comment all he psgraph code, the listfile produces
>
> *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)
> filecontents.sty    2006/03/11 v1.1a Create an external file from within a 
> LaTeX document
> pst-pdf.sty    2007/06/04 v1.1p 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    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
>   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
> pstricks.sty    2006/08/10 v0.32 LaTeX wrapper for `PSTricks' (RN,HV)
> pstricks.tex    2006/12/22 v1.15 `PSTricks' (tvz)
>  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
>   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
> preview.sty    2006/08/25 11.84 (AUCTeX/preview-latex)prtightpage.def
>  pdftex.def    2007/06/12 v0.04h Graphics/color for pdfTeX
> pstricks-add.sty    2007/09/03 v. 0.11 package wrapper for 
> pstricks-add.tex (hv)
> pstricks-add.tex    2008/01/01 v3.00 `PSTricks-add' (hv)
> pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
> xkeyval.sty    2006/11/18 v2.5f package option processing (HA)
> xkeyval.tex    2006/11/18 v2.5f key=value parser (HA)
> pstricks-add.pro    2007/11/18 v. 0.15, PostScript prologue file (hv)
> ***********
>
> Bruce Burlton
> Carleton University
> -------------- next part --------------
Thanks to both Herbert Voss and Vincent McGarry for their suggestions and 
advice.  Both seem to work nicely, with one caveat.  I found I had to 
increase the "bounding box" with either solution (about -1.5 cm in the lower 
ledt and +0.5cm in the upper right)  Otherwise I got an image precisely the 
size of  the graph, without either labels or numbers

Herbert, where can I find out more about the \previewEnvironment command?

Again thanks and Happy New Year to all

Bruce Burlton 




More information about the PSTricks mailing list