||
这个问题困扰了我很久。。。。
今天终于成功了。
这个文章需要以下几个前提:
1、了解latex;
2、了解vs code;
3、知道vs code编译latex的优势;
4、能熟练地根据一些提示命令来操作完成指定的任务。
vs code中的配置如下:
{ "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" ] } ], "latex-workshop.view.pdf.viewer": "external", "latex-workshop.latex.autoBuild.run": "onFileChange", "latex-workshop.message.error.show": false, "latex-workshop.message.warning.show": false, "json.schemas": [ ], // 设置预览方式 "latex-workshop.view.pdf.viewer": "external", "latex-workshop.view.pdf.ref.viewer": "external", // 设置外部PDF预览器 "latex-workshop.view.pdf.external.viewer.command": "C:/Leviathan/AppData/Local/SumatraPDF/SumatraPDF.exe", "latex-workshop.view.pdf.external.viewer.args": ["%PDF%"], // 配置Syntex的正向搜索(Latex->PDF) "latex-workshop.view.pdf.external.synctex.command": "C:/Users/AppData/Local/SumatraPDF/SumatraPDF.exe", "latex-workshop.view.pdf.external.synctex.args": [ "-forward-search", "%TEX%", "%LINE%", "-reuse-instance", "-inverse-search", "\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"C:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -gr \"%f\":\"%l\"", "%PDF%" ], "files.autoSave": "afterDelay", "editor.fontSize": 16, "workbench.editor.enablePreview": false, "workbench.editor.untitled.hint": "hidden", "editor.fontLigatures": null, //"powermode.enabled": true, //是否开启 //"powermode.enableShake": false, //是否抖动 //"powermode.presets": "fireworks", "spellright.language": [ "en" ], "spellright.documentTypes": [ "markdown", "latex", "plaintext" ], "security.workspace.trust.banner": "always", "security.workspace.trust.untrustedFiles": "open", "security.workspace.trust.enabled": false //动画效果 fireworks exploding-rift }
设置好上面的内容后,还需要对SumatraPDF进行反向搜索设置。自己在知乎查阅即可。
注意:
1、上面的软件的地址需要根据自己的电脑的情况修改。
2、vs code中需要安装LaTeX Workshop,LTex,Power Mode等拓展。
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-1 16:26
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社