生溪物语 2024-01-18 22:32 采纳率: 0%
浏览 30

vscode+LaTex+sumatra出现问题!载入失败!希望得到帮助!

尝试用vscode和sumatraPDF写LaTex,但是vscode中写好代码后sumatra打开却载入失败(只是很简单的测试代码)
附上一些现在的配置:
vscode配置文件(因为不知道是什么语言就放在c++代码块里了)
求指教!!


```c++
{
    "security.workspace.trust.untrustedFiles": "open",
    "liveServer.settings.donotShowInfoMsg": true,
    "files.autoSave": "afterDelay",
    "workbench.colorTheme": "Monokai",
    "cmake.showOptionsMovedNotification": false,
    // 设置是否自动编译
    "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.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": "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"
    ],
    //设置为onFaild 在构建失败后清除辅助文件
    "latex-workshop.latex.autoClean.run": "onFailed",
    // 使用上次的recipe编译组合
    "latex-workshop.latex.recipe.default": "lastUsed",
    // 用于反向同步的内部查看器的键绑定。ctrl/cmd +点击(默认)或双击
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    
    //使用 SumatraPDF 预览编译好的PDF文件
    // 设置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:/LaTex/textlive/pdfViewer/SumatraPDF/SumatraPDF.exe", 
    "latex-workshop.view.pdf.external.viewer.args": [
        "%PDF%"
    ],
    "latex-workshop.view.pdf.external.synctex.command": "D:/LaTex/textlive/pdfViewer/SumatraPDF/SumatraPDF.exe",
    "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\" E:/Microsoft VS Code/Code.exe\" \"E:/Microsoft VS Code/resources/app/out/cli.js\" --ms-enable-electron-run-as-node -r -g \"%f:%l\"", 
        "%PDF%"
    ]
}

sumatra高级设置文件:

```c++
# For documentation, see https://www.sumatrapdfreader.org/settings/settings3-5-1.html
Theme = Light
FixedPageUI [
    TextColor = #000000
    BackgroundColor = #ffffff
    SelectionColor = #f5fc0c
    WindowMargin = 2 4 2 4
    PageSpacing = 4 4
    InvertColors = false
    HideScrollbars = false
]
ComicBookUI [
    WindowMargin = 0 0 0 0
    PageSpacing = 4 4
    CbxMangaMode = false
]
ChmUI [
    UseFixedPageUI = false
]

SelectionHandlers [
]
ExternalViewers [
]

ZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400
ZoomIncrement = 0

PrinterDefaults [
    PrintScale = shrink
]
ForwardSearch [
    HighlightOffset = 0
    HighlightWidth = 15
    HighlightColor = #6581ff
    HighlightPermanent = false
]
Annotations [
    HighlightColor = #ffff00
    UnderlineColor = #00ff00
    SquigglyColor = #ff00ff
    StrikeOutColor = #ff0000
    FreeTextColor = 
    FreeTextSize = 12
    FreeTextBorderWidth = 1
    TextIconColor = 
    TextIconType = 
    DefaultAuthor = 
]

RememberOpenedFiles = true
RememberStatePerDocument = true
RestoreSession = true
UiLanguage = cn
InverseSearchCmdLine = -inverse-search "\"E:\Microsoft VS Code\Code.exe\" -g \"%f:%l\""
EnableTeXEnhancements = true
DefaultDisplayMode = automatic
DefaultZoom = fit page
Shortcuts [
]
EscToExit = false
ReuseInstance = false
ReloadModifiedDocuments = true

MainWindowBackground = #80fff200
FullPathInTitle = false
ShowMenubar = true
ShowToolbar = true
ShowFavorites = false
ShowToc = true
NoHomeTab = false
TocDy = 0
SidebarDx = 289
ToolbarSize = 18
TabWidth = 300
TreeFontSize = 0
TreeFontWeightOffset = 0
TreeFontName = automatic
SmoothScroll = false
ShowStartPage = true
CheckForUpdates = true
WindowState = 2
WindowPos = 874 341 1180 1528
UseTabs = true
UseSysColors = false
CustomScreenDPI = 0

FileStates [
    [
        FilePath = C:\Users\LENOVO\Desktop\选课\附件22023-2024学年第二学期通识教育选修课程简介(线下类+慕课类)2023级适用.pdf
        Favorites [
        ]
        IsPinned = false
        IsMissing = false
        OpenCount = 4
        UseDefaultState = false
        DisplayMode = continuous
        ScrollPos = -1 47.8627
        PageNo = 60
        Zoom = fit page
        Rotation = 0
        WindowState = 2
        WindowPos = 874 341 1180 1528
        ShowToc = true
        SidebarDx = 289
        DisplayR2L = false
        ReparseIdx = 0
    ]
]
SessionData [
    [
        TabStates [
            [
                FilePath = C:\Users\LENOVO\Desktop\选课\附件22023-2024学年第二学期通识教育选修课程简介(线下类+慕课类)2023级适用.pdf
                DisplayMode = continuous
                PageNo = 60
                Zoom = fit page
                Rotation = 0
                ScrollPos = -1 47.8627
                ShowToc = true
            ]
        ]
        TabIndex = 2
        WindowState = 2
        WindowPos = 874 341 1180 1528
        SidebarDx = 289
    ]
]
TimeOfLastUpdateCheck = 0 0
OpenCountWeek = 680

# Settings below are not recognized by the current version

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 创建了问题 1月18日

悬赏问题

  • ¥15 这个如何解决详细步骤
  • ¥15 在微信h5支付申请中,别人给钱就能用我的软件,这个的所属行业是啥?
  • ¥30 靶向捕获探针设计软件包
  • ¥15 react-diff-viewer组件,如何解决数据量过大卡顿问题
  • ¥20 遥感植被物候指数空间分布图制作
  • ¥15 安装了xlrd库但是import不了…
  • ¥20 Github上传代码没有contribution和activity记录
  • ¥20 SNETCracker
  • ¥15 数学建模大赛交通流量控制
  • ¥15 为什么我安装了open3d但是在调用的时候没有报错但是什么都没有发生呢