Using the chemscheme and chemnum packages, I would like to number compounds in a chemical scheme as described in: https://www.overleaf.com/latex/templates/automatically-numbering-compounds-in-chemical-schemes/kybckmsxnshs
This is my main.tex:
% Preamble
\documentclass[11pt]{article}
% Packages
\usepackage{graphicx, auto-pst-pdf}
\usepackage{chemscheme}
\usepackage{chemnum}
% Document
\begin{document}
\begin{scheme}[htb]
\footnotesize
\centering
\replacecmpd{compound1}
\replacecmpd{compound2}
\includegraphics{hexa}
\caption{Testing the chemical numbering functionalities of the chemscheme package.}
\label{scm:chemnum}
\end{scheme}
This is a reference to compound \refcmpd{compound2}.
\end{document}
With the hexa.eps (version 1.2) from the overleaf template, everything is compiled properly. When using exported .eps files from ChemDraw 22.0.0 for macOS, however, the "TMP" labels are not replaced.
I have found that the issue lies within psfrag, which is loaded by chemnum and is compatible with EPS only up to version 2. In version 3.0 (created by ChemDraw), "TMP1" appears to be encoded as such:
/Encoding 256 array 0 1 255{1 index exch/.notdef put}for
dup 33 /T put
dup 34 /M put
dup 35 /P put
dup 36 /one put
readonly def
and
/.notdef 0 def
/one 1 def
/M 2 def
/P 3 def
/T 4 def
/u20B8 5 def
end readonly def
This is the reason psfrag does not recognize the "TMP1" pattern. Since ChemDraw has not the option to set the eps version, is there a workaround that does't involve downgrading ChemDraw? Any help is appreciated.
chemnumas such can handle the newEPSFformat provided the underlying packagepsfragcan handle that new format? That package has been around for 25 years now (according to the manual). – alchemist Feb 11 '23 at 15:27%!PS-Adobe-2.0 EPSF-1.2. – user21101711 Feb 14 '23 at 15:51