Up until now, I have been using the MikTeX compiler along with the TeXnicCenter editor to compile latex documents to pdf via ps, i.e., LaTeX ==> PS ==> PDF.
However, I recently run into the printing problem of rotated pages (using the sidewaysfigure environment) inside twosided documents, as exactly described here: Page upside down?
The question is, is it OK to compile directly to PDF, thus skipping PS, in order to have the rotated pages print properly in an easy manner? For reference, I am compiling a large document including a number of .eps figure (either vector-only or mixed vector/image content). Am I missing some functionality by skipping the PostScript creation?
Best Answer
In principle you can switch from
.eps
files to.pdf
without much ado, as long as there is no other directPostScript
code in your document, e.g.pstricks
orpsfrag
.The formats of
.pdf
and.eps
files are completely different andpdflatex
can handle inclusion of.jpg
,.png
,.gif
and.pdf
(recognized ones) files, but not.eps
or.ps
files.In order to use such files in your
.tex
document, those.eps
files has to be converted to.pdf
(or one of the recognized ones). This can be doneepstopdf
perl script (see http://www.ctan.org/pkg/epstopdf), ideally having a file namedfoo.eps
to become foo.pdf, so nothing has to be changed in*.tex
file, as long as no direct extension is given. This means direct inclusion after direct conversion.pdftex
orpdflatex
do the job by converting the graphics file while compilation. In this case the filefoo.eps
will be converted tofoo-eps-converted-to.pdf
, having really that longer name. There is the packageepstopdf
(not to be confused withepstopdf
perl script!), giving some options how the conversion is done etc. Automatic conversion requires theshell-enable
feature, i.e.pdflatex --shell-escape
. This is called on-the-fly-conversionRegarding the aspects of including rotated pictures or (via
sidewaysfigure
): Some.eps
generators produce already rotated pictures, so they have to be either rotated again (to the other direction) or can be included correctly, depending on the particular application.The package
graphicx
allows for\DeclareGraphicsPath
and\DeclareGraphicsExtension
commands.Generally said, it is better to omit the file extension in
\includegraphics
, such that\includegraphics
can search a list of possible extensions and include the first match. If you rather prefer to includefoo.jpg
instead offoo.pdf
, then say\includegraphics{foo.jpg}
explicitly.Regarding such
PostScript
specific code frompsfrag
orpstricks
: In my personal point of view, it is better to generate a standalone.eps
file from that code withlatex
in an other*.tex
document and include it in the current.tex
file, with one of two possibilities mentioned above. In this casepstricks
packagepst-eps
might help, in conjunction withdvips -E -o
option.