2

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.

  • 1
    is the eps available somewhere? – Ulrike Fischer Feb 11 '23 at 15:06
  • Could it be that chemnum as such can handle the new EPSF format provided the underlying package psfrag can handle that new format? That package has been around for 25 years now (according to the manual). – alchemist Feb 11 '23 at 15:27
  • @UlrikeFischer This is a temporary copy of the new eps. Unfortunately, I cannot include the full eps in the question, since the character limit is 30,000. – user21101711 Feb 12 '23 at 16:36
  • 1
    I would say this is your problem https://tex.stackexchange.com/a/391282/2388. And I don't know what you can do, perhaps chemdraw has some option to change the encoding. – Ulrike Fischer Feb 12 '23 at 17:25
  • You are right. I tested ChemDraw 22.0.0 for windows 10 today and it worked. The eps file created says %!PS-Adobe-2.0 EPSF-1.2. – user21101711 Feb 14 '23 at 15:51

0 Answers0