Latex的安装
先下载安装MacTex
再安装VSCode,安装成功后,通过VSCode下载插件
settings.json文件位置
配置settings.json文件
{
"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",
"tools": [
"xelatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
"tools": [
"bibtex",
"pdflatex",
"pdflatex",
"pdflatex"
]
},
{
"name": "Compile Rnw files",
"tools": [
"rnw2tex",
"xelatex"
]
},
{
"name": "Compile Jnw files",
"tools": [
"jnw2tex",
"xelatex"
]
},
{
"name": "tectonic",
"tools": [
"tectonic"
]
}
],
"latex-workshop.intellisense.bibtexJSON.replace": {
},
"latex-workshop.view.pdf.viewer": "browser",
"editor.rulers": [
]
}
问题解决方案
- 先判断bib文件内容’,’’}'是否缺失
- 如不缺失,则说明存在编译问题,主要是编译顺序的问题
第一步:先build Latex project,出错了我们先不管,进入第二步
第二步:选择xe->bib->xe->xe,再次build,问题解决。