PDFTeX – No Replacement of Temporary Labels by Chemnum in a ChemDraw EPS on Mac

auto-pst-pdfchemnumepsmactexpdftex

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?

Best Answer

Turns out there were 2 problems associated with this.

  1. The PATH in TexStudio needed to be changed. This is a similar issue as .eps files and pdflatex and reconfiguring texstudio as described here solved it, here is a picture to clarify: TexStudio change PATH

  2. ChemDraw 18 on Mac does not generate the .eps file properly, ie defining the text correctly. This issue is known and explained in more detail in Chemdraw 16 for Mac OSX not working with psfrag and label replacing/autonumbering My solution was to generate the .eps file on a Windows computer running ChemDraw 16...

The combination of both solved the problem for the above MWE. I have edited the above question to reflect more the nature of the problem.

Related Question