James-Yu / LaTeX-Workshop

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

PDF won't open in tab, but will open in browser #3034

Closed akern40 closed 2 years ago

akern40 commented 2 years ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, restart VS Code, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

Describe the bug [Required]

When trying to view the generated PDF file in a VSCode Tab, the tab shows up as empty.

Debug Steps Attempted

  1. The PDF generates fine, and is visible when viewed in a browser with View LaTeX PDF file in web browser
  2. Problem persists with all extensions disabled
  3. Problem persists when VSCode is started with --disable-gpu

To Reproduce

Steps to reproduce the behavior:

  1. Create a new file in a new folder with a basic document such as
    
    \documentclass{article}

\begin{document} This is a test of \LaTeX. \end{document}

2. `Build LaTeX project`
3. `View LaTeX PDF file in VSCode tab`

### Expected behavior

A new VSCode tab should open showing the generated document.

## Logs

### LaTeX Workshop Output

(Anonymized for data protection)

[11:19:11] Initializing LaTeX Workshop. [11:19:11] Extension root: c:\Users\username.vscode\extensions\james-yu.latex-workshop-8.19.2 [11:19:11] $PATH: C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\bin;C:\ProgramData\Anaconda3\condabin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\HID Global\ActivClient;C:\Program Files\HID Global\ActivClient;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\MATLAB\R2020a\runtime\win64;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\hyper\app-3.0.2\resources\bin;C:\Users\username\AppData\Local\Programs\MiKTeX\miktex\bin\x64;C:\Users\username\AppData\Local\Programs\Julia\Julia-1.4.2\bin [11:19:11] $SHELL: undefined [11:19:11] latex-workshop.intellisense.update.aggressive.enabled: false [11:19:11] latex-workshop.intellisense.update.delay: 1000 [11:19:11] latex-workshop.latex.autoBuild.run: "onFileChange" [11:19:11] latex-workshop.latex.outDir: "%DIR%" [11:19:11] latex-workshop.latex.recipes: [{"name":"latexmk 🔃","tools":["latexmk"]},{"name":"latexmk (latexmkrc)","tools":["latexmk_rconly"]},{"name":"latexmk (lualatex)","tools":["lualatexmk"]},{"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":"tectonic","tools":["tectonic"]}] [11:19:11] latex-workshop.latex.tools: [{"name":"latexmk","command":"latexmk","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=%OUTDIR%","%DOC%"],"env":{}},{"name":"lualatexmk","command":"latexmk","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","-lualatex","-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":"jnw2texmintex","command":"julia","args":["-e","using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"],"env":{}},{"name":"tectonic","command":"tectonic","args":["--synctex","--keep-logs","%DOC%.tex"],"env":{}}] [11:19:11] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto" [11:19:11] Creating a new file watcher. [11:19:11] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}} [11:19:11] Creating PDF file watcher. [11:19:11] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{}} [11:19:11] Creating Bib file watcher. [11:19:11] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}} [11:19:11] pdflatex is provided by MiKTeX [11:19:11] [Server] Creating LaTeX Workshop http and websocket server. [11:19:11] LaTeX Workshop initialized. [11:19:11] Trigger characters for intellisense of LaTeX documents: ["\","{",",","(","["] [11:19:11] Bibtex format config: {"tab":" ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[]} [11:19:11] Current workspace folders: ["file:///c:/Users/username/test"] [11:19:11] Current workspaceRootDir: file:///c:/Users/username/test [11:19:11] Found root file from active editor: c:\Users\username\test\test.tex [11:19:11] Root file changed: from undefined to c:\Users\username\test\test.tex [11:19:11] Start to find all dependencies. [11:19:11] Root file languageId: latex [11:19:11] [Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":59028} [11:19:11] Reset file watcher. [11:19:11] Parsing a file and its subfiles: c:\Users\username\test\test.tex [11:19:11] Parse fls file. [11:19:11] Cannot find fls file: c:\Users\username\test\test.fls [11:19:11] Added to file watcher: c:\Users\username\test\test.tex [11:19:11] Snippet data loaded. [11:19:11] Checking for duplicate labels: c:\Users\username\test\test.tex. [11:19:13] Manager.fileWatcher.getWatched: {"c:\Users\username\test":["test.tex"]} [11:19:13] Manager.filesWatched: ["c:\Users\username\test\test.tex"] [11:19:27] VIEW command invoked with mode: tab. [11:19:27] Current workspace folders: ["file:///c:/Users/username/test"] [11:19:27] Current workspaceRootDir: file:///c:/Users/username/test [11:19:27] Found root file from active editor: c:\Users\username\test\test.tex [11:19:27] Keep using the same root file: c:\Users\username\test\test.tex [11:19:27] Cannot find PDF file c:\Users\username\test\test.pdf [11:19:29] Manager.fileWatcher.getWatched: {"c:\Users\username\test":["test.tex"]} [11:19:29] Manager.filesWatched: ["c:\Users\username\test\test.tex"] [11:19:38] BUILD command invoked. [11:19:38] The document of the active editor: file:///c%3A/Users/username/test/test.tex [11:19:38] The languageId of the document: latex [11:19:38] Current workspace folders: ["file:///c:/Users/username/test"] [11:19:38] Current workspaceRootDir: file:///c:/Users/username/test [11:19:38] Found root file from active editor: c:\Users\username\test\test.tex [11:19:38] Keep using the same root file: c:\Users\username\test\test.tex [11:19:38] Building root file: c:\Users\username\test\test.tex [11:19:38] Build root file c:\Users\username\test\test.tex [11:19:38] outDir: c:/Users/username/test [11:19:38] Recipe step 1: latexmk, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=c:/Users/username/test,c:/Users/username/test/test [11:19:38] Recipe step env: {} [11:19:38] cwd: c:\Users\username\test [11:19:38] LaTeX build process spawned. PID: 7832. [11:19:40] Manager.fileWatcher.getWatched: {"c:\Users\username\test":["test.tex"]} [11:19:40] Manager.filesWatched: ["c:\Users\username\test\test.tex"] [11:19:42] LaTeX log parsed with 0 messages. [11:19:42] Recipe of length 1 finished. PID: 7832. [11:19:42] Successfully built c:\Users\username\test\test.tex. [11:19:42] No PDF viewer connected for c:\Users\username\test\test.pdf [11:19:42] Parse fls file. [11:19:42] Fls file found: c:\Users\username\test\test.fls [11:19:42] Parse aux file: c:\Users\username\test\test.aux [11:19:46] VIEW command invoked with mode: tab. [11:19:46] Current workspace folders: ["file:///c:/Users/username/test"] [11:19:46] Current workspaceRootDir: file:///c:/Users/username/test [11:19:46] Found root file from active editor: c:\Users\username\test\test.tex [11:19:46] Keep using the same root file: c:\Users\username\test\test.tex [11:19:46] Serving PDF file at http://127.0.0.1:59028/viewer.html?file=pdf..YyUzQSU1Q1VzZXJzJTVDQUQyOTMyNSU1Q3Rlc3QlNUN0ZXN0LnBkZg [11:19:46] The encoded path is c:\Users\username\test\test.pdf [11:19:46] The internal PDF viewer url: http://127.0.0.1:59028/viewer.html?incode=1&file=pdf..YyUzQSU1Q1VzZXJzJTVDQUQyOTMyNSU1Q3Rlc3QlNUN0ZXN0LnBkZg [11:19:46] Open PDF tab for c:\Users\username\test\test.pdf [11:19:47] Current workspace folders: ["file:///c:/Users/username/test"] [11:19:47] Current workspaceRootDir: file:///c:/Users/username/test [11:19:47] Found root file from active editor: c:\Users\username\test\test.tex [11:19:47] Keep using the same root file: c:\Users\username\test\test.tex [11:19:48] Manager.fileWatcher.getWatched: {"c:\Users\username\test":["test.tex"]} [11:19:48] Manager.filesWatched: ["c:\Users\username\test\test.tex"] [11:19:49] Manager.fileWatcher.getWatched: {"c:\Users\username\test":["test.tex"]} [11:19:49] Manager.filesWatched: ["c:\Users\username\test\test.tex"] [11:20:02] LOG command invoked: default


### Developer Tools Console [Required]

abstractExtensionService.ts:840 Extension 'ms-toolsai.jupyter cannot use PROPOSED API (must started out of dev or enabled via --enable-proposed-api) updateEnableProposedApi @ abstractExtensionService.ts:829 _checkEnableProposedApi @ abstractExtensionService.ts:539 _checkEnabledAndProposedAPI @ abstractExtensionService.ts:539 _scanAndHandleExtensions @ extensionService.ts:276 async function (async) _scanAndHandleExtensions @ extensionService.ts:276 _initialize @ abstractExtensionService.ts:390 (anonymous) @ abstractExtensionService.ts:804 requestIdleCallback (async) t.runWhenIdle @ async.ts:786 (anonymous) @ abstractExtensionService.ts:804 Promise.then (async) F @ abstractExtensionService.ts:804 _createInstance @ instantiationService.ts:73 _createServiceInstance @ instantiationService.ts:192 _createServiceInstanceWithOwner @ instantiationService.ts:192 _createAndCacheServiceInstance @ instantiationService.ts:192 _getOrCreateServiceInstance @ instantiationService.ts:124 get @ serviceCollection.ts:29 initLayout @ layout.ts:222 (anonymous) @ workbench.ts:70 invokeFunction @ serviceCollection.ts:29 startup @ workbench.ts:70 open @ desktop.main.ts:89 async function (async) open @ desktop.main.ts:89 t.main @ desktop.main.ts:429 (anonymous) @ workbench.js:9 (anonymous) @ bootstrap-window.js:128 async function (async) (anonymous) @ bootstrap-window.js:128 t._invokeFactory @ loader.js:1060 t.complete @ loader.js:1122 s._onModuleComplete @ loader.js:1700 s._onModuleComplete @ loader.js:1700 s._resolve @ loader.js:1700 s.defineModule @ loader.js:1345 n @ loader.js:1766 c @ loader.js:802 (anonymous) @ workbench.common.main.ts:138 (anonymous) @ workbench.common.main.ts:138 t._createAndEvalScript @ loader.js:802 (anonymous) @ loader.js:802 u @ loader.js:900 (anonymous) @ loader.js:900 readFileAfterClose @ internal/fs/read_file_context.js:61 localProcessExtensionHost.ts:257 Extension Host localProcessExtensionHost.ts:258 [0103/112303.369:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2) localProcessExtensionHost.ts:257 Extension Host localProcessExtensionHost.ts:258 [0103/112305.079:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2) [0103/112305.091:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2) [0103/112305.103:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2) [0103/112305.110:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2) [Violation] Forced reflow while executing JavaScript took 34ms



## Screenshots

![image](https://user-images.githubusercontent.com/24760729/147952993-b7040171-f606-44d0-bf73-e60c26564c61.png)

## Desktop [Required]

 - OS: Windows 10 Enterprise, OS Build 19042.985
 - VS Code version: 1.52.1
 - Extension version: v8.19.2
 - TeX distribution version: MiKTeX 21.12.10

## Additional questions

### Are you using VSCodium?

No

### Are you using the Snap or Flatpack versions of VS Code?

No

### Are you using LaTeX Workshop with VS Code Remote?

No
jlelong commented 2 years ago

VS Code version: 1.52.1 Extension version: v8.19.2

You are using very old versions of both VS Code and LaTeX-Workshop. Please update both VS Code to 1.63.2 (or at least 1.62.0) and the LaTeX-Workshop extension to 8.23.0.

akern40 commented 2 years ago

Yep that did it, sorry for the open issue, I appreciate the help!