Author image Simeon Warner


arXiv::FileGuess - Central file type determination for arXiv


Central file type identification for

Much of this should probably be replaced with the file program with externally maintained magic information. However, we need here to support a number of cases special to arXiv and to make some rather fine-grained determinations of TeX related file formats, along with determination of the order in which they should be processed.



A hash of type names which represent TeX types (i.e. should be processed with AutoTeX). Accessed via function is_tex_type().


A display name indexed by type. Accessed via function type_name().



Guess the file type $filename. Returns ($type, $tex_format, $error), all of which are strings. The $type may be supplied to is_tex_type($type) or type_name($type) for additional information related to the file type.

For most files $tex_format and $error will be undefined. $tex_format will be defined for some TeX file formats where there is additional information about the type of TeX.


Returns true (1) if the type name supplied is a TeX type, false ('') otherwise.


Returns display string for the type $type. Or 'unknown' if $type is not recognized.