What characters can be used in filenames for the main document and input files, both .tex and images etc.? I'm not asking about which are recommended to be used, but about a list of all possible characters a user could ever use in a filename. This is important to know in order to support those in filename related packages (e.g. currfile, svn-multi, ...).
I can see two use cases here:
- On the command line, e.g. using
pdflatex <filename>.
Which might require single-quotes and/or\to escape characters special to the command line shell, but then maybe again for TeX. - Inside (La)TeX itself, e.g.
\input{<filename>}.
For example: The use of % in (main document) filenames seems not possible with LaTeX using TeXLive 2011 under Linux. A pdflatex 'test%it.tex' results in a prompt and entering \relax there gives: ! I can't find file `test'.. So the % is also used as comment character in this case.
There seems to be more going on with filenames on the command line because I got the following warning:
# pdflatex 'test$it*gdg!£$^&%_*(){.tex'
warning: test$it*gdg!£$^&%_*(){.tex: Unrecognized variable construct `$^'.
.texand image files, that are otherwise acceptable to the operating system?" I think there's little point in exploring characters that the operating system itself doesn't allow (e.g.,/,\, and?) for valid names of files, right? – Mico Apr 28 '12 at 12:02/and\however can be part of the "filename" if you include the path, which we should. Also?is valid for filenames under Linux, you just have to make sure it is masked and not taken as wildcard, e.g.'test?it'ortest\?it. – Martin Scharrer Apr 28 '12 at 13:21