# MacOS + LaTeX + VSCode
> Apple Silicon SoC
## Install MacTeX
[https://www.tug.org/mactex/](https://www.tug.org/mactex/)
## Install VSCode
[https://code.visualstudio.com/](https://code.visualstudio.com/)
### LaTeX Workshop
[https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop)
### VSCode 修改 settings.json
![](https://inc-s3.ntub.edu.tw/imgur-imgs/NcWdLnF.png)
<!-- ![](https://i.imgur.com/NcWdLnF.png) -->
![](https://inc-s3.ntub.edu.tw/imgur-imgs/DgrZTop.png)
<!-- ![](https://i.imgur.com/DgrZTop.png) -->
貼在 settings.json 下面
```json
"latex-workshop.bibtex-format.sort.enabled": true,
"latex-workshop.bibtex-format.align-equal.enabled": true,
"latex-workshop.bibtex-format.sortby": [
"booktitle",
"journal",
"title",
"year",
],
"latex-workshop.bibtex-fields.sort.enabled": true,
"latex-workshop.bibtex-fields.order": [
"title",
"author",
"key",
"booktitle",
"journal",
"year",
"volume",
"number",
"pages",
"publisher",
"address",
"editor",
"edition",
"translator",
],
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.latex.autoClean.run": "onBuilt",
"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"
],
"latex-workshop.latex.recipe.default": "pdflatex*2",
"latex-workshop.latex.recipes": [
{
"name": "pdflatex*2",
"tools": [
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex*2",
"tools": [
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
],
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
}
],
"latex-workshop.message.badbox.show": false,
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
"latex-workshop.view.pdf.viewer": "tab"
```
## 參考
> - https://zhuanlan.zhihu.com/p/107393437
> - https://homepages.rpi.edu/home/36/wangy52/public_html/PersonalWebsite/build/html/Misc/Mac/VSCode/VSCode-LaTeX.html
> - https://blog.csdn.net/phdongou/article/details/121733268
> - https://github.com/Tsingwaa/workspace_configs/blob/main/mac_vsc_settings.json