613*_*654 1 macos latex path visual-studio-code vscode-extensions
根据文档,我了解我需要设置 PATH 环境变量。但是我不明白(1)这意味着什么,以及(2)如何做。我已按照文档中的链接进行操作,但无法解决我的问题。
任何人都可以协助简化解释设置路径所需的步骤吗?
我有同样的错误:Recipe terminated with fatal error: spawn latexmk ENOENT.
我在 macOS (Ventura 13.3.1) 上使用 MacTeX-2023 解决问题所采取的步骤是:
\ncmd+shift+P
, 选择Preferences: Open User Settings (JSON)
。"latex-workshop.latex.path": "/Library/TeX/texbin",\n "latex-workshop.latex.tools": [\n {\n "name": "latexmk",\n "command": "latexmk",\n "args": [\n "-synctex=1",\n "-interaction=nonstopmode",\n "-file-line-error",\n "-pdf",\n "-outdir=%OUTDIR%",\n "%DOC%"\n ],\n "env": {}\n },\n {\n "name": "xelatex",\n "command": "xelatex",\n "args": [\n "-synctex=1",\n "-interaction=nonstopmode",\n "-file-line-error",\n "%DOC%"\n ],\n "env": {}\n },\n {\n "name": "pdflatex",\n "command": "pdflatex",\n "args": [\n "-synctex=1",\n "-interaction=nonstopmode",\n "-file-line-error",\n "%DOC%"\n ],\n "env": {}\n },\n {\n "name": "bibtex",\n "command": "bibtex",\n "args": [\n "%DOCFILE%"\n ],\n "env": {}\n }\n ],\n "latex-workshop.latex.recipes": [\n {\n "name": "pdfLaTeX",\n "tools": [\n "pdflatex"\n ]\n },\n {\n "name": "latexmk ",\n "tools": [\n "latexmk"\n ]\n },\n {\n "name": "xelatex",\n "tools": [\n "xelatex"\n ]\n },\n {\n "name": "pdflatex \xe2\x9e\x9e bibtex \xe2\x9e\x9e pdflatex`\xc3\x972",\n "tools": [\n "pdflatex",\n "bibtex",\n "pdflatex",\n "pdflatex"\n ]\n },\n {\n "name": "xelatex \xe2\x9e\x9e bibtex \xe2\x9e\x9e xelatex`\xc3\x972",\n "tools": [\n "xelatex",\n "bibtex",\n "xelatex",\n "xelatex"\n ]\n }\n ] \n
Run Code Online (Sandbox Code Playgroud)\n确保"latex-workshop.latex.path": "/Library/TeX/texbin"
反映您的 MacTeX 安装。如果你按照默认提示安装MacTeX的.pkg,那么我指定的路径应该是相同的。
重新启动 Visual Studio 代码。
\na。我发现使用命令重新加载窗口Developer: Reload Window
是不够的,我需要退出 Visual Studio Code 并再次打开。
在新的 .tex 文件 ( ) 中的测试文件中尝试以下内容File > New File > test.tex
:
\n(我从 Overleaf 获取此 MWE)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%\n% Welcome to Overleaf --- just edit your LaTeX on the left,\n% and we\'ll compile it for you on the right. If you open the\n% \'Share\' menu, you can invite other users to edit at the same\n% time. See www.overleaf.com/learn for more info. Enjoy!\n%\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\\documentclass{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage[acronym]{glossaries}\n\n\\makeglossaries\n\n\\newglossaryentry{latex}\n{\n name=latex,\n description={Is a mark up language specially suited for \nscientific documents}\n}\n\n\\newglossaryentry{maths}\n{\n name=mathematics,\n description={Mathematics is what mathematicians do}\n}\n\n\\newglossaryentry{formula}\n{\n name=formula,\n description={A mathematical expression}\n}\n\n\\newacronym{gcd}{GCD}{Greatest Common Divisor}\n\n\\newacronym{lcm}{LCM}{Least Common Multiple}\n\n\\begin{document}\n\\printglossary[type=\\acronymtype]\nThe \\Gls{latex} typesetting markup language is specially suitable \nfor documents that include \\gls{maths}. \\Glspl{formula} are \nrendered properly an easily once one gets used to the commands.\n\nGiven a set of numbers, there are elementary methods to compute \nits \\acrlong{gcd}, which is abbreviated \\acrshort{gcd}. This \nprocess is similar to that used for the \\acrfull{lcm}.\n\n\\clearpage\n\n\n\n%\\printglossary\n\n\\end{document}\n\n
Run Code Online (Sandbox Code Playgroud)\nBuild LaTeX project
Recipe: pdfLaTeX