0

Following "The current state of pstricks project" (Herbet Voss, TUGboat, Vol31 (2101), no.1) I prepared a file unitz.tex containing 3 pspicture.

\documentclass{standalone}
\usepackage{pstricks}
\usepackage{pstricks-add}
%\usepackage{pst-plot}
\usepackage{calc}
\usepackage{auto-pst-pdf}

\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}

%\newcommand\picwid{2.35}
%\newcommand\pichei{2.35}

\begin{document}
%\begin{pspicture*}(-\picwid,-\picwid)(\pichei,\pichei)
\begin{pspicture}   

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=\linwid, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]


\end{pspicture}

\begin{pspicture}  

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}

\begin{pspicture}   
   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}

\end{document}

The results were duly presented in images/. Unfortunately each of unitz-fig-n.pdf (n=1,2.3) slightly clipped \mathbb{C}_{\mathbb{Q}} placed at (2,2).

enter image description here

File unitz-fig-n.tex are also created in /images. To remedy the problem I ran pdflatex on each of theses files and subsequently pdf2ps and ps2eps, and the resulting files both pdf and eps were NOT clipped. I noted that unitz-fig-n.pdf files created by pst2pdf are overwritten without warning by pdflatex.

enter image description here

Note that, for clarity, I have removed everything in my original pspictures apart from axes and annotation.

pst2pdf unitz.tex -c -e
cd images/
pdflatex --shell-escape unitz-fig-1.tex
pdflatex --shell-escape unitz-fig-2.tex
pdflatex --shell-escape unitz-fig-3.tex
pdf2ps unitz-fig-1.pdf
ps2eps -f unitz-fig-1.ps
pdf2ps unitz-fig-2.pdf
ps2eps -f unitz-fig-2.ps
pdf2ps unitz-fig-3.pdf
ps2eps -f unitz-fig-3.ps

I am puzzled. Why does the pst2pdf clip, while producing .tex files that produce unclipped images by pdflatex. I might also have tried pst2pdf on its own .tex output. I am fascinated but exhausted.

This has followed weeks of experimenting, following the LaTeX->dvips -e route as originally I was happy with eps. All files were clipped or resulted in absurd white space regions. I believed that bounding boxes should find the smallest rectangular region that will contain all postscript creations. I used GS which tried to help by adjusting bounding boxes but to no avail. I tried GS pdf round-tripping without success (LaTeX eps approach).

latex unitz.tex 
dvips -o unitz.ps unitz.dvi
ps2eps -g -f unitz.ps
gs -o so#126826212.pdf -sDEVICE=pdfwrite -dEPSCrop unitz.ps
gs -o unitz.roundtripped.eps -sDEVICE=eps2write so#126826212.pdf

I should also point out that I have no clear understanding of how latex produces the dvi file. Do I actually need pspicture (if a file only contains one graphic). My preference is to start with an origin in my model of the world and create pstricks objects relative to that. I do not really mind wrapping the things in a pspicture (of course if there is more than one) but I object to having to set the size of the pspicture. You will see in the attached file that I have experimented with different sizes of pspicture but have still obtained superfluous white space. I have not found any pstricks documentation that discusses this.

3
  • The problem itself is not pst2pdf but rather the drawing area of the environments, if you use [showgrid=true] and adjust it well, the script does the right thing Sep 15, 2020 at 16:31
  • Thanks for your reply but this is what I wish to avoid. I recall from documentation that it is not necessary and indeed this is demonstrated above. But I do not understand why.
    – paul
    Sep 23, 2020 at 14:04
  • I understand, maybe I expressed myself wrong, the point is that you must express a BB box size (that includes at least the size of the drawing) otherwise the cut won't fit well Sep 23, 2020 at 16:54

1 Answer 1

1

Let's analyze a little your MWE, I modified the class to article, commented the package auto-pst-pdf and changed the line 21 to linewidth=0.005pt, added the word TEXT between the environments and [showgrid=true].

\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
%\usepackage{pst-plot}
\usepackage{calc}
%\usepackage{auto-pst-pdf}

\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}

%\newcommand\picwid{2.35}
%\newcommand\pichei{2.35}

\begin{document}
TEXT
%\begin{pspicture*}(-\picwid,-\picwid)(\pichei,\pichei)
\begin{pspicture}[showgrid=true]

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]


\end{pspicture}
TEXT
\begin{pspicture}  

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}
TEXT
\begin{pspicture}   
   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}
TEXT
\end{document}

When you compile the document using latex>dvips>ps2pdf the first page looks like: first page

If you look, the words TEXT should be in another position (and not on the drawing), this happens because the pspicture environment should carry the argument (x,y) or (x1,y1)(x2,y2). By omitting it and using pst2pdf or auto-pst-pdfthese call the pdfcrop script to crop the image, but, it is not generated correctly.

Adding this argument would make the code look like this:

\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
%\usepackage{pst-plot}
\usepackage{calc}
%\usepackage{auto-pst-pdf}

\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}

\newcommand\picwid{2.35}
\newcommand\pichei{2.35}

\begin{document}
TEXT
%\begin{pspicture*}(-\picwid,-\picwid)(\pichei,\pichei)
\begin{pspicture}(-\picwid,-\picwid)(\pichei,\pichei)

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]


\end{pspicture}
TEXT
\begin{pspicture}(-\picwid,-\picwid)(\pichei,\pichei)

   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}
TEXT
\begin{pspicture}(-\picwid,-\picwid)(\pichei,\pichei)
   \rput(-2.0, 2.0){\psscalebox{1.0}{${\mathbb{C_{\mathbb{Q}}}}$}}

   \psaxes[linewidth=0.005pt, ticks=none, labels=none, dx=1.0, dy=1.0]{->}(0,0)(-2,-2)(2,2)[$\Re$,0][$\Im$,90]

\end{pspicture}
TEXT
\end{document}

Now, when you run pst2pdf -e test.tex the output test-pdf.pdf is the expected one along with the images in .eps format. output_ok

2
  • Pablo, I am returning to this after some time and I cannot recall all the paths I took. Yet I posted since I was able to produce the way I wished I just had to find the correct procedure as I described. This I obtained by brute force not insight. I do not know where all this is documented and until then I remain unenlightened. You say "not generated correctly" do you mean the software is in error or that therefore does not generate correctly?
    – paul
    Sep 29, 2020 at 20:25
  • When I say "not generated correctly" I mean that the bbox of the generated drawing is not the expected one (it is the default box if you don't pass parameters), it is in the documentation of pstricks (V Picture Tools, p40) Sep 30, 2020 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .