在vscode中配置latex。
1、搜索插件 ”latex workshop“并安装,安装好后重启vscode,此时vscode左侧菜单栏出现TEX选项,点击后会出现commands列表,其中build LaTeX project即是编译tex文本的工具,View LaTeX PDF是将tex文本生成pdf的工具。
2、配置文件如下:
在文件-->首选项-->设置-->用户-->扩展-->json-->schemas中添加如下代码:
即可实现效果!
{
"editor.mouseWheelZoom": true,
"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.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"
]
}
],
}
3、完成以上步骤,就可以在vscode中新建tex、编写、编译、输出pdf了。texlive和vscode中的latex插件还有更多其他方便的高级功能,但以上基本可以满足我的需求了,就不往下探索了。