<Mac> Latex + VSCode

下载

MacTex

or

brew install matex

设置环境变量

# ~/.zshrc
export PATH="$PATH:/Library/TeX/texbin/"

VSCode

安装 LaTeX Workshop 插件

修改 settings.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"

快捷键

  • Command-Option-B:编译
  • Command-Option-V:预览
  • Command-Option-J:搜索

<Mac> Latex + VSCode
http://guoguo.host/blog/p/cc6c255c.html
作者
Guoguo
发布于
2023年11月12日
许可协议