[OS X TeX] .ps graphics, pdflatex, and priority

Charles Shooshan chasshoo at snet.net
Sun Sep 16 15:17:41 EDT 2012

Good day!

Thanks all for help in the "Memoir class book template" thread regarding .ps graphics. As a new thread, here is my progress and question with respect to using .ps graphics with pdflatex ...

I started with this working file:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\immediate\write18{repstopdf ./img/elephant.ps}
\includegraphics[scale=0.5]{./img/elephant}
\end{document}

After help, I moved to this:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{repstopdf #1 --outfile=\OutputFile}
\PrependGraphicsExtensions{.ps}
\includegraphics[scale=0.5]{./img/elephant}
\end{document}

Then, I realized that I didn't want to do a conversion if an existing .png, .pdf, or even .eps graphics file existed in the img folder so I changed to this:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{repstopdf #1 --outfile=\OutputFile}
\AppendGraphicsExtensions{.ps}
\includegraphics[scale=0.5]{./img/elephant}
\end{document}

Finally, I created the file ~/Library/texmf/tex/latex/config/epstopdf.cfg with the following two lines:

\epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{repstopdf #1 --outfile=\OutputFile}
\AppendGraphicsExtensions{.ps}

I changed my document to:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[scale=0.5]{./img/elephant}
\end{document}

It worked and the priority of graphics file handling is .png, .pdf, .eps (with conversion) and .ps (with conversion).

Here are my questions:

1. Is this a good solution (any downside to having the epstopdf.cfg file locally)?

2. Is my decision to make .ps the lowest priority consistent with good practices? [I figure that I should use a file I already converted to .png or .pdf rather than an original .ps file provided by someone else. I will likely never create graphics files in the .ps format.]

3. I noticed that some online examples would suggest that I break my two-line file into four lines (for readability?) like this:

\epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{%
repstopdf #1 --outfile=\OutputFile
}
\AppendGraphicsExtensions{.ps}

Should I do this as a matter of style?

Thank you,
Charlie