vscode设置latex

vscode配置latex

1.安装vscode,并添加环境变量路径

2.安装latex,bin文件夹添加到环境变量路径

3.vscode安装插件

4.vscode->文件->首选项->显示配置内容->setting.json文件,查看其位置目录,通过我的电脑找到此文件(不要使用vscode修改,因为vscode无权限,会导致修改失败)

5.setting.json通过记事本打开,覆写文件内容

复制代码
记得修改位置
"latex-workshop.view.pdf.external.viewer.command":"D:\\Program Files\\SumatraPDF\\SumatraPDF.exe",

"\"D:/Program Files/vscode/Microsoft VS Code/Code.exe\" \"D:/Program Files/vscode/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"",
    "%PDF%"

以下进行复制

python 复制代码
{
    "latex-workshop.hover.preview.enabled":true,
    "latex-workshop.hover.preview.scale":0.8,
    "latex-workshop.latex.autoBuild.run": "onFileChange",
    "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.autoClean.run": "onFailed",
    "latex-workshop.latex.recipe.default": "lastUsed",
    //"latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    "editor.minimap.enabled": true, //控制是否显示缩略图。
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOCFILE%"
            ]
        },
        {
            "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": "(bib-chain)xelatex -> bibtex -> xelatex -> xelatex",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "(bib-chain)pdflatex -> bibtex -> pdflatex -> pdflatex",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
    ],

    "latex-workshop.view.pdf.viewer": "external",

    "latex-workshop.view.pdf.external.viewer.command":"D:\\Program Files\\SumatraPDF\\SumatraPDF.exe",
    "latex-workshop.view.pdf.external.viewer.args": [
    "-forward-search",
    "%TEX%",
    "%LINE%",
    "-reuse-instance",
    "-inverse-search",
    "\"D:/Program Files/vscode/Microsoft VS Code/Code.exe\" \"D:/Program Files/vscode/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"",
    "%PDF%"
      ],
    "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",
        "*.synctex.gz"
        "*.gz"
        "*.aux"
    ],
}

运行过程中可能会出现perl缺失,但是不影响使用(一些附属文件无法自动删除),安装后把perl安装目录设置为环境变量路径。

相关推荐
╰つ゛木槿1 小时前
使用VSCode编写C#程序
ide·vscode·c#
musk12122 小时前
vim 中快速删除引号中的字符串
linux·编辑器·vim
GuokLiu4 小时前
250405-VSCode编辑launch.json实现Debug调试Open-WebUI
vscode·debug·open-webui
花花鱼6 小时前
vscode中的【粘滞滚动】的基本概念和作用,关闭了以后如何开启
ide·vscode·编辑器
wang_peng7 小时前
android studio 基础
android·ide·android studio
blakeyi8 小时前
vscode保存自动刷新cocos creator编辑器
ide·vscode·cocos creator·热更新
点云SLAM8 小时前
MD编辑器中的段落缩进怎么操作
编辑器·markdown·md编辑器·空格操作·css编辑器
莫魂魂8 小时前
002_IDEA企业开发工具
java·ide·intellij-idea
周博洋K9 小时前
VScode 玩 MCP的server
ide·vscode·编辑器
rainFFrain15 小时前
日志与策略模式
linux·运维·vscode·策略模式