MACOS版本号:10.15.6
1. 下载MACTEX,记得选择对应版本的,网址:MacTeX - TeX Users Group
2. 下载VScode,MAC版本,下载后,可以变为中文,然后在拓展里,下载 LaTeX Workshop
3. 此时已经可以编译纯英文版本的 LaTeX,但我们一般编译的是中文的,用的是XeLaTeX,所以这个时候就需要在 setting Json 里加入这一段代码(具体是 CODE-首选项-设置-右上角一个小标志,打开设置json,粘贴如下代码:)
这段代码包括了
①XeLaTeX的配置
②两次编译 XeLaTeX,防止有些时候目录不显示(血泪)
③删除部分不需要的Tex编译时产生的多余文件
④以上都是我一个个自己搜出来加上去的
{
"js/ts.implicitProjectConfig.checkJs": true,
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "latexmk",
"command": "latexmk",
// "args": [
// "-synctex=1",
// "-interaction=nonstopmode",
// "-file-line-error",
// "-pdf",
// "-outdir=%OUTDIR%",
// "%DOC%"
// ],
"args": [
"-xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
/*
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
*/
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex",
"xelatex"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "BibTeX",
"tools": [
"bibtex"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
],
"latex-workshop.latex.autoClean.run": "onBuilt", //注意结尾是 t 不是 d
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk",
],
}
4. 这个时候上面的Json文件可能会报错,第一行一直有一个冒号!!我搜了很久才知道是什么原因,源自
vscode中的jsconfig.json文件首行无故报错_Ocean_HL的博客-CSDN博客_jsconfig.json报错问题在vscode中,我们配置完jsconfig.json文件后可能会报错。分析1.vscode会自动进行JavaScript文件的语义检查。因为自定义的jsconfig.json文件无法覆盖vscode自带的配置,所以会报错。解决方法打开配置settings.json文件,让自定义的jsconfig.js文件覆盖vscode默认选项。...https://blog.csdn.net/bidang3275/article/details/115457216以上可以解决这个问题
5. 应该没什么遗漏的了,这样就可以正常使用了