# [Tex/LaTex] Is EPS or PDF the preferred figure format when typesetting in LaTeX

epsgraphicsMATLABpdf

What is the best file format for figures to use when typesetting in LaTeX? I prefer eps for my MATLAB figures; however, I found this question ( Which figure type to use: pdf or eps? ) where the recommendation is pdf.

I like converting with LaTeX to get a real-time preview of my document in DVI. Unfortunately, problems arise when I have raster graphics to include. Since it is not possible to make DVIs with rasters, I currently encapsulate them in eps, but the results are poor: if I do not enter any sizing options the image appears enlarged and smudgy. The same problem occurs with eps produced with MATLAB, although scaling them down does not make them smudgy since it is a real vector diagram. What causes this enlargement?

For photos, screenshots and such bitmap graphics, you could use their native format (to preserve quality) if it's jpeg or png. Otherwise convert those pictures to png or at least to lossless jpg.

For drawings, plots and diagrams you better use a vector image format, because it can be scaled without quality loss. Possible vector formats are pdf and ps.

It also depends on which compiler you use: latex or pdflatex. The latter has some benefits like better justification because of microtypographic enhancements and it natively supports jpg, png and pdf, and you can use ps if converted to pdf.

My usage order with pdflatex is

1. pdf - for example output of other programs
2. ps - PSTricks or program output, then I use ps2pdf to go to 1.
3. png - screenshots, bitmap graphics (if necessary convert to png)
4. jpg - only if it's already the source format because jpg often uses lossy compression

Without pdflatex the question is not very interesting, latex supports only eps, conversion of bitmap images to eps is often not satisfying.