软件编程
位置:首页>> 软件编程>> C#编程>> vscode编写latex的方法

vscode编写latex的方法

作者:Nightmare004  发布时间:2022-05-21 13:30:52 

标签:vscode,latex

假设你已经装了texlive

打开cmd输入

latex --version

应该能输出

vscode编写latex的方法

打开vscode,安装这几个插件

vscode编写latex的方法

设置->Settings

vscode编写latex的方法

点击右上角的Open Settings(JSON)

vscode编写latex的方法

打开应该是这样的(也许你还配置过其他的东西,反正是个json)


{
   "editor.suggestSelection": "first",
   "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue"
}

添加以下这些(就按json那么添加)


// 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"
   ]

比如上面那个添加完应该如下


{
   "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

vscode编写latex的方法

点右上角第一个编译,然后看看problems

众所周知,警告,相当于没有,所以,没有问题

vscode编写latex的方法

第二个查看pdf

vscode编写latex的方法

来源:https://blog.csdn.net/qq_39942341/article/details/118946895

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com