9

I am currently using pdflatex on my Mac OS Yosemite to compile a simple code which is to demonstrate the problem I am having with another larger file. I am using TexLive 2014 and when running the following code on TexStudio I get an error:

\documentclass[11pt,notitlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=0.5in]{geometry}
\usepackage{graphicx}
\usepackage{epstopdf}

\begin{document}
    \includegraphics{test.eps}
\end{document}

I have tried every combination of including the .eps extension, or removing the \usepackage{epstopdf}, or placing \epstopdfsetup{outdir=./}. I don't know what I could possibly be doing wrong. I have also tried compiling using TexMaker and TexShop, but nothing works. The error I get in my log is the following:

(/usr/local/texlive/2014/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count91
\scratchdimen=\dimen113
\scratchbox=\box26
\nofMPsegments=\count92
\nofMParguments=\count93
\everyMPshowfont=\toks18
\MPscratchCnt=\count94
\MPscratchDim=\dimen114
\MPnumerator=\count95
\makeMPintoPDFobject=\count96
\everyMPtoPDFconversion=\toks19
)
Package epstopdf Info: Source file: <test.eps>
(epstopdf)                    date: 2014-08-01 13:34:15
(epstopdf)                    size: 6154549 bytes
(epstopdf)             Output file: <test-eps-converted-to.pdf>
(epstopdf)             Command: <repstopdf --outfile=test-eps-converted-to.pdf 
test.eps>
(epstopdf)             \includegraphics on input line 8.
runsystem(repstopdf --outfile=test-eps-converted-to.pdf test.eps)...executed sa
fely (allowed).

Package epstopdf Info: Result file: <test-eps-converted-to.pdf>.

! Package pdftex.def Error: File `test-eps-converted-to.pdf' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.8     \includegraphics{test}

Using draft setting for this image.
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

[1

{/usr/local/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./docu
ment.aux) ) 

Thank you so much in advance to anyone who can help!

MCF57
  • 103
  • Are you using the option --shell-escape within pdflatex? – Sigur Oct 18 '14 at 02:37
  • Yes, I have tried using that. – MCF57 Oct 18 '14 at 02:43
  • 2
    Can you upload the file test.eps somewhere and add a link to your question? Also, what happens if you do the conversion manually (i.e. epstopdf test.eps in the terminal)? Do you get a usable pdf image? – Ian Thompson Oct 18 '14 at 09:57
  • Ian, thank you so much for your help. When running epstopdf manually as you suggested while cd'ing to the folder containing the image I get the following error.

    'dyld: Library not loaded: /usr/X11/lib/libXt.6.dylib Referenced from: /usr/local/bin/gs Reason: image not found'

    – MCF57 Oct 19 '14 at 22:12
  • To add to that, I think there may also be a contribution to this issue when I updated my X11 to XQuartz 2.7.7. Also in regards to the eps image you can find it at http://goo.gl/nlQb6j – MCF57 Oct 19 '14 at 22:28
  • Also to add a bit of information, when compiling the same document with the same figure on my windows 7 machine I do not encounter any problems. – MCF57 Oct 19 '14 at 22:39
  • Related: Wireshark doesn't start after upgrading to Mac OS X Yosemite -- Assuming you installed XQuartz and then Yosemite, XQuartz moved X11 from /usr to /opt, and made a symbolic link. Yosemite blew away the link. Reinstalling XQuartz may fix it. – Mike Renfro Oct 19 '14 at 22:49
  • Thanks mike. I will try to do that right now and will let you know if it worked. – MCF57 Oct 20 '14 at 03:58
  • Mike that fixed it!!! I created a symbolic link and it all works magically. Maybe you should transfer this comment into a post bellow with more detailed instructions for people having the same issue. Awesome, thank you so much!!! – MCF57 Oct 20 '14 at 04:19
  • Answer edited and cleaned up considerably. – Mike Renfro Oct 20 '14 at 21:42

2 Answers2

8

So here's where we ended up (see edits and comments for the history):

User recently upgraded to OS X 10.10 (Yosemite), and couldn't automatically convert any EPS graphics into PDF as he'd done previously.

The user was also unable to use the known-working (but probably not truly minimal) MWE of

\documentclass[11pt,notitlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=0.5in]{geometry}
\usepackage{graphicx}

\begin{document}
%\includegraphics{207754.eps}
% copied from /usr/local/texlive/2014/texmf-dist/tex/latex/mwe/example-image-a.eps
\includegraphics{207754-op.eps}
% downloaded from http://goo.gl/nlQb6j and renamed
\end{document}

The same graphics and the same documents converted correctly on a Windows 7 system, and on other Yosemite systems.

The user was unable to use the epstopdf shell command to convert the graphics as well. This gave an error of dyld: Library not loaded: /usr/X11/lib/libXt.6.dylib Referenced from: /usr/local/bin/gs Reason: image not found.

The user had installed XQuartz at some point before the Yosemite upgrade.

In the end, it appears that the OS X upgrade undid some of the work of the XQuartz application, similar to how it undoes some of the work of the MacTeX installer, requiring the use of the FixMacTeX2014.pkg or similar packages. The image not found error also shows up in other X11-related applications after OS upgrades, such as wireshark. Since GhostScript is the main executable at the core of epstopdf command and the automatic conversion of EPS graphics to PDF in the newer graphicx packages, its failure to run was the root cause.

Reinstalling XQuartz (or possibly just restoring the symbolic link from /usr/X11 to /opt/X11) after the Yosemite upgrade fixed the problem.

Mike Renfro
  • 20,550
  • Mike, thanks for the information. As I mentioned, I tried every possible combination of including and not including the 'epstopdf' but nothing seems to work. This problem happens to all of my EPS figures, as it is my choice of figure formatting given the high resolution from its vectorized format. All was working well and compiling before I updated my Mac to OS Yosemite a couple of days ago. However the example image I am trying to include on my document be found at http://goo.gl/nlQb6j – MCF57 Oct 19 '14 at 22:22
  • I'll grab that image shortly. In the meantime, does my MWE work on your system? Mine's also Yosemite and MacTeX 2014. If my document works as is, then try your image in my document. That should narrow it down to either your image or your TeX installation. – Mike Renfro Oct 19 '14 at 22:25
  • Your image worked for me. So it doesn't appear to be the image. I assume that (for some unknown reason) you won't be able to build with the image from the MWE package. In your other conversation, one difference between our systems is that I've never installed XQuartz on this system at all. – Mike Renfro Oct 19 '14 at 22:40
  • Reinstalling XQuartz from http://xquartz.macosforge.org/landing/ solved this problem for me. – Seamus O'Bairead Nov 17 '14 at 10:35
4

This is the quickest solution:

The upgrade moves /usr/X11 to /opt/X11 which is interesting as a fresh install of Yosemite already has it's own /usr/X11. However to fix it, in Terminal, I did:

 sudo ln -s /opt/X11 /usr/X11
 sudo ln -s /opt/X11 /usr/X11R6

Solution was found on this site.

McGafter
  • 2,266