Chemnum은 EPS 파일의 TMP 마커를 대체하지 않습니다.

Chemnum은 EPS 파일의 TMP 마커를 대체하지 않습니다.

저는 라텍스를 처음 사용하지만 논문(물론 화학)을 작성하는 데 라텍스를 사용하고 싶습니다. 연구 작업이 거의 완료되었지만 지금은 그게 더 낮은 장애물인 것 같습니다. :D

지금은 모든 화합물에 대해 좋은 라벨을 얻기 위해 chemnum 패키지를 사용하려고 합니다. 이론적으로 "TMP" 마커(chemdraw 소프트웨어에서 생성된 외부 EPS 파일에 제공됨)를 자동 번호 매기기로 대체해야 합니다. 그러나 TeXstudio를 사용하여 실행되는 예제 파일도 얻지 못했습니다.

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

내 경우에는 마커가 교체되지 않고 대신 6개의 예시 화합물 모두에 "TMP1" 또는 "TMP2"라는 텍스트가 기록됩니다. 또한 사진 내부의 글꼴은 위의 모델 pdf와 관련하여 엉망입니다.

내가 도대체 ​​뭘 잘못하고있는 겁니까? 그 동안 나만의 TMP 라벨을 어떻게 만들 수 있나요? chemdraw의 텍스트 블록으로 "TMP"를 작성해도 괜찮습니까?

미리 감사드립니다!

답변1

그래서 몇 가지 추가 단서를 얻었습니다. 컴파일 설정과 관련이 있을 수 있습니다.

앞서 언급한 것처럼 편집은 overleaf texmaker를 사용하여 온라인으로 작동합니다. Overleaf는 라텍스 컴파일을 사용하지만 pdflatex로 변경하면 TMP 마커를 다시 표시하지 못하지만 그림은 여전히 ​​올바르게 보입니다. 그림을 묘사하는 데 내 설정이 이미 실패했습니다(아래 스크린샷 참조, 임의의 부품이 누락/이동되었으며 글꼴이 변경되었음을 참고).

auto-pst-pdf 명령을 사용하면 그림이 전혀 표시되지 않습니다.

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}

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

답변2

귀하가 설명하는 문제는 pdfLatex / chemnum / Texstudio / ChemDraw 조합에서 흔히 발생하는 문제입니다. 화합물 번호 매기기는 분명히 화학 논문에서 매우 강력합니다.

내 대답은 비슷한 질문에 대한 답변을 기반으로 합니다. 다음을 참조하세요.넘버링/ChemDraw/맥,EPS/ChemDraw/chemnum,올바른 Textstudio 구성,

다음과 같은 가장 일반적인 오류 원인을 나열해 보겠습니다.

  1. pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex컴파일: TexStudio에서 사용해야 합니다.

  2. Texstudio PATH: 운영 체제에 따라 PATH를 다음과 같이 설정합니다 /usr/local/texlive/2019/bin/x86_64-darwin:/Library/TeX/texbin(OS에 따라 조정해야 함).

  3. \usepackage[crop=off,runs=2]{auto-pst-pdf}Auto-pst-pdf: 서문의 아주 초기에 로드해야 합니다 .

  4. EPS: 문자열이 명확하게 정의되도록 작성되어야 합니다. Windows의 ChemDraw는 잘 작동하지만(내보내기용 표준 매개변수) Mac에서는 ChemDraw가 작동하지 않습니다. 이것은 버그이고이전 질문그것을 들여다보았다. 귀하의 MWE를 컴파일할 수 있으므로 괜찮다고 생각합니다.

이전에는 jobname 주석에 대해 잘 모릅니다. TexStudio에는 필요하지 않았지만 Overleaf에는 필요할 수 있습니까?

이 예는 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}

여기에 이미지 설명을 입력하세요

답변3

나는 귀하의 답변에 대해 논평할 평판이 없습니다. 여전히 pdflatex를 컴파일러로 사용하고 싶다면 Ulrike Fischer가 여기에서 답변한 것처럼 `\jobname'의 이름을 바꾸는 것이 좋습니다.여기.

인용한 뒷면 예제를 사용하고 줄을 추가하여 이름을 바꾸면 \jobname패키지 {auto-pst-pdf}가 저에게 효과적입니다.

\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}

답변4

MacOS에서 Chemdraw를 사용하는 경우 이 게시물을 찾으십시오. https://tex.stackexchange.com/a/687480/298255

이 솔루션은 Windows 사용자에게도 도움이 될 수 있습니다.

관련 정보