James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.77k stars 535 forks source link

PDF Viewer not updating after compilation #3798

Closed Vithanco closed 1 year ago

Vithanco commented 1 year ago

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • [*] The issue has not been reported in this repository. (reviewed quite a bit)
  • [* ] The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • [*] The FAQ cannot address the issue. there is a potentially relevant section in the TOC, but missing further down https://github.com/James-Yu/LaTeX-Workshop/wiki/FAQ#the-internal-pdf-viewer-is-not-updated
  • [*] The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: MacOS 13.2.1
  • Visual Studio Code Version: 1.76.2 (Universal)
  • LaTeX Workshop Version: 9.8.1
  • TeX Distribution Version: TeXLive 2023

The Issue*

internal pdf viewer doesn't update after a rerun of latexmk

Reproduction Steps

  1. open pdf viewer with option-cmd-V
  2. change latex text
  3. save file, watch console to run latexmk compilation

Expected Behavior

pdf to be updated

Logs

LaTeX Workshop Output*

(cleaned before reproduction)

[19:51:12][Format][TeX] Start formatting with latexindent.
[19:51:12][Format][TeX] Formatting LaTeX. The command is latexindent:["-c","%WS1%/","%WS1%/__latexindent_temp_ConceptMaps.tex","-y=defaultIndent: '  '"].
[19:51:13][Format][TeX] Formatted %WS1%/ConceptMaps.tex
[19:51:13][Extension] onDidSaveTextDocument triggered: file://%WS1%/ConceptMaps.tex
[19:51:13][Cacher][Watcher] "change" emitted on %WS1%/ConceptMaps.tex .
[19:51:13][Cacher] Caching %WS1%/ConceptMaps.tex .
[19:51:13][Cacher] Updated inputs of %WS1%/ConceptMaps.tex .
[19:51:13][Builder] Auto build started detecting the change of a file: %WS1%/ConceptMaps.tex .
[19:51:13][Commander] BUILD command invoked.
[19:51:13][Commander] The document of the active editor: file://%WS1%/ConceptMaps.tex
[19:51:13][Commander] The languageId of the document: latex
[19:51:13][Commander] Building root file: %WS1%/AlignPeopleMethod.tex
[19:51:13][Builder] Build root file %WS1%/AlignPeopleMethod.tex
[19:51:13][Builder] outDir: %WS1% .
[19:51:13][Builder] Preparing to run recipe: latexmk.
[19:51:13][Builder] Prepared 1 tools.
[19:51:13][DupLabel] Checking for duplicate labels: %WS1%/ConceptMaps.tex .
[19:51:13][Cacher] Updated elements of %WS1%/ConceptMaps.tex .
[19:51:13][Cacher] Updated bibs of %WS1%/ConceptMaps.tex .
[19:51:13][Cacher] Cached %WS1%/ConceptMaps.tex .
[19:51:13][Structure] Structure force updated with 5 root sections for %WS1%/AlignPeopleMethod.tex .
[19:51:15][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 1007 ms.

Developer Tools Console

Again, I cleaned the console before. It didn't seem to produce any new output

Anything Else?

no.

Vithanco commented 1 year ago

Settings.json:

{
    "editor.formatOnSave": true,
    "tabnine.experimentalAutoImports": true,
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "eslint.alwaysShowStatus": true,
    "eslint.codeAction.showDocumentation": {},
    "eslint.format.enable": true,
    "eslint.lintTask.enable": true,
    "git.enableSmartCommit": true,
    "files.trimTrailingWhitespace": true,
    "pretty-formatter.forceIndent": true,
    "pretty-formatter.indentLevel": 2,
    "editor.wrappingIndent": "indent",
    "editor.tabSize": 2,
    "files.autoSave": "onFocusChange",
    "git.autofetch": true,
    "javascript.preferences.quoteStyle": "single",
    "typescript.preferences.quoteStyle": "single",
    "pretty-formatter.quoteConvert": "single",
    "html.completion.attributeDefaultValue": "singlequotes",
    "editor.formatOnType": true,
    "javascript.format.insertSpaceAfterConstructor": true,
    "typescript.format.insertSpaceAfterConstructor": true,
    "typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": true,
    "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
    "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
    "typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
    "typescript.format.insertSpaceAfterTypeAssertion": true,
    "typescript.format.insertSpaceBeforeFunctionParenthesis": true,
    "less.format.spaceAroundSelectorSeparator": true,
    "scss.format.spaceAroundSelectorSeparator": true,
    "pretty-formatter.correct": true,
    "pretty-formatter.functionName": true,
    "javascript.format.semicolons": "remove",
    "javascript.inlayHints.enumMemberValues.enabled": true,
    "javascript.inlayHints.functionLikeReturnTypes.enabled": true,
    "javascript.inlayHints.parameterNames.enabled": "all",
    "javascript.inlayHints.parameterTypes.enabled": true,
    "javascript.inlayHints.propertyDeclarationTypes.enabled": true,
    "javascript.inlayHints.variableTypes.enabled": true,
    "javascript.referencesCodeLens.enabled": true,
    "javascript.referencesCodeLens.showOnAllFunctions": true,
    "javascript.suggest.completeFunctionCalls": true,
    "eslint.run": "onSave",
    "eslint.useESLintClass": true,
    "editor.guides.highlightActiveBracketPair": false,
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    "git.confirmSync": false,
    "[html]": {
        "editor.defaultFormatter": "vscode.html-language-features"
    },
    "workbench.colorTheme": "Default Light+",
    "gitlens.defaultDateLocale": null,
    "gitlens.defaultDateFormat": "Do MMMM, YYYY",
    "typescript.implementationsCodeLens.enabled": true,
    "gitlens.gitCommands.skipConfirmations": [
        "fetch:command",
        "stash-push:command",
        "switch:command",
        "push:command"
    ],
    "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
    "editor.autoClosingOvertype": "never",
    "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
    "editor.autoClosingDelete": "never",
    "vitest.enable": true,
    "javascript.preferences.importModuleSpecifier": "relative",
    "typescript.preferences.importModuleSpecifier": "relative",
    "typescript.tsserver.watchOptions": {},
    "css.lint.duplicateProperties": "warning",
    "css.lint.float": "warning",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "editor.autoClosingBrackets": "never",
    "editor.inlineSuggest.enabled": true,
    "[css]": {
        "editor.defaultFormatter": "michelemelluso.code-beautifier"
    },
    "[typescript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "editor.wordWrap": "on",
    "editor.minimap.enabled": false,
    "grammarly.files.include": [
        "**/readme.md",
        "**/README.md",
        "**/*.txt",
        "**/*.tex"
    ],
    "grammarly.config.documentDialect": "british",
    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-pvc",
                "-outdir=%DIR%",
                "-aux-directory=%DIR%",
                "-view=pdf",
                "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "lualatexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-lualatex",
                "-outdir=%OUTDIR%",
                "-aux-directory=%DIR%",
                "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "xelatexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-xelatex",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "latexmk_rconly",
            "command": "latexmk",
            "args": [
                "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ],
            "env": {}
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ],
            "env": {}
        },
        {
            "name": "rnw2tex",
            "command": "Rscript",
            "args": [
                "-e",
                "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
            ],
            "env": {}
        },
        {
            "name": "jnw2tex",
            "command": "julia",
            "args": [
                "-e",
                "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
            ],
            "env": {}
        },
        {
            "name": "jnw2texminted",
            "command": "julia",
            "args": [
                "-e",
                "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
            ],
            "env": {}
        },
        {
            "name": "pnw2tex",
            "command": "pweave",
            "args": [
                "-f",
                "tex",
                "%DOC_EXT%"
            ],
            "env": {}
        },
        {
            "name": "pnw2texminted",
            "command": "pweave",
            "args": [
                "-f",
                "texminted",
                "%DOC_EXT%"
            ],
            "env": {}
        },
        {
            "name": "tectonic",
            "command": "tectonic",
            "args": [
                "--synctex",
                "--keep-logs",
                "%DOC%.tex"
            ],
            "env": {}
        }
    ],
    "latex-workshop.viewer.pdf.internal.port": 0,
    "latex-workshop.latex.recipes": [
        {
            "name": "latexmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "latexmk (latexmkrc)",
            "tools": [
                "latexmk_rconly"
            ]
        },
        {
            "name": "latexmk (lualatex)",
            "tools": [
                "lualatexmk"
            ]
        },
        {
            "name": "latexmk (xelatex)",
            "tools": [
                "xelatexmk"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex * 2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        },
        {
            "name": "Compile Rnw files",
            "tools": [
                "rnw2tex",
                "latexmk"
            ]
        },
        {
            "name": "Compile Jnw files",
            "tools": [
                "jnw2tex",
                "latexmk"
            ]
        },
        {
            "name": "Compile Pnw files",
            "tools": [
                "pnw2tex",
                "latexmk"
            ]
        },
        {
            "name": "tectonic",
            "tools": [
                "tectonic"
            ]
        }
    ],
    "latex-workshop.latex.clean.subfolder.enabled": true,
    "latex-workshop.latex.autoClean.run": "onSucceeded",
    "latex-workshop.latex.external.build.args": [
        "-pdf"
    ],
    "latex-workshop.view.pdf.ref.viewer": "tabOrBrowser",
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.view.pdf.zoom": "page-fit",
    "latex-workshop.latex.autoBuild.cleanAndRetry.enabled": true,
    "latex-workshop.latex.watch.pdf.delay": 500,
    "json.schemas": [],
}
jlelong commented 1 year ago

Can you try to increase latex-workshop.latex.watch.pdf.delay? You need to reload VS Code to make any change effective. See https://github.com/James-Yu/LaTeX-Workshop/wiki/View#latex-workshoplatexwatchpdfdelay

Vithanco commented 1 year ago

I moved it up to 3000, but to no avail. Only change is that the last message is now: [24:40:20][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 6006 ms.

On Sun, Mar 26, 2023 at 10:31 PM Jerome Lelong @.***> wrote:

Can you try to increase latex-workshop.latex.watch.pdf.delay? You need to reload VS Code to make any change effective. See https://github.com/James-Yu/LaTeX-Workshop/wiki/View#latex-workshoplatexwatchpdfdelay

— Reply to this email directly, view it on GitHub https://github.com/James-Yu/LaTeX-Workshop/issues/3798#issuecomment-1484214550, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFOMG3WM3JVNHACIRH3FTW6CYR7ANCNFSM6AAAAAAWIKC2YY . You are receiving this because you authored the thread.Message ID: @.***>

-- Klaus Kneupner http://www.kneupner.de "Denn von allen Gedanken, schätz' ich doch am meisten, die interessanten" Die Sterne

James-Yu commented 1 year ago

It seems that your log is not complete: the build process is not finished. Can you please provide a complete log?

Vithanco commented 1 year ago

The complete log was: [24:45:22][Format][TeX] Start formatting with latexindent. [24:45:22][Format][TeX] Formatting LaTeX. The command is latexindent:["-c","%WS1%/","%WS1%/__latexindent_temp_ConceptMaps.tex","-y=defaultIndent: ' '"]. [24:45:23][Format][TeX] Formatted %WS1%/ConceptMaps.tex [24:45:23][Extension] onDidSaveTextDocument triggered: file://%WS1%/ConceptMaps.tex [24:45:23][Cacher][Watcher] "change" emitted on %WS1%/ConceptMaps.tex . [24:45:23][Cacher] Caching %WS1%/ConceptMaps.tex . [24:45:23][Cacher] Updated inputs of %WS1%/ConceptMaps.tex . [24:45:23][Builder] Auto build started detecting the change of a file: %WS1%/ConceptMaps.tex . [24:45:23][Commander] BUILD command invoked. [24:45:23][Commander] The document of the active editor: file://%WS1%/ConceptMaps.tex [24:45:23][Commander] The languageId of the document: latex [24:45:23][Commander] Building root file: %WS1%/AlignPeopleMethod.tex [24:45:23][Builder] Build root file %WS1%/AlignPeopleMethod.tex [24:45:23][Builder] outDir: %WS1% . [24:45:23][Builder] Preparing to run recipe: latexmk. [24:45:23][Builder] Prepared 1 tools. [24:45:23][DupLabel] Checking for duplicate labels: %WS1%/ConceptMaps.tex . [24:45:23][Cacher] Updated elements of %WS1%/ConceptMaps.tex . [24:45:23][Cacher] Updated bibs of %WS1%/ConceptMaps.tex . [24:45:23][Cacher] Cached %WS1%/ConceptMaps.tex . [24:45:23][Structure] Structure force updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [24:45:23][Structure] Structure updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [24:45:34][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 9009 ms.

On Mon, Mar 27, 2023 at 4:32 AM James Yu @.***> wrote:

It seems that your log is not complete: the build process is not finished. Can you please provide a complete log?

— Reply to this email directly, view it on GitHub https://github.com/James-Yu/LaTeX-Workshop/issues/3798#issuecomment-1484394174, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFOMGTFXU6LHO3U5FUJUTW6D33FANCNFSM6AAAAAAWIKC2YY . You are receiving this because you authored the thread.Message ID: @.***>

-- Klaus Kneupner http://www.kneupner.de "Denn von allen Gedanken, schätz' ich doch am meisten, die interessanten" Die Sterne

James-Yu commented 1 year ago

No, it's still not complete. Build ends with Finished a step or Successfully built document or any other error messages.

Vithanco commented 1 year ago

Thanks for your great support and your patience!

This is what happened after:

[24:45:23][Cacher] Cached %WS1%/ConceptMaps.tex . [24:45:23][Structure] Structure force updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [24:45:23][Structure] Structure updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [24:45:34][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 9009 ms. [01:06:20][Viewer] Handle data type: open [01:06:20][Viewer] Handle data type: open [05:31:01][Commander] CITATION command invoked. [05:31:14][Format][Bib] Exit formatting. The active textEditor is not of bibtex type. [05:31:15][Format][Bib] Exit formatting. The active textEditor is not of bibtex type.

Another example from this morning. I started looking at the PDF (manually opened). It ends with the next compilation ~10 secs after the previous one finished.

[05:58:00][Viewer] Open PDF tab for file://%WS1%/AlignPeopleMethod.pdf [05:58:00][Viewer] Handle data type: open [05:58:00][Server] Preview PDF file: file://%WS1%/AlignPeopleMethod.pdf [05:58:00][Viewer] Handle data type: loaded [05:58:06][Commander] GOTOSECTION command invoked. Target %WS1%/ConceptMaps.tex, line 127 [05:58:14][Commander] GOTOSECTION command invoked. Target %WS1%/ConceptMaps.tex, line 88 [05:58:29][Format][TeX] Start formatting with latexindent. [05:58:29][Format][TeX] Formatting LaTeX. The command is latexindent:["-c","%WS1%/","%WS1%/latexindent_temp_ConceptMaps.tex","-y=defaultIndent: ' '"]. [05:58:29][Commander] GOTOSECTION command invoked. Target %WS1%/ConceptMaps.tex, line 127 [05:58:29][Extension] onDidSaveTextDocument triggered: file://%WS1%/ConceptMaps.tex [05:58:29][Cacher][Watcher] "change" emitted on %WS1%/ConceptMaps.tex . [05:58:29][Cacher] Caching %WS1%/ConceptMaps.tex . [05:58:29][Cacher] Updated inputs of %WS1%/ConceptMaps.tex . [05:58:29][Builder] Auto build started detecting the change of a file: %WS1%/ConceptMaps.tex . [05:58:29][Commander] BUILD command invoked. [05:58:29][Commander] The document of the active editor: file://%WS1%/ConceptMaps.tex [05:58:29][Commander] The languageId of the document: latex [05:58:29][Commander] Building root file: %WS1%/AlignPeopleMethod.tex [05:58:29][Builder] Build root file %WS1%/AlignPeopleMethod.tex [05:58:29][Builder] outDir: %WS1% . [05:58:29][Builder] Preparing to run recipe: latexmk. [05:58:29][Builder] Prepared 1 tools. [05:58:29][DupLabel] Checking for duplicate labels: %WS1%/ConceptMaps.tex . [05:58:29][Cacher] Updated elements of %WS1%/ConceptMaps.tex . [05:58:29][Cacher] Updated bibs of %WS1%/ConceptMaps.tex . [05:58:29][Cacher] Cached %WS1%/ConceptMaps.tex . [05:58:29][Structure] Structure force updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [05:58:29][Format][TeX] Formatted %WS1%/ConceptMaps.tex [05:58:29][Structure] Structure updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [05:58:36][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 6004 ms. [05:58:52][Format][TeX] Start formatting with latexindent. [05:58:52][Format][TeX] Formatting LaTeX. The command is latexindent:["-c","%WS1%/","%WS1%/latexindent_temp_ConceptMaps.tex","-y=defaultIndent: ' '"]. [05:58:53][Commander] GOTOSECTION command invoked. Target %WS1%/ConceptMaps.tex, line 195 [05:58:53][Extension] onDidSaveTextDocument triggered: file://%WS1%/ConceptMaps.tex [05:58:53][Format][TeX] Formatted %WS1%/ConceptMaps.tex [05:58:53][Cacher][Watcher] "change" emitted on %WS1%/ConceptMaps.tex . [05:58:53][Cacher] Caching %WS1%/ConceptMaps.tex . [05:58:53][Cacher] Updated inputs of %WS1%/ConceptMaps.tex . [05:58:53][Builder] Auto build started detecting the change of a file: %WS1%/ConceptMaps.tex . [05:58:53][Commander] BUILD command invoked. [05:58:53][Commander] The document of the active editor: file://%WS1%/ConceptMaps.tex [05:58:53][Commander] The languageId of the document: latex [05:58:53][Commander] Building root file: %WS1%/AlignPeopleMethod.tex [05:58:53][Builder] Build root file %WS1%/AlignPeopleMethod.tex [05:58:53][Builder] outDir: %WS1% . [05:58:53][Builder] Preparing to run recipe: latexmk. [05:58:53][Builder] Prepared 1 tools. [05:58:53][DupLabel] Checking for duplicate labels: %WS1%/ConceptMaps.tex . [05:58:53][Cacher] Updated elements of %WS1%/ConceptMaps.tex . [05:58:53][Cacher] Updated bibs of %WS1%/ConceptMaps.tex . [05:58:53][Cacher] Cached %WS1%/ConceptMaps.tex . [05:58:53][Structure] Structure force updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [05:58:53][Structure] Structure updated with 5 root sections for %WS1%/AlignPeopleMethod.tex . [05:58:59][Cacher][Watcher] "change" emitted on %WS1%/AlignPeopleMethod.pdf after polling for 6011 ms. [05:59:09][Format][TeX] Start formatting with latexindent.

On Mon, Mar 27, 2023 at 5:27 AM James Yu @.***> wrote:

No, it's still not complete. Build ends with Finished a step or Successfully built document or any other error messages.

— Reply to this email directly, view it on GitHub https://github.com/James-Yu/LaTeX-Workshop/issues/3798#issuecomment-1484428164, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFFOMCD3I6RQI3MLNWDDSLW6ECIRANCNFSM6AAAAAAWIKC2YY . You are receiving this because you authored the thread.Message ID: @.***>

-- Klaus Kneupner http://www.kneupner.de "Denn von allen Gedanken, schätz' ich doch am meisten, die interessanten" Die Sterne

James-Yu commented 1 year ago

Looks like your latexmk does not terminate. Therefore the viewer won't refresh.