Chemnum no reemplazará los marcadores TMP en archivos eps

Chemnum no reemplazará los marcadores TMP en archivos eps

Soy nuevo en el uso del látex, pero me gustaría mucho usarlo para escribir mi tesis (química, obviamente). El trabajo de laboratorio casi está terminado, pero ese parece ser el obstáculo menor en este momento :D

En este momento, estoy intentando utilizar el paquete chemnum para obtener etiquetas bonitas para todos los compuestos. En teoría, debería reemplazar los marcadores "TMP" (que se proporcionan en un archivo eps externo creado por el software chemdraw) con numeraciones automatizadas. Sin embargo, ni siquiera logro ejecutar el archivo de ejemplo usando TeXstudio:

https://de.overleaf.com/latex/templates/automatically-numbering-compounds-in-chemical-schemes/kybckmsxnshs

En mi caso, los marcadores no se reemplazan, sino que debajo de los seis compuestos ejemplares está escrito el texto "TMP1" o "TMP2". Además, la fuente dentro de las imágenes está arruinada con respecto al modelo pdf de arriba.

¿Qué estoy haciendo mal? Y ya que estamos en ello: ¿cómo hago mis propias etiquetas TMP? ¿Está bien escribir simplemente "TMP" como bloque de texto en chemdraw?

¡Gracias de antemano!

Respuesta1

Entonces, obtuve una pista adicional: puede que tenga que ver con la configuración de compilación.

Como se indicó anteriormente, la compilación funciona en línea utilizando el texmaker al dorso. Al dorso se utiliza compilación de látex, pero cuando se cambia a pdflatex no se pueden volver a colocar los marcadores TMP; sin embargo, la figura todavía parece correcta. Mi configuración ya falla al representar la imagen (vea la captura de pantalla a continuación, tenga en cuenta que faltan/se movieron partes aleatorias y se cambió la fuente).

El uso del comando auto-pst-pdf no proporciona ninguna imagen.

enter\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\title{Automatically numbering compounds in chemical schemes}
%% Uncomment these lines if you get error about "too many \new..." 
% \let\tmp\newinsert
% \let\newinsert\newbox
\usepackage{chemstyle}
% \let\newinsert\tmp
\usepackage{chemnum}
% For positioning the scheme captions at the top.
\floatsetup[scheme]{position=top}

\begin{document}
\begin{scheme}
%% hexa.eps has "TMP1" and "TMP2" as the markers
%% in fact EVERY .eps should start with TMP1, TMP2 etc
%% for ease of use \replacecmpd{first:compound}  
%% automatically replace TMP1
\replacecmpd{DSV}  %% automatically replace TMP2
\includegraphics[width=\linewidth]{Picture}
\caption{This is something!}
\label{first:chem:scheme}
\end{scheme}
Compounds \refcmpd{first:compound} and \refcmpd{DSV} in \ref{first:chem:scheme}. Here's a reference to in-text creation of \cmpd{RareCompound} that we can later refer to.
\vfill
\end{document}

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

Respuesta2

Los problemas que usted describe son un problema común en la combinación pdfLatex/chemnum/Texstudio/ChemDraw. La numeración de compuestos es obviamente muy poderosa en una tesis de química.

Mi respuesta se basa en las respuestas a preguntas similares, consulte:Numeración/ChemDraw/Mac,EPS/ChemDraw/chemnum,configuración correcta de Texstudio,

Intentaré enumerar a continuación las fuentes de errores más comunes:

  1. Compilación: necesitas usar pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.texen TexStudio

  2. RUTA de Texstudio: Dependiendo de su sistema operativo, configure su RUTA en algo así como /usr/local/texlive/2019/bin/x86_64-darwin:/Library/TeX/texbin(tendrá que adaptarse dependiendo de su sistema operativo).

  3. Auto-pst-pdf: deberás cargarlo \usepackage[crop=off,runs=2]{auto-pst-pdf}muy temprano en el preámbulo.

  4. EPS: debe realizarse de manera que las cadenas de texto estén claramente definidas como tales. ChemDraw en Windows lo hace bien (parámetros estándar para exportar), pero no ChemDraw en Mac. Esto es un error y unpregunta anteriorlo miré. Como pude compilar tu MWE, creo que estás bien.

No conozco el comentario del nombre del trabajo anteriormente, no lo necesitaba para TexStudio, pero ¿podría ser necesario para Overleaf?

Este ejemplo funcionó para mí usando la configuración descrita anteriormente, usando TexStudio v3:

\documentclass{article}
%\def\jobname{main} %<-- your file name
\usepackage[
runs=2,
crop=off
]{auto-pst-pdf} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}

\title{Automatically numbering compounds in chemical schemes}


%% Uncomment these lines if you get error about "too many \new..." 
% \let\tmp\newinsert
% \let\newinsert\newbox
\usepackage{chemstyle}
% \let\newinsert\tmp
\usepackage{chemnum}

% For positioning the scheme captions at the top.
%\floatsetup[scheme]{position=top}

    \begin{document}
    
    \begin{scheme}
    %% hexa.eps has "TMP1" and "TMP2" as the markers
    %% in fact EVERY .eps should start with TMP1, TMP2 etc
    %% for ease of use
    \replacecmpd{first:compound}  %% automatically replace TMP1
    \replacecmpd{second:compound}  %% automatically replace TMP2
    \includegraphics[width=\linewidth]{hexa}
    \caption{This is something!}
    \label{first:chem:scheme}
    \end{scheme}
    
    Compounds \refcmpd{first:compound} and \refcmpd{second:compound} in \ref{first:chem:scheme}. Here's a reference to in-text creation of  \cmpd{RareCompound} that we can later refer to.
    
    \vfill
    
    \begin{scheme}
    \replacecmpd{next:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 3!
    \replacecmpd{last:compound} %% automatically replace TMP2
    \includegraphics[width=\linewidth]{hexa}
    \caption{This is something else!}
    \label{second:chem:scheme}
    \end{scheme}
    
    Compounds \refcmpd{next:compound} and \refcmpd{last:compound} in \ref{second:chem:scheme}. Hey remember \cmpd{RareCompound}? \texttt{chemnum} still remembers it correctly, \emph{and} see how the compound numbering continues throughout the scheme diagrams!
    
    \vfill
    
    %% MANUAL UPDATING THE COMPOUND COUNTER; make sure you know what you're doing!
    \setcounter{cmpdmain}{8} 
    
    \begin{scheme}
    \replacecmpd{jumped:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 9!
    \replacecmpd{nextjumped:compound} %% automatically replace TMP2
    \includegraphics[width=\linewidth]{hexa}
    \caption{This is again something else!}
    \label{third:chem:scheme}
    \end{scheme}
    
    Compounds \refcmpd{jumped:compound} and \refcmpd{nextjumped:compound} in \ref{third:chem:scheme}. (Yes we manually modified the compound numbering counter after \ref{second:chem:scheme}).
    \end{document}

ingrese la descripción de la imagen aquí

Respuesta3

No tengo la reputación de comentar tu respuesta. Si aún desea utilizar pdflatex como compilador, le sugeriría cambiar el nombre de `\jobname´ como lo hizo Ulrike Fischer aquí en la respuesta.aquí.

Usando el ejemplo al dorso que citó y agregando la línea para cambiar el nombre \jobnamedel {auto-pst-pdf}paquete, funciona para mí.

\documentclass{article}
\def\jobname{main} %<-- your file name
\usepackage[
%runs=2,
%crop=off
]{auto-pst-pdf} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}

\title{Automatically numbering compounds in chemical schemes}


%% Uncomment these lines if you get error about "too many \new..." 
% \let\tmp\newinsert
% \let\newinsert\newbox
\usepackage{chemstyle}
% \let\newinsert\tmp
\usepackage{chemnum}

% For positioning the scheme captions at the top.
%\floatsetup[scheme]{position=top}

\begin{document}

\begin{scheme}
%% hexa.eps has "TMP1" and "TMP2" as the markers
%% in fact EVERY .eps should start with TMP1, TMP2 etc
%% for ease of use
\replacecmpd{first:compound}  %% automatically replace TMP1
\replacecmpd{second:compound}  %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is something!}
\label{first:chem:scheme}
\end{scheme}

Compounds \refcmpd{first:compound} and \refcmpd{second:compound} in \ref{first:chem:scheme}. Here's a reference to in-text creation of  \cmpd{RareCompound} that we can later refer to.

\vfill

\begin{scheme}
\replacecmpd{next:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 3!
\replacecmpd{last:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is something else!}
\label{second:chem:scheme}
\end{scheme}

Compounds \refcmpd{next:compound} and \refcmpd{last:compound} in \ref{second:chem:scheme}. Hey remember \cmpd{RareCompound}? \texttt{chemnum} still remembers it correctly, \emph{and} see how the compound numbering continues throughout the scheme diagrams!

\vfill

%% MANUAL UPDATING THE COMPOUND COUNTER; make sure you know what you're doing!
\setcounter{cmpdmain}{8} 

\begin{scheme}
\replacecmpd{jumped:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 9!
\replacecmpd{nextjumped:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is again something else!}
\label{third:chem:scheme}
\end{scheme}

Compounds \refcmpd{jumped:compound} and \refcmpd{nextjumped:compound} in \ref{third:chem:scheme}. (Yes we manually modified the compound numbering counter after \ref{second:chem:scheme}).
\end{document}

Respuesta4

Busque esta publicación si está utilizando Chemdraw en MacOS: https://tex.stackexchange.com/a/687480/298255

Esta solución también podría resultar útil para los usuarios de Windows.

información relacionada