假设你已经装了texlive
打开cmd输入
latex --version
应该能输出
打开vscode,安装这几个插件
设置->Settings
点击右上角的Open Settings(JSON)
打开应该是这样的(也许你还配置过其他的东西,反正是个json)
1 2 3 4 | { "editor.suggestSelection" : "first" , "vsintellicode.modify.editor.suggestSelection" : "automaticallyOverrodeDefaultValue" } |
添加以下这些(就按json那么添加)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | // Latex configuration "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.latex.tools" : [ { // 编译工具和命令 "name" : "xelatex" , "command" : "xelatex" , "args" : [ "-synctex=1" , "-interaction=nonstopmode" , "-file-line-error" , "-pdf" , "%DOCFILE%" ] }, { "name" : "pdflatex" , "command" : "pdflatex" , "args" : [ "-synctex=1" , "-interaction=nonstopmode" , "-file-line-error" , "%DOCFILE%" ] }, { "name" : "bibtex" , "command" : "bibtex" , "args" : [ "%DOCFILE%" ] } ], "latex-workshop.view.pdf.viewer" : "tab" , "latex-workshop.latex.clean.fileTypes" : [ "*.aux" , "*.bbl" , "*.blg" , "*.idx" , "*.ind" , "*.lof" , "*.lot" , "*.out" , "*.toc" , "*.acn" , "*.acr" , "*.alg" , "*.glg" , "*.glo" , "*.gls" , "*.ist" , "*.fls" , "*.log" , "*.fdb_latexmk" ] |
比如上面那个添加完应该如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | { "editor.suggestSelection" : "first" , "vsintellicode.modify.editor.suggestSelection" : "automaticallyOverrodeDefaultValue" , // Latex configuration "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.latex.tools" : [ { // 编译工具和命令 "name" : "xelatex" , "command" : "xelatex" , "args" : [ "-synctex=1" , "-interaction=nonstopmode" , "-file-line-error" , "-pdf" , "%DOCFILE%" ] }, { "name" : "pdflatex" , "command" : "pdflatex" , "args" : [ "-synctex=1" , "-interaction=nonstopmode" , "-file-line-error" , "%DOCFILE%" ] }, { "name" : "bibtex" , "command" : "bibtex" , "args" : [ "%DOCFILE%" ] } ], "latex-workshop.view.pdf.viewer" : "tab" , "latex-workshop.latex.clean.fileTypes" : [ "*.aux" , "*.bbl" , "*.blg" , "*.idx" , "*.ind" , "*.lof" , "*.lot" , "*.out" , "*.toc" , "*.acn" , "*.acr" , "*.alg" , "*.glg" , "*.glo" , "*.gls" , "*.ist" , "*.fls" , "*.log" , "*.fdb_latexmk" ] } |
然后重启
新建一个文件夹(文件夹,不是文件)
写点latex
点右上角第一个编译,然后看看problems
众所周知,警告,相当于没有,所以,没有问题
第二个查看pdf
到此这篇关于vscode编写latex的文章就介绍到这了,更多相关vscode编写latex内容请搜索自学编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持自学编程网!
- 本文固定链接: https://zxbcw.cn/post/217787/
- 转载请注明:必须在正文中标注并保留原文链接
- QQ群: PHP高手阵营官方总群(344148542)
- QQ群: Yii2.0开发(304864863)