I have not tried this for a few years, but I used Joseph Wright's chemstyle package as well as the auto-pst-pdf package to automatically number structures. Basically, you would export your structures in .eps with the TMP1, TMP2, etc. placeholders and then insert your pictures in the scheme environment, specifying a code/tag/label/etc for each molecule. The placeholders are then converted to numbers while typesetting. You can also refer to the molecules numbers using \compound{<your compound label>} in inline text.
After fiddling and tinkering with old code, this example says it better:
\documentclass{minimal}
\usepackage[crop=off,runs=2]{auto-pst-pdf}
\usepackage{chemstyle}
\begin{document}
\begin{scheme}[h]
\centering
\schemeref[TMP1]{msoc2c6f13}
\schemeref[TMP2]{imc2c6f13}
\includegraphics[scale=1]{pfaim}
\caption{a chemscheme}
\label{sch:pfaim}
\end{scheme}%
Mesylate \compound{msoc2c6f13} was converted to the N-fluoroalkylated imidazole \compound{imc2c6f13}.
\end{document}
Which will give you this result:
There's a few caveats though, which you must be made aware of:
- You will need to allow shell escape (i.e. data from your code going out and in your typesetting program, more explanations here: What are \immediate & \write18 and how does one use them?) for
auto-pst-pdf to process your TMP tags. Depending on your typesetting habits, you might want to have it for all your documents or just a few. You should be able to allow it either from your typesetting program or the document (e.g. if you're using arara).
- If you need some specific order in the numbering, you will need to declare the compounds in that order, using
\compound*{...} (e.g. at the beginning of a section).
- Sometime between 2016 and now,
auto-pst-pdf defaulted the crop option; this causes the converted .eps to be cropped, and, in my test case, to lose parts of the structures. Hence the crop=off option.
For (a lot) more details, you should also read Joseph Wright's chemstyle manual, it is full of useful tricks.
\replacecmpdcommand, put a text box with the contentTMP1in chemdraw and export the file to.eps. (If you have more than one compound per image, useTMP1,TMP2,...) Then you can use\replacecmpd{<key>}in your.texfile with<key>being a unique identifier that you can always use to refer to this compound (comparable to the label/ref approach). If you wish to compile your document usingpdflatexyou might be interested in using theauto-pst-pdfpackage. – leandriis Mar 30 '19 at 14:49centerenvironment inside afigureas it adds vertical white space. In order to horizontally center the image, you can use the\centeringcommand instead. – leandriis Mar 30 '19 at 14:52.epsfile that does not contain spaces in its name? – leandriis Mar 30 '19 at 15:00.epsfiles has changed. A related question can be found here: Chemnum with Chemdraw 16.0.1.4 not working – leandriis Mar 30 '19 at 15:09.epsfile that you linked to in your question and did not find any way to make the replacement work directly. If you have acces to it, I would either recommend to use an older version of chemdraw. Alternatively (and not at all elegant) you could use inkscape (tested with version0.91) to add a textbox containing a single letter tag to your .eps file. Then the replacement works using the following command\replacecmpd[tag=X]{TMPA}assuming thatXis the tag you chose to add. – leandriis Mar 30 '19 at 17:00