Closed gpoore closed 5 days ago
I would add that this problem also occurs under Windows if the filename in braces is not quoted. The error information is
Package minted Error: Missing Pygments output; \inputminted was
probably given a file that does not exist--otherwise, you may need
the outputdir package option, or may be using an incompatible build tool,
or may be using frozencache with a missing file.
Alternatives may involve patching
ifplatform.sty
or using a different approach to OS detection.
The expl3
programming environment provides \sys_if_platform_windows:TF {<true code>} {<false code>}
and similar functions. See one possible emulation in https://github.com/wspr/will2e/issues/12#issuecomment-1724524879.
This entire class of issues is eliminated in minted
v3.0, which is available as a beta on GitHub and will have a final release soon.
See https://github.com/gpoore/minted/issues/85#issuecomment-669696829 for original source.
Using filenames with spaces under Linux without
outputdir
seems to work fine (produces a correct PDF), but givescatchfile
errors. Using outputdir paths with spaces withoutputdir
fails without producing a PDF. Some of this seems to involveifplatform.sty
running\ShellEsc
around line 94, and quoting a path that is already quoted.outputdir
doesn't auto-quote, so it requires manual quoting, andifplatform.sty
assumes no quoting. The manual quoting approach is what allows~
expansion to work.Windows is different. When there are spaces in the output directory path,
outputdir
needs to be quoted. When that is used with-file-line-error
or-recorder
, compilation fails. This is due to some operation that strips spaces from filenames.It may be impossible to have a solution that works with
ifplatform.sty
(assumes no quoting under Linux, wraps with quotes) while also allowing~
expansion. Alternatives may involve patchingifplatform.sty
or using a different approach to OS detection.