[pstricks] Is pst-pdf meant to work with arbitrary postscript

Gene Selkov selkovjr at gmail.com
Wed Sep 16 16:11:15 CEST 2009


2009/9/16 Herbert Voss <Herbert.Voss at fu-berlin.de>:

> you should simply try ps2pdf.

I tried. It does not preserve page geometry and introduces some odd
distortions to both text and graphics. Things often fall off the
verge. Sometimes I get a pdf file that I can view on my screen, but
things get lost (even those safely within the page margins) when
printed. So I am not sure which problem is easier to solve -- this or
ps2pdf.

> You need pst-pdf only when you want
> to use the microtype package or include a lot of jpeg or pdf
> images.

I need to include a lot of PS specials (thousands of them). They are
generated by the ochem package.

When I feed them to pdfjadetex, it says,

  Non-PDF special ignored!

I read about ps4pdf first, and I understood that it can somehow
convert arbitrary postscript into something acceptable in PDF. The
first thing I tried with it -- interpreting the external EPS
references -- worked fine, and so did some of the simple specials.
Then I ran into this "undefined" problem with one of the specials, and
I am still stuck there. I understood that ps4pdf mutated into pst-pdf,
and tried that. I can see a greater convenience of invocation, but the
result is the same.

So the question remains, can it do it or can it not, and if it can,
what am I doing that it doesn't like?


> without a complete minmal example it is not possible
> to locate the problem.

Here's a complete example, although I am not sure how close to minimal
it is. The tex file is generated, and I don't know what parts of it
can be thrown out without damaging it. All I could do was to reduce
the book data at the start of the pipeline to the minimal allowed set
of elements. The minimal set that reproduces the problem includes:

book.tex                         generated by the docbook DSSSL;
modified to include pst-pdf
aminogroup.ctx            derived form the chemical environment in
book.tex on the first pass;
                                        changed picture -> pspicture
hydroxybutanoic.ctx    similar; this one contains the undefined postscript macro
ochem.sty                      needed to hook up the *ctx includes

The sequence leading to the error:

1. modifications in the generated data (already in the attached files)

    in book.tex, this was added as the first line:

      \usepackage{pst-pdf}

   in *ctx files, "picture" is replaced with "pspicture"

2. pdfjadetex book.tex

      completes with these warnings:

      [3.0.3] [4.0.3] (./aminogroup.ctx
      Package pst-pdf Warning: pspicture No. 1 undefined.
      ) (./hydroxybutanoic.ctx
      Package pst-pdf Warning: pspicture No. 2 undefined.
      ) [1.0.3] [2.0.3]

3. jadetex book.tex

      also completes, with these warnings:

      (./aminogroup.ctx
        Overfull \hbox (233.35994pt too wide) in paragraph at lines 16--16
      (./hydroxybutanoic.ctx
        Overfull \hbox (1664.53304pt too wide) in paragraph at lines 24--24

     (the line numbers correspond to the last line in each file)

     I do not get these warnings while processing the same data without pst-pdf

4. dvips -P pdf -o book-pics.ps book.dvi
    This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software
(www.radicaleye.com)
    ' TeX output 2009.09.16:1426' -> book-pics.ps
    kpathsea: Running mktexpk --mfmode ljfour --bdpi 8000 --mag
1+0/(2*4000) --dpi 8000 ecss1000
    mktexpk: Mismatched mode ljfour and resolution 8000; ignoring mode.
    mktexpk: /home/selkovjr/.texmf-var/fonts/pk/dpdfezzz/jknappen/ec/ecss1000.8000pk
already exists.
    </home/selkovjr/.texmf-var/fonts/pk/dpdfezzz/jknappen/ec/ecss1000.8000pk>
    </usr/share/texmf-texlive/dvips/base/tex.pro>
    </etc/texmf/dvips/config/alt-rule.pro>
    </usr/share/texmf-texlive/dvips/pstricks/pstricks.pro>
    </usr/share/texmf-texlive/dvips/pstricks/pst-dots.pro>
    </usr/share/texmf-texlive/dvips/base/texps.pro>
    </usr/share/texmf-texlive/dvips/base/special.pro>
    </usr/share/texmf-texlive/dvips/base/color.pro>.
    </usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmr7.pfb>[1] [2]

Both picures get written, and both are broken. This is a correction to
my earlier statement that one of them was generated successfully. Now
I see that it is missing a graphics element. The second picture is
broken enough to cause a postscript error.

I compared the DVIs generated by the successful (all-PS) sequence and
by this process. The successfull book.dvi has this for b12:

   def /b12 { pop pop pop pop}

It also has a bunch of other definitions, including the one that I
believe is used in the first picture:

   def /b0 { /bl exch def gsave translate rotate newpath 0 0 moveto bl
0 lineto stroke grestore }

The broken book.dvi has none of those, not even the b0 that is the
only command invoked in the first special, but somehow it does not
cause the undefined error.

I don't know what to make of all this. How can I locate the component
responsible for the generation of those definitions?

Thanks,

--Gene
-------------- next part --------------
A non-text attachment was scrubbed...
Name: book.tex
Type: application/x-tex
Size: 9558 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20090916/62df83ee/attachment-0001.tex>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aminogroup.ctx
Type: chemical/x-ctx
Size: 526 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20090916/62df83ee/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hydroxybutanoic.ctx
Type: chemical/x-ctx
Size: 842 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20090916/62df83ee/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ochem.sty
Type: text/x-tex
Size: 12313 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20090916/62df83ee/attachment-0005.bin>


More information about the PSTricks mailing list