当前位置: 首页 > article >正文

vscode + latex workshop + sumatraPDF

更新vscode及latex workshop,但同时也带来新问题,ctrl+s时,文件保存总是回退到之前版本的内容,pdf交互也无法正常使用。重新配置如下(sumatraPDF在此配置下新版本失效,只好回退v3.3.3可正常使用):
 

{
    "workbench.colorCustomizations": {
        "editor.selectionHighlightBackground": "#b1aeae",
        "panel.background": "#F5F5F5"
    },
    "workbench.colorTheme": "Default Light+",
    "latex-workshop.latex.autoBuild.run": "onSave",
    "latex-workshop.latex.recipe.default": "lastUsed",
    "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",
                "-pdf",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "XeLaTeXmk",
            "command": "latexmk",
            "args": [
                "-xelatex",
                "-synctex=1",
                "-shell-escape",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },
        // 增加编译工具
        {
            "name": "latex",
            "command": "latex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "dvips",
            "command": "dvips",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "dvipdfmx", //dvipdfm wrong
            "command": "dvipdfmx",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "dvi2pdf",
            "command": "dvi2pdf",
            "args": [
                "%DOCFILE%"
            ]
        },
        { // for "ps2pdf", but wrong, no why
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-ps",
                //"-pdflatex=pdflatex -shell-escape %O %S",
                "-ps2pdf=ps2pdf -shell-escape %O %S",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ]
        },
        {
            "name": "ps2pdf",
            "command": "ps2pdf",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    // 默认编译工具顺序
    "latex-workshop.latex.recipes": [
        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "pdf->bib->pdf->pdf",
            "tools": [
                "pdflatex",
                "bibtex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "xe->bib->xe->xe",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "xe->biber->xe*2",
            "tools": [
                "xelatex",
                "biber",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "latexmk-xe",
            "tools": [
                "XeLaTeXmk"
            ]
        },
        {
            "name": "xelatex",
            "tools": [
                "xelatex"
            ],
        },
        {
            "name": "la->bib->la->la->dvipdfmx",
            "tools": [
                "latex",
                "bibtex",
                "latex",
                "latex",
                "dvipdfmx",
            ]
        },
        // {
        //     "name": "dvipdfmx",
        //     "tools": [
        //         "dvipdfmx"
        //     ]
        // },
        // {
        //     "name": "latexmk",
        //     "tools": [
        //         "latexmk"
        //     ]
        // },
        // {
        //     "name": "ps2pdf",
        //     "tools": [
        //         "ps2pdf"
        //     ]
        // },
    ],
    "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",
    "explorer.confirmDelete": false,
    "workbench.editor.enablePreview": false,
    "workbench.editorAssociations": {
        "*.pdf": "latex-workshop-pdf-hook"
    },
    "workbench.startupEditor": "none",
    "git.autofetch": true,
    "explorer.confirmPasteNative": false,
    "editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
    },
    "github.copilot.enable": {
        "*": false,
        "plaintext": false,
        "markdown": false,
        "scminput": false,
        "latex": false
    },
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 60000,
    "editor.formatOnSave": true,
    "editor.wordWrap": "on",
    "latex-workshop.formatting.latex": "latexindent",
    "latex-workshop.formatting.latexindent.path": "D:\\texlive\\2024\\bin\\windows\\latexindent.exe",
    //使用外部2
    "latex-workshop.view.pdf.viewer": "external",
    "latex-workshop.view.pdf.external.viewer.command": "C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe",
    "latex-workshop.view.pdf.external.viewer.args": [
        "%PDF%"
    ],
    "latex-workshop.view.pdf.external.synctex.command": "C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe",
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "%PDF%",
    ],
    "latex-workshop.texcount.autorun": "onSave",
}

因为新安装pdf阅读器,所以预览空格又失效,重新修改注册表:
 

1、注册表找到:HKEY_CLASSES_ROOT\.pdf\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}

2、将默认值改为:{DC6EFB56-9CFA-464D-8880-44885D7DC193}   adobe
{FFBD7029-84D7-4E1E-BE44-B6619BC545ED}   福昕

此处值可参考以下方式搜索:“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers”下面Adobe PDF Preview Handler for Vista的值


http://www.kler.cn/a/596163.html

相关文章:

  • JVM常用概念之隐式空值检查
  • TouchSocket TcpService:构建高性能Tcp服务的终极利器
  • 基于SpringBoot + Vue 的鲜花商城管理系统
  • 智能汽车图像及视频处理方案,支持视频智能拍摄能力
  • 双非控制学硕女生,对渲染、音视频、医疗影像感兴趣,如何规划争取拿到中厂开发岗位?
  • 深入理解计算机网络:OSI 与 TCP/IP 各层结构与功能
  • 如何在ubunt上安装flume
  • 玩转python: Python并发编程-多线程的实战应用解析
  • Linux中安装redis
  • atop命令介绍(全面资源监控:同时监控CPU、内存、磁盘、网络和进程活动)性能监控、资源数据
  • Python---数据分析(Pandas六:二维数组DataFrame,DataFrame的创建,DataFrame的属性)
  • 如何在 HTML 中创建一个有序列表和无序列表,它们的语义有何不同?
  • ESP32-C6助力设备互联互通,Wi-Fi6无线通信方案,物联网交互联动
  • 卸载conda,poetry常用命令,vscode使用poetry虚拟环境
  • EmbodiedSAM:在线实时3D实例分割,利用视觉基础模型实现高效场景理解
  • AWS大数据解决方案实战解析:如何以低成本驱动企业数据智能升级
  • 电脑磁盘分盘
  • 大模型微调之早停(Early Stopping)
  • 避坑指南 | 阿里云服务器centos7上MySQL部署优化指南
  • 阶跃星辰开源300亿参数视频模型Step-Video-TI2V:运动可控+102帧长视频生成