# No replacement of temporary labels by chemnum in a ChemDraw eps on Mac

I tried to replace the temporary labels TMP1, TMP2 and TMP3 in an .eps file made with ChemDraw v18 on Mac OSX Mojave using the chemnum package, so to get an automatic numbering of the compounds, but this did not work for me.

I tried different fonts for the label in the .eps file, or other options for auto-pst-pdf with no result.

The problem originally occurred on TexLive 2014 for Mac remains with Mac OSX 10.14 and TexLive 2019, compilation with pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex(I use TexStudio).

For the following MWE with the following eps file.

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage[crop=off,runs=2]{auto-pst-pdf}
\usepackage{chemnum}
\usepackage{chemstyle}

\begin{document}

\begin{scheme}
\replacecmpd[tag=TMP1]{cmpd:nucleophile1}
\replacecmpd[tag=TMP2]{cmpd:nucleophile2}
\replacecmpd[tag=TMP3]{cmpd:nucleophile3}
\includegraphics[scale=0.8]{test_cmpd_numbering.eps}
\caption[test]{A test to make the numbering work}
\end{scheme}

\end{document}


The picture is inserted properly and the file test_cmpd_numbering-pics.pdf generated (that's a progress from previously), but the TMP1, TMP2 etc. labels are not replaced. Here is the log file. It has got the error 'non-PDF special ignored!' which is often related to PdfLaTex difficulties on MacOSX.

Does anyone know why this code could make problems on Mac?

• Your example works for me if I comment out \usepackage{epstopdf} (with the package it doesn't work) and compile with pdflatex (shell-escape enabled). The only tag that isn't replaced is in then TMP1 in THF, -30\260 but this can't work: psfrag needs “a single word, composed of unaccented letters and numbers”. (then TMP1 in THF, -30\260 is not a single word) Oct 7 '14 at 22:41
• If I comment out \usepackage{epstopdf}, the aziridineopening-converted-to.pdf file is not created, hence an empty white space is included instead of the picture. Curiously I get no warning or error message. I tested in a terminal if epstopdf works for himself - it seems fine and if I start it manually in the terminal, the ...-converted-to.pdf file is created correctly. Oct 8 '14 at 11:12
• @SimonN. But auto-pst-pdf should also create a ...-pics.pdf. (provided you're compiling with shell-escape enabled) Oct 9 '14 at 7:01
• If I comment out \usepackage{eps-to-pdf} from the top MWE and compile with --shell-escape, the ...-pics.pdf file is created, but it has no content. If I open this ...-pics.pdf-file with a visualization program such as Preview or AdobeReader, I see only a small white quadrangle. And the aziridineopening-converted-to.pdf file is not created. Here the log file Oct 9 '14 at 10:03
• The error message for the previous comment is: Error: /undefined in obj Operand stack: 2 0 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push (...) -- Current allocation mode is local Last OS error: Invalid argument Current file position is 132440 GPL Ghostscript 9.10: Unrecoverable error, exit code 1 Oct 9 '14 at 10:05