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,
}

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

相关推荐
OsDepK8 小时前
xcode应用构建至testflight测试流程
ide·macos·xcode
frjc9 小时前
如何在 IDEA 中打开并运行已有Java项目
java·ide·intellij-idea
CounterGlew51115 小时前
Vscode通过ssh链接autodl云服务器并配置codex
运维·服务器·vscode
女神下凡15 小时前
PyCharm 2026破解激活
ide·python·pycharm
谁刺我心15 小时前
【vscode问题】远程remote cpptools导致linux板子cpu爆炸问题
ide·vscode·编辑器
guo_wen_qiang16 小时前
一个好用的命令——查看文件大小
linux·macos
阿童木写作1 天前
跨境电商图片翻译工具推荐:批量图片翻译+视频字幕翻译+智能抠图
python·macos·音视频·xcode
LaughingZhu1 天前
Product Hunt 每日热榜 | 2026-09-02
java·ide·intellij-idea
进击的蜗牛Eric1 天前
VSCode Server手动安装指南(简洁版)
vscode
攀小黑1 天前
vue3+Web Speech API 封装了一个弹窗语音输入
前端·macos·xcode