# What formats do the file extensions in the TeX Live source tree denote

The TeX Live source tree is really huge. Is there an overview somehow somewhere of the meaning of all those file extensions? I mean e.g. in texlive/Master/texmf, there are 10 .sty, 18 .enc, 21 .tcx, 22 .map, 23 .tlu, 35 .cfg, 366 .asy and 425 .xdy files. I have no clue what kind of files these are.

All in all there are almost 1000 (!) different file extensions :-O http://sprunge.us/KDJh 1)

What do they all mean?

Clarification:

What list is 1) ?

texlive/Master\$  # a command is run in the TeX Live tree's root directory
find ...         # finds all files in this directory, omits the bin directory...
| sed .         # filters out everything except the filenames extensions
| sort          # sorts the list lexically
| uniq -c       # counts the number of duplicates of each line
| sort -nr      # sorts the resulting "list of counts" numerically reverse


-> The result is a list of file extensions ordered by their frequencies

-
Do you really mean the LaTeX source code? It seems like you're more interested in the whole TeX Live source tree, which is considerably larger and deals with much more things than LaTeX (whose source code is only 10 thousands lines of code, by the way). About the file extensions, over half of them are attached to only 1 or 2 files and clearly have very specific uses (like the ones for the Venturis fonts); that's not really meaningful. –  Arthur Reutenauer Jan 27 '11 at 11:47
Well, I mean TeX Live in that case. In addition it would be nice if somebody could explain where in the TeX Live source tree the LaTeX parts exactly are (directory?) and what parts of the TeX Live system the other directories hold and what those other parts are used for. :-) –  Patrick2000 Jan 27 '11 at 12:52
Is this a question? As it is worded now, it is not clear what are you expecting as an answer. –  Juan A. Navarro Jan 27 '11 at 13:34
@Patrick: LaTeX 2e is in the directory tex/latex/base. The other subdirectories of tex/latex contain third-party packages. –  Philipp Jan 27 '11 at 14:17
@Philip: Thanks, got it –  Patrick2000 Jan 27 '11 at 17:07
show 2 more comments

• .tfm: TeX Font Metrics, contains things like glyph widths or ligature information for many of the "older" fonts. "Newer" (OpenType etc.) fonts encode such information directly in the font files.
• .tex: Any TeX, LaTeX or ConTeXt source code, no inherent meaning. Often used for engine-independent modules.
• .vf: Virtual Fonts, re-mappings of existing "real" fonts that are presented to TeX as a distinct font. For example, you can use a virtual font that maps text figure glyphs to the digit characters. Again, that is unnecessary for OpenType fonts.
• .mf: Source files for Metafont
• .pfb: Type-1 fonts in binary format. These contain the glyph data for older fonts. Largely obsoleted by TrueType/OpenType/CFF/AAT, but still common in the TeX world.
• .pdf: Portable Document Format, usually manual files.
• .sty: LaTeX packages ("style files"). \usepackage{X} loads the file X.sty.
• .afm: Adobe Font Metrics
• .fd: Font Description files which map LaTeX font identification to TFM file names.
• .ltx: LaTeX documents and source files
• .pm: Perl Modules, used by tlmgr
• .dtx: Docstrip source files, contain documentation and source code of LaTeX packages
• .html: Hypertext Markup Language, mostly documentation
• .ins: Docstrip installer scripts, extract code files from .dtx files
• .txt: Text files, can be anything
• .pl: Perl scripts
• .def: Definition files, often used for implementing package options or default settings. In the LaTeX kernel they are used for defining font encodings in the NFSS. They would all look like t1enc.def, eu1enc.def, and so on.
• .map: Map files, contain information where font data can be found
• .enc: Font encoding files, map standard character names to glyph positions
• .png: Portable Network Graphics, for pictures
• .mp: MetaPost source files
• .asy: Asymptote modules and source files
• .xdy: Xindy (index processor) modules
• .otf: OpenType fonts, the standard font format
• .lua: Lua scripts and modules, used for LuaLaTeX and ConTeXt Mk IV
• .mkii: ConTeXt Mk II source files
• .cfg: Configuration files
• .bst: BibTeX style files
• .cls: LaTeX classes. \documentclass{X} loads file X.cls.
• .mkiv: ConTeXt Mk IV source files
• .bib: BiBTeX bibliographies
• .1: Man pages for section 1
• .fea: LuaTeX OpenType feature files
• .fdd: DocStrip source files for font description files
• .tlu is used for TeXLua scripts. There is no strict separation between .lua and .tlu, but the later is probably meant to emphasize the fact the the script is for TeXLua and not generic Lua (for example, it makes use of kpse or other specific libraries).
• .tcx files are translation files that can be used by most TeX engines based on the web2c (read: probably specific to TeX Live, ie. probably not in MikTeX). They allow TeX to transcode input and ouput (to terminal/log) on the fly. The default one, cp227.tcx doesn't translate anything but merely allows non-ascii characters to be printed on the terminal. See the web2c manual, section 4.4.2 for details.

Most files are in fact support files for legacy (non-OpenType/AAT) fonts. For one such font, you usually need several .tfm, .pfb, .vf, .fd, .enc and .map files, whereas for OpenType fonts one .otf file suffices. Another huge chunk is documentation.

-
Great! Exactly the kind of answer I was looking for. Lexical sorting I will do. .tcx and .tlu are still missing. I am trying to find them. Then, lets complete the answer if you don't mind. (I will post my sorted list on a pastebin. Thank you very much so far! –  Patrick2000 Jan 27 '11 at 18:00
@Philipp Here's the sorted and extended list - would be great if you could edit the answer but nevermind if you don't have the time. Thanks sprunge.us/PQGg And thanks again for the answer. –  Patrick2000 Jan 27 '11 at 18:10
@Philipp Yea, well - I see your list IS sorted. Sorry to bug you about this. .tcx and .tlu are relatively frequent in the texmf subdirectory only. –  Patrick2000 Jan 27 '11 at 18:14
@Patrick: I just went through the first few items of your original list and wrote a note about those that I've seen so far. I didn't write anything about .tcx and .tlu because I don't know what they're used for either :-) The directory texmf implies that they are part of the TeX Live infrastructure. –  Philipp Jan 27 '11 at 20:49
Aren't .def files used for defining font encodings in the NFSS? They would all look like t1enc.def, eu1enc.def, and so on. –  Will Robertson Jan 27 '11 at 22:06
show 5 more comments

You can aim first at understanding the standard TeX Directory Structure (TDS) by reading this tds article. The document explains where everything goes in a standard distribution and the rules for naming files and directories.

Almost all fonts are named using the Karl Berry naming scheme for fonts.

These publications would give you a good basic understanding of what is going where and most of the file name extensions. More esoteric file extensions come with utilities and packages.

-
+1, great links. –  Hendrik Vogt Jan 27 '11 at 17:27
Thanks a lot Yiannis, the "Tex Directory Structure" (tds) document is definitely very informative. Nice to know what the directory names mean as well. (I didn't imagine that texmf means tex+mf e.g. both, and not tex-mf, e.g. mf-part-of-tex.) –  Patrick2000 Jan 27 '11 at 17:30
@Hendrik Coming from you is a great compliment:) –  Yiannis Lazarides Jan 27 '11 at 19:29