姜鹏辉的个人博客 GreyNius

【Mac】在Mac下使用vscode来写LaTeX文件

2020-05-26

在Mac下使用vscode来写LaTeX文件

安装LaTeX

MacTeX官网安装TeXShop

在VScode中配置LaTeX

安装扩展LaTeX Workshop

搜索扩展LaTeX WorkShop

打开配置文件

使用快捷键cmd + 打开VScode的设置,点击拓展->LaTeX,或者直接在搜索栏中输入recipestools

然后点击在setting.json中设置

修改配置文件

修改两项:latex-workshop.latex.toolslatex-workshop.latex.recipes

"latex-workshop.latex.tools": [
    
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOC%"
            ]
        },
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        
        {
            "name": "xelatex -> bibtex -> xelatex*2", //如果带有BibTeX,要编译三次
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex"
            ]
        },
        {
          "name": "pdflatex -> bibtex -> pdflatex*2",
          "tools": [
              "pdflatex",
              "bibtex",
              "pdflatex",
              "pdflatex"
          ]
        },
    ]

参考:在Mac上用VSCode敲LaTeX


Similar Posts

上一篇 LaTeX使用技巧

Comments