在 VS Code 的 setting.json 中添加如下内容即可,详细操作可参考 使用VSCode编写LaTeX :
"latex-workshop.latex.tools": [{
// 编译工具和命令"name": "xelatex","command": "xelatex","args": ["-synctex=1","-interaction=nonstopmode","-file-line-error","%DOCFILE%"]},{
"name": "pdflatex","command": "pdflatex","args": ["-synctex=1","-interaction=nonstopmode","-file-line-error","%DOCFILE%"]},{
"name": "bibtex","command": "bibtex","args": ["%DOCFILE%"]}
],"latex-workshop.latex.recipes": [{
"name": "xelatex","tools": ["xelatex"],},{
"name": "pdflatex","tools": ["pdflatex"]},{
"name": "xe->bib->xe->xe","tools": ["xelatex","bibtex","xelatex","xelatex"]},{
"name": "pdf->bib->pdf->pdf","tools": ["pdflatex","bibtex","pdflatex","pdflatex"]}
],
参考
- Explain the configuration of vscode as latex editor (IDE)
- 使用VSCode编写LaTeX