最近在回稿,使用了Github上的Latex模板,在使用Vscode编译过程中出现了一些问题,仔细查询发现是该模板使用了Biber而不是常见的Bibtex进行文献管理,在使用常规的编译方式时就会报错如
Please (re)run Biber on the file:
(biblatex) review_response
(biblatex) and rerun LaTeX afterwards.
因此需要在Vscode设置中添加有关Biber编译工具的命令
在settings.json的"latex-workshop.latex.tools":
中添加
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
}
以及在"latex-workshop.latex.recipes":
中添加
{
"name": "pdf->biber->pdf*2",
"tools": [
"pdflatex",
"biber",
"pdflatex",
"pdflatex"
]
},
在编译时选择对应编译命令即可
另附完整的Latex workshop设置相关代码 “latex-workshop.latex.tools”:
[
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
},
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
],
},
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xe->bib->xe*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdf->bib->pdf*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "pdf->biber->pdf*2",
"tools": [
"pdflatex",
"biber",
"pdflatex",
"pdflatex"
]
},
],
// 禁止自动编译
// "latex-workshop.latex.autoBuild.run": "never",
// 编译后自动清理无用文件
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.latex.clean.subfolder.enabled": true,
// 自动使用上一次的编译器
"latex-workshop.latex.recipe.default": "lastUsed",
// 根据使用的包自动补全
"latex-workshop.intellisense.package.enabled": true,
// 不弹窗显示错误和告警信息
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,