Which characters may appear in filenames that are included (\include)?
Are hyphens and underscores okay? Is there a dependence on the underlying filesystem or encoding of the LaTeX source that does the including? Are only ASCII characters allowed?
Which characters may appear in filenames that are included (\include)?
Are hyphens and underscores okay? Is there a dependence on the underlying filesystem or encoding of the LaTeX source that does the including? Are only ASCII characters allowed?
The filename syntax is one of the few explicitly system-dependent parts of TeX. web2c based TeX systems allow most characters allowed by the filesystem. (For example spaces are allowed if you surround the entire path with " quotes).
Note that LaTeX for example does not assume that the extension (to a base name) is formed by appending . with the extension. Some systems did not allow such names and the file usually known as article.cls might be article in a directory cls or [cls]article or any of various other syntactic possibilities. The file textsys.cfg is read at format-making time and by default automatically determines these:
This file contains the site specific definitions of the four macros\\
|\@currdir|, |\input@path|, |\filename@parse| and |\@TeXversion|.
But may be defined locally to be anything appropriate to the system.
Note that special characters may need special handling in order to be passed to the file name reader. For example the character ~ is allowed but LaTeX typically gives this a definition that expands to \nobreakspace{} which isn't the intended interpretation in a file name. \string~ works though. See this question for instructions on how to deal with spaces in filenames. Similar issues relate to non ascii characters. If using classic TeX (rather than xetex/luatex) 8bit characters will be given active definitions designed for typesetting rather than using as filename strings. Also the file system may be using utf8 or may be using a local code page and LaTeX probably doesn't really know which (the underlying file IO of the web2c system presumably knows but TeX macros can't access that) so again you may have to use the input "verbatim" using \string or some equivalent quoting method in order to pass bytes directly to the underlying filename reader. It all depends...
\usepackage[encoding]{inputenc}). Do correct me if I'm wrong.
– Lover of Structure
Jun 11 '12 at 00:38
\'e (and it's doubtful that from a modern perspective \'e should be regarded as a normal form. Thanks for your information, of course!
– Lover of Structure
Jun 13 '12 at 19:01
[a-z][A-Z][0-9],-and_and limited use(often only one) of.– hpekristiansen Jun 10 '12 at 23:42