需要在 VS code 的配置脚本中添加下面语句:
"latex-workshop.showContextMenu":true,
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.latex.recipes": [{
"name": "PDFlatex", "tools": ["pdflatex"]
},
{"name": "pdflatex ->bibtex -> pdflatex2",
"tools": ["pdflatex","bibtex","pdflatex","pdflatex"]
}],
"latex-workshop.view.pdf.viewer": "external",
"latex-workshop.view.pdf.external.command": {
"command": "XXXXXXXXX/SumatraPDF.exe",
"args": ["%PDF%"]},
同时,打开SumtraPDF,进入设置->选项->设置反向搜索命令行:
"C:UsersXXXXXXAppDataLocalProgramsMicrosoft VS CodeCode.exe" "C:UsersXXXXXXAppDataLocalProgramsMicrosoft VS Code
esourcesappoutcli.js" -g "%f":%l