Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Creating PostScript from *tex

DZone's Guide to

Creating PostScript from *tex

Latex is a common format for scientific and technical documents. Creating PostScript from it is an essential, but unnecessarily time-consuming task fraught with errors. This workaround will cut down on the time you commit to the process.

Free Resource

Sensu is an open source monitoring event pipeline. Try it today.

Creating a PostScript file from the *tex sources can be time consuming.

The common option is to convert tex -> dvi using latex, and then dvi -> ps using a comment such as:

$ dvips -y 1200 -o main.ps -p 5 -n 3 main.dvi

In fact, traditionally it has always been tex -> dvi -> pdf.  However, latex command often gives errors and issues in including the images, such as the below:

! LaTeX Error: Cannot determine size of graphic in deployments.png (no Bounding Box)

(See here.)

Using pdflatex package avoids the issue with the images in tex to PDF conversion, but not a way to create a .dvi or .ps.

The option is to use tex -> pdf -> ps, using pdflatex and pdftops, e.g., 

$ pdftops -level3 main.pdf main.ps

which produced 18.2 MB of .ps for a .pdf of 863.6 kB.

For the same PDF,

$ pdftops -binary -level3 main.pdf main.ps

produced a ps output of 14.6 MB, the smallest size I was able to go to without making the ps unreadable.

The output ps is still not perfect, and the other packages and options provided an even worse ps.

Sensu: workflow automation for monitoring. Learn more—download the whitepaper.

Topics:
pdf ,latex

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}