3

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

  • Did you try Herbert's solution for the problem with auto-pst-pdf? Are you using TiKZ/PGF? – cfr Dec 29 '14 at 02:46
  • Yes, i tried what Herbert suggested, but without success. – Vlad030691 Dec 29 '14 at 02:59
  • Try converting the files at the command line. You might get more informative output. – cfr Dec 29 '14 at 03:03
  • What exactly do I need to do for that? – Vlad030691 Dec 29 '14 at 03:06
  • Er... on Windows? I don't know. I know you can do it. But I have no idea how. (But somebody else will.) – cfr Dec 29 '14 at 03:15
  • You don't need auto-pst-pdf if you only want to include eps graphics. Try \usepackage{epstopdf} instead. Or convert the graphics with epstopdf to pdf before use. – Ulrike Fischer Dec 29 '14 at 09:10
  • You can install latest version of Ghostscript on your system (v. 9.15) and the excellent epspdf-setup tool. – Bernard Dec 29 '14 at 10:33
  • Dear Bernard, dear Ulrike Fischer, I have installed the latest version of Ghostscript, but this does not solve the problem. When I remove the auto-pst-pdf package and add epstopdf, the problem is gone and the image appears. However, in that case, apparently I cannot use psfrag anymore? – Vlad030691 Dec 29 '14 at 11:41
  • Installing an external ghostscript will not help as ps2pdf will use the internal ghostscript msg.exe (http://tex.stackexchange.com/a/214655/2388). Beside this: Without a MWE it is impossible to debug a auto-pst-pdf/ghostscript-problem (it is already difficult with a MWE - I would try to avoid the package and to create pdf graphics with some external document). – Ulrike Fischer Dec 29 '14 at 12:45
  • Dear Ulrike Fischer, when installing Tex-Live I got a recent internal ghostscript version, but this did not solve the problem. I will try and add a MWE in a few minutes. – Vlad030691 Dec 29 '14 at 12:49
  • Could you add the .log file what does it say ? Check if this Q helps http://tex.stackexchange.com/questions/49370/chemnum-package. Did you add -shell-escape flag to pdflatex before 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 loads graphicx and psfrag no need load again. To test code if possible add via dropbox test.eps file which you wish to add psfrag tags – texenthusiast Dec 29 '14 at 14:43
  • I alway used -shell-escape during compilation. I added a dropbox link. Thank you. – Vlad030691 Dec 29 '14 at 15:01
  • replacing the \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:04
  • chemnum has a feature to replace tags in eps fig but uses auto-pst-pdf for underhood latex-dvi->ps2pdf compilation of test.pdf. may be the speedy underhood compilation by pstool is not supported in chemnum or 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:05
  • 1
    Dear texenthusiast, thanks for your suggestions, but using auto-pst-pdf does 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 that chemnum works with pstool and the problem is solved if the option crop=pdfcrop is used. Nevertheless, thank you for your help and time. – Vlad030691 Dec 29 '14 at 23:30
  • chemnum uses psfrag internally. Everything that works with psfrag will work with chemnum, too. Personally I use auto-pst-pdf for usage with pdflatex but pstool should work, too. – cgnieder Dec 30 '14 at 12:32
  • Sometimes \usepackage[crop=off]{auto-pst-pdf} seems to be needed, sometimes also the option runs=2 is required – cgnieder Dec 30 '14 at 12:33
  • @cgnieder I noticed sending chemnum \replacecmpd commands in \psfragfig* throws Unrecoverable error, exit code 1 error 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 \replacecmpd I think thats where OP was stuck. pstool is much better option for psfrag especially as seen by author http://tex.stackexchange.com/a/11844/15717 – texenthusiast Dec 30 '14 at 14:35
  • @texenthusiast Does it work using psfrag's \psfrag within \psfragfig?. \replacecmpd is merely an elaborated wrapper for \psfrag... – cgnieder Dec 30 '14 at 15:08
  • 2
    @cgnieder the code snippet \psfragfig*[scale=1.0]{./intro/test}{\replacecmpd[tag=test]{test}\replacecmpd[t‌​ag=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 conclusion crop=off and crop =pdfcrop are good options for auto-pst-pdf and pstool respectively with package chemnum. May be you can include this option in a example Fig 5 : Using Pstool with chemnum example in chenum manual. but these options work in case to case basis, users may use with caution – texenthusiast Dec 30 '14 at 16:05

0 Answers0