minted
minted copied to clipboard
Mint fails when file name contains with '#' on macOS
The name of my tex file is Problem Set #1.tex
.
And when compiling this tex file, it comes an error saying that ifplatform.sty:93: ! Package catchfile Error: File 'Problem Set #1.w18' not found.
Ref: https://github.com/gpoore/minted/issues/85
Have you tried renaming the file to Problem Set 1.tex
to make sure that the #
is the problem? I don't have access to an OS X machine, but a #
in the filename is working fine for me under Windows and Linux.
What TeX distribution are you using? How old is your installation?
Yes. I've tried to rename this file to Problem Set 1.tex
or other filename exclude symbol #
and all of these filename will not cause any build error. When it comes to having the symbol #
in the filename, the compile process crashes.
And finding that there are two different error behaviors.
- filename =
#.tex
:./#.tex:140: Package minted Error: You must have 'pygmentize' installed to use this package.
- filename =
Problem Set #1.tex
:/usr/local/texlive/2017/texmf-dist/tex/latex/ifplatform/ifplatform.sty:93: Package catchfile Error: File '"Problem Set #1".w18' not found.
My LaTeX environment, and TexLive is newly installed (it should be the latest version):
$ /usr/local/texlive/2017/bin/x86_64-darwin/pdflatex --version [10:16:46]
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04
The file name #.tex
always gives fatal errors under Linux. The file name file #1.tex
was actually giving errors, but compiling could still complete under Linux.
This is due to a combination of issues. The best option for now is avoiding #
in file names.
- If the file name starts with
#
, the test forpygmentize
fails, andpygmentize
itself will fail. This could be fixed by further sanitization of\minted@jobname
. - If the file name contains
#
but doesn't start with#
, and also contains a space, then thecatchfile
package appears to be running incorrectly quoted system commands. It is possible to work around this by redefining\jobname
whilecatchfile
is being used to detect the operating system.
The changes required to get #
working involve a number of changes in how minted
works, and I will have to think through all the implications. Because of that, it probably won't be possible to get #
working in the near future.