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 latex
get 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
|
-- 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.
Description
using absolute paths on windows doesn't work
To reproduce
Set the
PDFVIEWERenvironment variable to an absolute path likeC:\Program Files\SumatraPDF\SumatraPDF.exeand
run the following in powershell
get output
Additional info
See the code below
texdoc/script/texdoclib-config.tlu
Lines 228 to 240 in b62d3af
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=sumatrapdfand addC:\Program Files\SumatraPDFto PATH environment variable.