当前位置:   article > 正文

VSCode Latex配置_vscode中配置latex

vscode中配置latex

VSCode中F1打开设置,首选项:打开工作区设置

{
    // 配置latex
    "editor.minimap.enabled": true, //控制是否显示缩略图。
    //1: 准备编译工具。
    "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%"
            ]
        }
    ],
    //2: 设置编译命令。
    "latex-workshop.latex.recipes": [
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "bibtex",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        }
    ],
    //3:设置使用 SumatraPDF 预览编译好的PDF文件,需要修改SumatraPDF.exe和Code.exe的路径
    "latex-workshop.view.pdf.viewer": "tab", //"external",//"tab", 说明:“tab”表示在窗口内显示,“external”表示在外部显示。
    "latex-workshop.view.pdf.ref.viewer": "auto", // PDF查看器用于在\ref上的[View on PDF]链接
    "latex-workshop.view.pdf.external.viewer.command": "D:/Program Files/Tools/SumatraPDF/SumatraPDF.exe", // 注意修改路径
    "latex-workshop.view.pdf.external.viewer.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"D:/Program Files/Dev Tools/Microsoft VS Code/Code.exe\" \"D:/Program Files/Dev Tools/Microsoft VS Code/resources/app/out/cli.js\" -gr \"%f\":\"%l\"",
        "%PDF%"
    ],
    //4: 配置正向和反向搜索,需要修改vscode的路径,反向搜索只能在vscode中执行。
    "latex-workshop.view.pdf.external.synctex.command": "D:/Program Files/Tools/SumatraPDF/SumatraPDF.exe", // 注意修改路径
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"D:/Program Files/Dev Tools/Microsoft VS Code/Code.exe\"\" \"D:/Program Files/Dev Tools/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"", // 注意修改路径
        "%PDF%"
    ],
    // 6:快捷键设置
    // {
    //   "key": "alt+s",
    //   "command": "latex-workshop.synctex",
    //   "when": "editorTextFocus && !isMac"
    // },
    // {
    //     "key": "alt+b",
    //     "command": "latex-workshop.build",
    //     "when": "editorTextFocus && !isMac"
    // },
    // {
    //     "key": "alt+t",
    //     "command": "latex-workshop.kill",
    //     "when": "editorTextFocus && !isMac"
    // },
    // {
    //     "key": "alt+e",
    //     "command": "latex-workshop.recipes"
    // },
    //5: 设置删除辅助文件的命令
    "latex-workshop.latex.clean.enabled": true,
    "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", //默认编译链,first、lastUsed
    "latex-workshop.latex.autoBuild.run": "onSave", //自动编译tex文件,onFileChange、onSave、never
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click", // 用于反向同步的内部查看器的键绑定。ctrl/cmd +点击(默认)或双击 
    "latex-workshop.message.error.show": false, //显示错误(弹窗)
    "latex-workshop.message.warning.show": false, //显示警告(弹窗)
    //6: 其他设置
    "latex-workshop.showContextMenu": true, //右键菜单,(1)编译文件;(2)定位游标
    "latex-workshop.intellisense.package.enabled": true, //从使用的包中自动补全命令和环境
    "git.autofetch": true, //若设置为 true,则自动从当前 Git 存储库的默认远程库提取提交;若设置为“全部”,则从所有远程库进行提取。
    "security.workspace.trust.untrustedFiles": "open", //始终信任工作区
    "vsicons.dontShowNewVersionMessage": true, //不显示新版本消息
    //针对某种语言,配置替代编辑器设置
    "[latex]": {
        "editor.formatOnPaste": false, //针对某种语言,配置替代编辑器设置
        "editor.suggestSelection": "recentlyUsedByPrefix" //控制在建议列表中如何预先选择建议。recentlyUsedByPrefix: 根据之前补全过的建议的前缀来进行选择。例如,co -> console、con -> const。
    },
    "code-runner.clearPreviousOutput": true,
    "code-runner.saveAllFilesBeforeRun": true,
    "code-runner.runInTerminal": true,
    "json.schemas": [],
    //"workbench.colorTheme": "Solarized Dark",
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/213656
推荐阅读
相关标签
  

闽ICP备14008679号