在Mac下使用vscode来写LaTeX文件
安装LaTeX
在MacTeX官网安装TeXShop
在VScode中配置LaTeX
安装扩展LaTeX Workshop
搜索扩展LaTeX WorkShop
打开配置文件
使用快捷键cmd
+ ,
打开VScode的设置,点击拓展
->LaTeX
,或者直接在搜索栏中输入recipes
或tools
然后点击在setting.json中设置
修改配置文件
修改两项:latex-workshop.latex.tools
和latex-workshop.latex.recipes
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex -> bibtex -> xelatex*2", //如果带有BibTeX,要编译三次
"tools": [
"xelatex",
"bibtex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
]