Mac下利用vscode配置latex

由于安装mactex默认的是pdftex,该解释器不支持中文所以需要xetex解释器

在settings.json的配置文件中需要加上下面这段代码配置文件

复制代码
{
   "editor.mouseWheelZoom": true,
 
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ],
        },
        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "xe->bib->xe->xe",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdf->bib->pdf->pdf",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
}

该配置代码可以将pdftex转变为更为丰富的xetex。同时还有多种个性化配置

复制代码
{
    "workbench.colorTheme": "Default Light Modern"
    // 禁止自动编译
    "latex-workshop.latex.autoBuild.run": "never",
    // 编译后自动清理无用文件
    "latex-workshop.latex.autoClean.run": "onBuilt",
    "latex-workshop.latex.clean.subfolder.enabled": true,
    // 自动使用上一次的编译器
    "latex-workshop.latex.recipe.default": "lastUsed",
    // 根据使用的包自动补全
    "latex-workshop.intellisense.package.enabled": true,
    // 不弹窗显示错误和告警信息
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
}

如有别的个性化配置会持续更新。

相关推荐
xskukuku5 小时前
使用VSCode配置C语言运行环境
c语言·ide·vscode
10086love100108 小时前
Macos安装codex
macos
小王C语言11 小时前
vscode智能提示问题、跳转问题
ide·vscode·编辑器
ryanuo714 小时前
Mac(M芯片)上进行嵌入式开发遇到的问题
嵌入式硬件·macos·开发板
南知意-14 小时前
IDEA 2026.1最新版安装教程
java·ide·intellij-idea·idea安装·idea激活
不爱记笔记15 小时前
苹果WWDC 2026全解析:Apple Intelligence+ 性能提升数据一览
macos·ios·wwdc
隔窗听雨眠16 小时前
Typora插件开发指南:从零打造IDE级写作环境
ide·typora
专注_每天进步一点点17 小时前
IDEA中,Apifox Helper 的 2.0.15-243版本的插件 导出指定的接口,入参的中文名为空,描述为空
java·ide·intellij-idea
郝亚军18 小时前
如何在vscode上运行python程序
ide·vscode·编辑器