Tuesday, January 5, 2016

Creating .ps from tex

I did not know that creating a postscript file from the latex sources can be time consuming. The commonest 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
See here.

Using pdflatex package avoids the issue with the images in tex to PDF conversion. However, I could not find a way yet to create a dvi or ps using pdflatex.

So for now, I am left with the option of tex -> pdf -> ps, using pdflatex and pdftops (I know it does not sound smart).

$  pdftops -level3 main.pdf main.ps
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.
This was the smallest size I was able to go, without making the ps unreadable. The output ps is still not perfect, and the other packages and options provided an even worse ps.

No comments:

Post a Comment

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.