VScode 下 Latex 编译时,Log Messages中出现:" BUILD command invoked. " " Cannot find LaTeX root file. "

问题

最近安装好了 VScode + Texlive 2019 环境,按照网上的博客设置好了settings.json文件,但是点击"Build LaTex project" 准备进行编译,此时会在 Log Messages 出现 " BUILD command invoked. " " Cannot find LaTeX root file. " 两行信息,且编译也没有反应。

解决

经过多次折腾,发现这里是一个神奇的Bug…
VScode 下 Latex 编译时,Log Messages中出现:
这里只要是点了"View Log Messages",保持下方的输出窗口打开,就会出现上面的问题;而关掉这个窗口,即可正常编译…

PS:这里使用的 settings.json 配置如下:

{
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.autoClean.run": "onBuilt",
    "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",
      "*.gz"
      ],
      "latex-workshop.latex.recipes": [
        {
          "name": "xelatex",
          "tools": [
            "xelatex"
          ]
        },
        {
          "name": "xelatex -> bibtex -> xelatex*2",
          "tools": [
            "xelatex",
            "bibtex",
            "xelatex",
            "xelatex"
          ]
        }
      ],
      "latex-workshop.latex.tools": [
        {
          "name": "latexmk",
          "command": "latexmk",
          "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOC%"
          ]
        },
        {
          "name": "xelatex",
          "command": "xelatex",
          "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
          ]
        },
        {
          "name": "bibtex",
          "command": "bibtex",
          "args": [
            "%DOCFILE%"
          ]
        }
      ],
      "latex-preview.command": "xelatex"
}

你可能感兴趣的:(VScode 下 Latex 编译时,Log Messages中出现:" BUILD command invoked. " " Cannot find LaTeX root file. ")