2

I am compiling a single file using REVTEX 4.1. My image files are .eps files, and epstopdf is converting them on compilation. I load the following packages,

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{epstopdf}

and this all works fine, except for the quality of bitmaps embedded in the images is terrible. They appear to be heavily compressed. I suspect I need to set an option for epstopdf, but I don't know what. I tried

\epstopdfsetup{quality=100}

and got the error Package keyval Error: quality undefined. This;

http://ctan.mirrorcatalogs.com/macros/latex/contrib/oberdiek/epstopdf.pdf

has no mention of quality.

This is not something I can render using a vector based format. Also, eps is the preferred format for this particular journal. Can anyone help?

Edited to add: I use CorelDraw, and export an .eps. If I inspect the .eps by loading it back into CorelDraw, it looks fine. if I inspect the eps-converted-to.pdf in a similar way, it looks very bad. See below - left is before epstopdf, right is after.

graphs of different quality

Edited further to add:

The following link: http://www.latex-community.org/forum/viewtopic.php?f=5&t=3025 reccomends the following;

\DeclareGraphicsExtensions{.eps,.pdf}
\DeclareGraphicsRule{.eps}{pdf}{.pdf}{`epstopdf --gsopt="-dPDFSETTINGS=/prepress -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -sColorImageFilter=FlateEncode -sGrayImageFilter=FlateEncode -sCompressPages=false -dPreserveHalftoneInfo=true" #1}

This is not a solution I fully understand, and in any case, it doesn't work - epstopdf fails to run at all. The solution further down the page:

\epstopdfsetup{update,prepend,verbose,suffix=-generated} % use suffix because you don't want to accidentally overwrite a file that might have been a pdf source. The epstopdf package manual has more on that.

\DeclareGraphicsExtensions{.eps,.pdf}
\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{epstopdf --gsopt="-dPDFSETTINGS=/prepress -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -sColorImageFilter=FlateEncode -sGrayImageFilter=FlateEncode -sCompressPages=false -dPreserveHalftoneInfo=true" #1 --outfile=\OutputFile}

sends the compilation into an unbreakable loop of some kind. I'm using TeXnicCenter, if that makes any difference.

8
  • 1
    Welcome to TeX.SX! I believe, this is not a real problem with the epstopdf command or package. It is rather connected to the fact, that bitmap graphics scales terribly. How did you create your image files? – user31729 Feb 24 '14 at 15:53
  • If it is a bitmap, why are you saving it as an EPS in the first place? Why not PNG or JPG? – daleif Feb 24 '14 at 16:14
  • There are other components of the diagram for which a vector format is appropriate. – NLambert Feb 24 '14 at 16:15
  • can you export to pdf from coral draw, rather than converting the eps? – David Carlisle Feb 24 '14 at 17:02
  • 1
    epstopdf is just a wrapper for ghostscript and does not change the quality at all. Also you can convert the file manually with ghostscript, e.g.: ps2pdf -dEPSCrop -dPDFSETTINGS=/prepress file.eps file.pdf. But I suspect this is more an issue with the PDF viewer showing bitmaps than a conversion issue. – Heiko Oberdiek Feb 24 '14 at 20:55
3

Ok, I cracked it. The link I cite in my question actually explains this, once I took the trouble to read it properly.

The following is added to the preamble after \include{epstopdf};

\epstopdfsetup{update,prepend,verbose,suffix=-generated} % use suffix because you don't want to accidentally overwrite a file that might have been a pdf source. The epstopdf package manual has more on that.
\DeclareGraphicsExtensions{.eps,.pdf}
\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{epstopdf --gsopt="-dPDFSETTINGS=/prepress -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -sColorImageFilter=FlateEncode -sGrayImageFilter=FlateEncode -sCompressPages=false -dPreserveHalftoneInfo=true" #1 --outfile=\OutputFile}

and the following MUST be added to the output profile/command line when running latex.

"--enable-write18"

Hope that is of use to someone else.

1
  • Exactly what I was looking for, I did not understood all the options you used but it works very well. It should be added as a native option to the epstopdf package ... – Thomas Dec 28 '14 at 9:11
0

I spent a couple of hours as a n00b trying to tackle this problem before realising I don't need this intermediate step of EPS as I once thought (SVG in inkscape exported as > EPS autoconverted to > PDF).

I now make all figures in inkscape, and export directly as PDF. To overcome this past mistake quickly, one can follow the Windows batch file instructions to convert a folder from svg to pdf https://gist.github.com/JohannesDeml/779b29128cdd7f216ab5000466404f11

3
  • 2
    Welcome to TeX.SE! – Mensch Feb 13 '19 at 23:05
  • Welcome also! You're quite right, the problem can be dodged by using different formats. But a significant number of journals strongly prefer EPS files for submission. – NLambert Feb 22 '19 at 7:10
  • Luckily, it's relatively easy to convert svg to eps using inkscape or inkscape batch. I just thought I had to use eps for LaTeX for some reason. – theskymoves Feb 24 '19 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.