3

I have problem to get eps pictures when I use PdfTexify in WinEdt 8.0 (MikTeX 2.9). It works if I use dvi2pdf, but I prefer PdfTexify, because it allows me to include attachments in pdf file as well as to make hyperlinks on references. Here is sample code

\documentclass[aps,pra,amsmath,amssymb,twocolumn,showpacs]{revtex4-1}
\usepackage{epsf}
\usepackage{graphicx}
\usepackage{attachfile}
\begin{document}
\begin{figure}[htb]
   \epsfxsize=6.5cm\centering{\epsfbox{f/1.eps}}
\end{figure}
check attached here \attachfile{2013-05-17.nb}
\end{document}

Also, I would like to know which of those two ways to get PDF output is more preferred/professional? Or is there a more professional way? Thank you in advance.

5

Actually, epsf is a package designed to include .eps files in plain .tex files.

Anyway, if you want to continue using it in your document and, at the same time, you want to solve your problems with attached files, you can use the package attachfile2 with the option dvipdfmx instead of the package attachfile.

Simply substitute the line

\usepackage{attachfile}

with

\usepackage[dvipdfmx]{attachfile2}

so to have

\documentclass[aps,pra,amsmath,amssymb,twocolumn,showpacs]{revtex4-1}
\usepackage{epsf}
\usepackage{graphicx}
\usepackage[dvipdfmx]{attachfile2}
\begin{document}
\begin{figure}[htb]
   \epsfxsize=6.5cm\centering{\epsfbox{f/1.eps}}
\end{figure}
check attached here \attachfile{2013-05-17.nb}
\end{document}

Now you will be able to have the .pdf with the correct references to attached files compiling with the sequence latex -> dvi2pdf in WinEdt.


In regards of WinEdt, I remind you that PDFTeXify is a command that runs pdflatex, bibtex and makeindex as many times as needed for a completely compiled .pdf file.

You can change its behavior to run latex and subsequently dvipdfmx instead of pdflatex to accomplish your needs.

To do that, run the "Execution Modes" interface from the "Options" menu. Then select the page "TeX Options" and change the "PDFTeXify Method" from "Default" to "dvi -> pdf", as shown in the image below.

enter image description here

Turn things back to have its usual behavior.


Update

Anyway, I think you'd better use a more modern way to load .eps files in your document and use pdflatex to compile it.

I suggest to use the epstopdf package, which converts your 1.eps file to 1-eps-converted-to.pdf at runtime and uses it instead of the .eps one.

Remember to load the epstopdf package after graphicx or you might get errors.

Your MWE can be rewritten as

\documentclass[aps,pra,amsmath,amssymb,twocolumn,showpacs]{revtex4-1}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{attachfile}
\begin{document}
\begin{figure}[htb]
  \centering
  \includegraphics[width=6.5cm]{f/1.eps}
\end{figure}
check attached here \attachfile{2013-05-17.nb}
\end{document}

and compiled with PDFTeXify with no changes in WinEdt.

  • thank you for answer, but your code gives following error when I TeXify: ! Package keyval Error: dvipdfmx undefined. See the keyval package documentation for explanation. Type H <return> for immediate help. ... l.273 \ProcessKeyvalOptions{AtFi} ? Process has been terminated ... Also what would you suggest for using eps files more professionally? Can you provide simple example? – eRic Jul 29 '13 at 18:25
  • @eRic I cannot reproduce the error with the MWE. You are talking about another file and I don't know what it contains... – karlkoeller Jul 29 '13 at 18:44
  • @eRic see the update in the answer about a "more professional" way. – karlkoeller Jul 29 '13 at 19:06
  • I tried your 1st MWE and that gave me error. And your updated MWE works perfectly. Thanks! – eRic Jul 29 '13 at 19:27
  • When I use PDFTexify using same eps file it decrease the quality of image, while with dvi2pdf the quality is much better. Do you know how can I improve image quality in final pdf file? I saw here ctan.sharelatex.com/tex-archive/support/epstopdf/… that I can use --res=DPI for the resolution, but I don't know what would be the syntax for that option in WinEdt. – eRic Aug 15 '13 at 19:37

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.