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

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

相关推荐
普通网友3 小时前
苹果笔记本(Mac)连接手机完全指南
macos·智能手机
先跑起来再说5 小时前
Git 入门到实战:一篇搞懂安装、命令、远程仓库与 IDEA 集成
ide·git·后端·elasticsearch·golang·intellij-idea
Aftery的博客5 小时前
Xcode运行报错:SDK does not contain ‘libarclite‘ at the path
macos·cocoa·xcode
嵌入小生0077 小时前
标准IO---核心函数接口延续(嵌入式Linux)
c语言·vscode·vim·嵌入式·小白·标准io·函数接口
LYOBOYI1237 小时前
vscode界面美化
ide·vscode·编辑器
mailangduoduo11 小时前
零基础教学连接远程服务器部署项目——VScode版本
服务器·pytorch·vscode·深度学习·ssh·gpu算力
楚轩努力变强12 小时前
iOS 自动化环境配置指南 (Appium + WebDriverAgent)
javascript·学习·macos·ios·appium·自动化
骥龙1 天前
第六篇:AI平台篇 - 从Jupyter Notebook到生产级模型服务
ide·人工智能·jupyter
kun200310291 天前
如何用Obsidian+VSCode生成文案排版并发布到公众号
ide·vscode·编辑器
猫头虎1 天前
如何解决 OpenClaw “Pairing required” 报错:两种官方解决方案详解
网络·windows·网络协议·macos·智能路由器·pip·scipy