Mac下latex+VS code配置报错:Recipe terminated with error. Retry building the project.
一、问题描述
在配置setjs文件后,出现报错:Recipe terminated with error. Retry building the project.(命令行的具体错误很长,忘记截图了,反正每个汉字都给我报了个错)网上的各种方法基本都尝试了,依旧无法解决问题,最后交了“学费”,解决了问题,每个人的问题原因不一定一样,也算在此给Mac的小伙伴们提供一个方向吧。
二、问题原因
没能成功检测系统,所以用了windows的字体,而mac没有这种字体。
三、解决方法
当时那个小哥是给我的系统导入了一个方正字体,然后帮我重新配置了一下setjs,要是有人需要文件配置的话可后续发出来。
字体下载方法可参考Mac上的中文乱码问题_zzxinn的博客-CSDN博客这篇。
怕私信看到不及时,就把配置代码放这了(可以先在Mac的字体册里看看有没有方正这种字体)。
{
"editor.tabSize": 4,
"editor.detectIndentation": false,
"editor.wordWrap": "on",
"security.workspace.trust.enabled": false,
// ****************
// LaTeX
// ****************
"files.associations": {
"*.sty": "latex-expl3",
"*.cls": "latex-expl3"
},
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.recipe.default": "lastUsed",
"latex-workshop.view.pdf.viewer": "tab",
// "latex-workshop.synctex.synctexjs.enabled": true,
"latex-workshop.latexindent.path": "latexindent",
"latex-workshop.showContextMenu": true,
// "latex-workshop.view.pdf.invert": 0.8,
// "latex-workshop.viewer.pdf.internal.keyboardEvent": "auto",
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
// "latex-workshop.intellisense.package.dirs": ["./"],
"latex-workshop.latex.clean.fileTypes": [
"*.abs",
"*.acn",
"*.acr",
"*.alg",
"*.aux",
"*.bak",
"*.bbl",
"*.bcf",
"*.blg",
"*.col",
"*.con",
"*.cor",
"*.DS_Store",
"*.fdb_latexmk",
"*.fls",
"*.glg",
"*.glo",
"*.gls",
"*.gz",
"*.idx",
"*.ilg",
"*.ind",
"*.loc",
"*.lof",
"*.log",
"*.los",
"*.lot",
"*.nav",
"*.nlo",
"*.nls",
"*.out",
"*.pdfsync",
"*.sav",
"*.sgl",
"*.sgn",
"*.sgr",
"*.slg",
"*.sll",
"*.sln",
"*.slo",
"*.slr",
"*.sls",
"*.snm",
"*.soc",
"*.spl",
"*.synctex",
"*.synctex(busy)",
"*.synctex.gz(busy)",
"*.thm",
"*.toc",
"*.toe",
"*.xdv",
"*.xdy",
"*.xml",
"*.xwm",
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [ "xelatex" ],
},
{
"name": "xelatex batch",
"tools": [ "xelatex batchmode" ]
},
{
"name": "xelatex & bibtex",
"tools": [ "xelatex", "bibtex", "xelatex", "xelatex" ]
},
{
"name": "xelatex & biber",
"tools": [ "xelatex", "biber", "xelatex", "xelatex" ]
},
{
"name": "pdflatex",
"tools": [ "pdflatex" ]
},
{
"name": "pdflatex & bibtex",
"tools": [ "pdflatex", "bibtex", "pdflatex", "pdflatex" ]
},
{
"name": "pdflatex & biber",
"tools": [ "pdflatex", "biber", "pdflatex", "pdflatex" ]
},
{
"name": "latexmk pdf",
"tools": [ "latexmk -pdf" ]
},
{
"name": "latexmk xe",
"tools": [ "latexmk -xe" ]
},
{
"name": "Japanese",
"tools": [
"JP",
"dvipdfmx"
]
},
],
"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",
"-shell-escape",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "xelatex batchmode",
"command": "xelatex",
"args": [
"-synctex=-1",
"-interaction=batchmode",
"%DOCFILE%"
]
},
{
"name": "latexmk -pdf",
"command": "latexmk",
"args": [
"-pdf",
"-synctex=-1",
"-interaction=errorstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "latexmk -xe",
"command": "latexmk",
"args": [
"-pdfxe",
"-synctex=-1",
"-interaction=errorstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
},
{
"name": "biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
},
{
"name": "JP",
"command": "uplatex",
"args": [
"-synctex=-1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "dvipdfmx",
"command": "dvipdfmx",
"args": [
"%DOCFILE%"
]
},
],
"editor.semanticTokenColorCustomizations": {
},
}