Recently, I was forced to reinstall my MikTeX distribution. Now, in documents that compile without an actual tex error, there are missing graphics that I have included as eps-files. The following error, however, appears:
MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1.
I am using pdflatex in conjunction with the auto-pst-pdf package to be able to use eps-graphics in pdflatex.
I installed the following version: basic-miktex-2.9.5105-x64, all packages were updated today. However, I have also tried the x32 version, with the same result.
Unfortunately, I am not really able to locate the problem and produce a MWE. It seems like deleting parts of the document makes the graphics appear, and, more importantly, adding more graphics makes the document not compile without an error anymore, even though I am sure that the exact same document compiled nicely when I used my initial configuration.
I have read the related questions:
auto-pst-pdf throws 'MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1'
Ghostscript 8.57: Unrecoverable error, exit code 1
However, they don't mention missing images or similar things.
Any ideas on how to fix the problem?
Interestingly, the document compiles with latex without any errors and all images are displayed. With pdflatex i don't see the images, but get the warning that the floats are way too large for the page.
In the meantime, I have also installed tex-live and other versions of miktex, all of them leading to the same error.
As has been pointed out in the comments, auto-pst-pdf is not necessary to be able to use eps files with pdflatex. Switching from this package to epstopdf solves part of the problem: The document compiles without errors and all graphics are included. However I would like to be able to use psfrag on my figures. When I do so with epstopdf the tags are not replaced, i.e. i need to use auto-pst-pdf or pstool (see below).
I was able to produce a MWE:
\documentclass[]{scrreprt}
\usepackage[english]{babel}
\usepackage[onehalfspacing]{setspace}
\frenchspacing
\usepackage{siunitx}
\usepackage{psfrag}
\usepackage{pstool}
\usepackage{graphicx}
\usepackage[scaled=.83]{beramono}
\usepackage[libertine]{newtxmath}
\usepackage{chemnum}
\usepackage{chemgreek}
\selectchemgreekmapping{newtx}
\usepackage{chemmacros}
\chemsetup[nmr]{
delta = (ppm) ,
pos-number = side ,
use-equal,
format = \bfseries,
list=true ,
coupling-nuclei-pre = { },
coupling-nuclei-post = { } ,
coupling-pos = sub,
% coupling-pos-cs = \ensuremath , % <<< added
atom-number-cs = \ensuremath % <<< added
}
\sisetup{
separate-uncertainty ,
per-mode = symbol ,
range-phrase = -- ,
detect-mode = false ,
detect-weight = true ,
mode = text ,
text-rm = \libertineLF % use libertine with lining figures
}
\begin{document}
Testing psfrag:
\begin{figure}[htbp]
\centering
\psfragfig*[scale=1.0]{./intro/test}{\replacecmpd[tag=test]{test}\replacecmpd[tag=rrr]{rrr}}
\caption{Test}\label{fig:test}
\end{figure}
\end{document}
It seems that chemmacros is producing the error, because if a remove it, all tags are replaced correctly. I get exactly the same error if i use auto-pst-pdf instead of pstool.
Here is a dropbox link of all files used and created during compilation:
https://www.dropbox.com/sh/jtxchech4r20pfw/AACHdaxVNyzgQi-uT3CABFGka?dl=0
auto-pst-pdf? Are you using TiKZ/PGF? – cfr Dec 29 '14 at 02:46\usepackage{epstopdf}instead. Or convert the graphics withepstopdfto pdf before use. – Ulrike Fischer Dec 29 '14 at 09:10Ghostscripton your system (v. 9.15) and the excellent epspdf-setup tool. – Bernard Dec 29 '14 at 10:33Ghostscript, but this does not solve the problem. When I remove theauto-pst-pdfpackage and addepstopdf, the problem is gone and the image appears. However, in that case, apparently I cannot usepsfraganymore? – Vlad030691 Dec 29 '14 at 11:41.logfile what does it say ? Check if this Q helps http://tex.stackexchange.com/questions/49370/chemnum-package. Did you add-shell-escapeflag topdflatexbefore compilation. BTW your MWE can be made more compact by removing unnecessary preamble packages and options to narrow down where the package conflict is, something like this\usepackage{pstool} \usepackage{chemnum}\usepackage{chemgreek}\usepackage{chemmacros}and pstool loadsgraphicxandpsfragno need load again. To test code if possible add via dropboxtest.epsfile which you wish to add psfrag tags – texenthusiast Dec 29 '14 at 14:43\psfragfig*command line with\replacecmpd[tag=test]{test} \replacecmpd[tag=rrr]{rrr} \includegraphics[scale=1.0]{test}as shown in Section 9 Replacing Tags in EPS os PS files Page 19, Fig:4 of chemnum 1.1 2014-08-08 and replacing\usepackage{graphicx,auto-pst-pdf,psfrag}with\usepackage{pstool}works with pdflatex compilation properly on TeXLive 2014. – texenthusiast Dec 29 '14 at 20:04chemnumhas a feature to replace tags in eps fig but usesauto-pst-pdffor underhood latex-dvi->ps2pdf compilation oftest.pdf. may be the speedy underhood compilation bypstoolis not supported inchemnumor vice-versa, no idea. see related discussion http://texwelt.de/blog/latex-und-chemie-5-nummerieren-von-verbindungen-das-chemnum-paket/. may be post a feature request at https://github.com/cgnieder/chemnum – texenthusiast Dec 29 '14 at 20:05auto-pst-pdfdoes not lead to a solution. The problem is that the way you describe it, worked for me prior to reinstalling everything, now however it doesn't. I found thatchemnumworks withpstooland the problem is solved if the optioncrop=pdfcropis used. Nevertheless, thank you for your help and time. – Vlad030691 Dec 29 '14 at 23:30chemnumusespsfraginternally. Everything that works withpsfragwill work withchemnum, too. Personally I useauto-pst-pdffor usage with pdflatex butpstoolshould work, too. – cgnieder Dec 30 '14 at 12:32\usepackage[crop=off]{auto-pst-pdf}seems to be needed, sometimes also the optionruns=2is required – cgnieder Dec 30 '14 at 12:33chemnum\replacecmpdcommands in\psfragfig*throwsUnrecoverable error, exit code 1error and does not work as seen by Vlad030691 in his code snippet\psfragfig*[scale=1.0]{./intro/test}{\replacecmpd[tag=test]{test}\replacecmpd[tag=rrr]{rrr}}. It would be great if\psfragfig*plays well with\replacecmpdI think thats where OP was stuck. pstool is much better option forpsfragespecially as seen by author http://tex.stackexchange.com/a/11844/15717 – texenthusiast Dec 30 '14 at 14:35psfrag's\psfragwithin\psfragfig?.\replacecmpdis merely an elaborated wrapper for\psfrag... – cgnieder Dec 30 '14 at 15:08\psfragfig*[scale=1.0]{./intro/test}{\replacecmpd[tag=test]{test}\replacecmpd[tag=rrr]{rrr}}works well with[crop=pdfcrop]in\usepackage[crop=pdfcrop]{pstool}finally. Thats what OP Vlad030691 also noticed in the above upvoted comment. So in conclusioncrop=offandcrop =pdfcropare good options forauto-pst-pdfandpstoolrespectively with packagechemnum. May be you can include this option in a exampleFig 5 : Using Pstool with chemnum exampleinchenummanual. but these options work in case to case basis, users may use with caution – texenthusiast Dec 30 '14 at 16:05