latex vscode 配置参考

这篇博客详细介绍了如何在Visual Studio Code(VSCode)中配置LaTeX环境,包括设置构建配方、编辑器工具、自动构建和清理辅助文件等,确保高效地编写和编译LaTeX文档。配置涵盖了pdflatex、xelatex、lualatex和bibTeX等多种编译选项,同时利用SumatraPDF实现PDF同步浏览和编辑。此外,还详细列出了各步骤的参数设置,方便用户根据个人需求调整。
摘要由CSDN通过智能技术生成

我觉得这个博客写的不错VSCode配置LaTeX最详细版,加上wiki文档足够了

// --- Latex 配置 ---
    // 为构建而运行的工具序列
    "latex-workshop.latex.recipes": [
        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "lualatex",
            "tools": [
                "lualatex"
            ]
        },
        {
            "name": "bibTeX",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
    // 可用于构建的工具
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "lualatex",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    // 保存文件后构建项目
    "latex-workshop.latex.autoBuild.run": "onSave",
    // 两次连续自动构建之间的最小时间间隔(以毫秒为单位)
    "latex-workshop.latex.autoBuild.interval": 1000,
    // 从加载的包中启用命令和环境的自动完成(默认也是true)
    "latex-workshop.intellisense.package.enabled": true,
    // 默认的 PDF 查看器 external代表使用外部PDF查看器
    "latex-workshop.view.pdf.viewer": "external",
    // 使用外部查看器时执行的命令,即外部软件的位置 字符串
    "latex-workshop.view.pdf.external.viewer.command": "C:/Users/windows/AppData/Local/SumatraPDF/SumatraPDF.exe",
    // 提供给上述命令的参数 数组
    "latex-workshop.view.pdf.external.viewer.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"C:/Users/windows/AppData/Local/Programs/Microsoft VS Code/Code.exe\" \"C:/Users/windows/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js\" -gr \"%f\":\"%l\"",
        "%PDF%"
    ],
    // 用于外部查看器的 SyncTeX 命令 字符串
    "latex-workshop.view.pdf.external.synctex.command": "C:/Users/windows/AppData/Local/SumatraPDF/SumatraPDF.exe",
    // 用于上述命令的参数 数组
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "code \"C:/Program Files/SelfSoftware/Microsoft VS Code/resources/app/out/cli.js\" -gr \"%f\":\"%l\"",
        "%PDF%",
    ],
    // LaTeX 编译通常会生成几个辅助文件,相关:latex-workshop.clean
    // 要清理的文件扩展名 字符串数组
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist", // 默认中没有出现
        "*.fls",
        "*.log", // 默认中没有出现
        "*.nav",
        "*.snm",
        "*.vrb", // 默认中没有出现
        "*.fdb_latexmk",
        "*.synctex(busy)", // 默认中出现但是其他博客的配置没有出现
        "*.synctex.gz(busy)" // 同上
    ],
    "explorer.confirmDelete": false,
    // --- Latex 配置 END ---
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值