-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
using absolute paths on windows doesn't work
To reproduce
Set the PDFVIEWER environment variable to an absolute path like C:\Program Files\SumatraPDF\SumatraPDF.exe
and
run the following in powershell
echo $env:PDFVIEWER
texdoc latexget output
C:\Program Files\SumatraPDF\SumatraPDF.exe
'C' is not recognized as an internal or external command,
operable program or batch file.
texdoc error: Failed to execute: C "c:\texlive\2024\texmf-dist\doc\latex\latex-doc-ptr\latex-doc-ptr.pdf"Additional info
See the code below
texdoc/script/texdoclib-config.tlu
Lines 228 to 240 in b62d3af
| -- viewers | |
| local function set_config_viewer_from_vars(key, vars) | |
| for _, var in ipairs(vars) do | |
| local value = os.getenv(var) | |
| -- support colon-separated list | |
| value = value and string.gmatch(value, '([^:]+)')() | |
| if value then | |
| set_config_element(key, value, {src='env', name=var}) | |
| end | |
| end | |
| end |
value = value and string.gmatch(value, '([^:]+)')() only works for unix and not windows.
If on windows (not wsl) value = value and string.gmatch(value, '([^;]+)')() / ; should be used instead.
Workaround
set PDFVIEWER=sumatrapdf and add C:\Program Files\SumatraPDF to PATH environment variable.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working