VScode+latex+Sumatra 环境配置

安装Tex Live 及Vscode

此处参考博客:VScode+latex+Sumatra PDF环境配置(步步到位)进行安装。
本文主要记录配置的json文件设置。

{
    "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.synctex.afterBuild.enabled":true,
    "latex-workshop.showContextMenu": true,
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
    "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": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "XeLaTeX",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "PDFLaTeX",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "BibTeX",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "LaTeXmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
    ],
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk"
    ],
    "latex-workshop.latex.autoClean.run": "onFailed",
    "latex-workshop.latex.recipe.default": "lastUsed",    
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    
    // 设置VScode内部查看生成的pdf文件
    "latex-workshop.view.pdf.viewer": "external",
    // PDF查看器用于在\ref上的[View on PDF]链接
    "latex-workshop.view.pdf.ref.viewer":"auto",
    // 使用外部查看器时要执行的命令。此功能不受官方支持。
    "latex-workshop.view.pdf.external.viewer.command": "D:/Program Files/SumatraPDF/SumatraPDF.exe", // 注意修改路径
    // 使用外部查看器时,latex-workshop.view.pdf.external.view .command的参数。此功能不受官方支持。%PDF%是用于生成PDF文件的绝对路径的占位符。
    "latex-workshop.view.pdf.external.viewer.args": [
        "%PDF%"
    ],
    // 将synctex转发到外部查看器时要执行的命令。此功能不受官方支持。
    "latex-workshop.view.pdf.external.synctex.command": "D:/Program Files/SumatraPDF/SumatraPDF.exe", // 注意修改路径
    // latex-workshop.view.pdf.external.synctex的参数。当同步到外部查看器时。%LINE%是行号,%PDF%是生成PDF文件的绝对路径的占位符,%TEX%是触发syncTeX的扩展名为.tex的LaTeX文件路径。
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"D:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\cli.js\" --ms-enable-electron-run-as-node -r -g \"%f:%l\"",
    ], 
}

其中指令行表示编译完成后自动打开pdf。

“latex-workshop.synctex.afterBuild.enabled”:true,

相关推荐

  1. PyCharm 环境配置 Python

    2024-07-20 14:54:03       53 阅读
  2. pytorch环境配置

    2024-07-20 14:54:03       64 阅读
  3. 前端开发环境配置

    2024-07-20 14:54:03       68 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-20 14:54:03       123 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-20 14:54:03       131 阅读
  3. 在Django里面运行非项目文件

    2024-07-20 14:54:03       109 阅读
  4. Python语言-面向对象

    2024-07-20 14:54:03       117 阅读

热门阅读

  1. 宠物健康管理新突破:智能听诊器

    2024-07-20 14:54:03       28 阅读
  2. 学习计算机

    2024-07-20 14:54:03       28 阅读
  3. 前端出发能走多远——写在前面

    2024-07-20 14:54:03       29 阅读
  4. Linux 之 grep命令详解

    2024-07-20 14:54:03       27 阅读
  5. 小程序底层原理

    2024-07-20 14:54:03       28 阅读
  6. 力扣第十八题——四数之和

    2024-07-20 14:54:03       28 阅读
  7. python处理DWG文件

    2024-07-20 14:54:03       23 阅读
  8. Mojo AI编程语言(九)网络编程:构建联网应用

    2024-07-20 14:54:03       28 阅读
  9. CSS Shapes布局

    2024-07-20 14:54:03       25 阅读
  10. 12、实现基于共享内存的二叉树set(续)

    2024-07-20 14:54:03       33 阅读