
저는 LaTeX를 처음 사용합니다. VSCode 확장을 사용하여 LaTeX 프로젝트를 수행하고 싶습니다. 작동하려면 chemnum 패키지가 필요합니다. 나는 뒷면과 로컬에서 정확히 동일한 코드를 실행했습니다. 레이블 TMP1 및 TMP2는 뒷면에서 실행될 때만 교체됩니다. 이것이 로컬 출력의 모양이며 내 .eps 파일의 모양이기도 합니다.
코드는 다음과 같습니다:
\documentclass{article}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{chemstyle}
\usepackage{chemnum}
\listfiles
\begin{document}
\begin{scheme}
\replacecmpd{first:compound} %% automatically replace TMP1
\replacecmpd{second:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{figures/label_test.eps}
\caption{This is something!}
\label{first:chem:scheme}
\end{scheme}
\end{document}
로그 파일은 여기에서 찾을 수 있습니다:https://ufile.io/f/0ftc5 .eps 파일은 여기에서 찾을 수 있습니다:https://ufile.io/cy8zurmk
답변1
이 문제에 대한 해결책은 모든 관련 단계를 포함하는 vscode에서 라텍스 레시피를 정의하는 것이었습니다(원본 게시물의 댓글 체인 참조).
- settings.json에 들어갔습니다.
- 여기에 다음 두 블록을 추가했습니다.
"latex-workshop.latex.recipes": [
{
"name": "latexmk-dvips-ps2pdf",
"tools": ["latexmk-dvips-ps2pdf-command"]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk-dvips-ps2pdf-command",
"command": "cmd.exe",
"args": [
"/c",
"latexmk %DOCFILE% && dvips %DOCFILE%.dvi -o %DOCFILE%.ps && ps2pdf %DOCFILE%.ps %DOCFILE%.pdf"
],
"env": {}
}
],
- Ctrl+Shift+P
>LaTeX Workshop: Build with recipe
이는 TMP 레이블을 대체하여 올바르게 컴파일되었습니다.