Overview
The TeX Directory Structure (TDS) is a standardized layout for organizing the files that constitute a TeX system—such as macro packages, font files, documentation, and binary executables. By defining a consistent hierarchy of directories, TDS enables portable installation, distribution, and maintenance of TeX software across different operating systems and TeX distributions (e.g., TeX Live, MiKTeX, MacTeX).
Purpose
The principal goals of TDS are to:
- Separate user‑maintained and system‑wide files, reducing the risk of accidental overwriting.
- Allow package managers and installers to locate resources predictably.
- Facilitate sharing of TeX material between diverse platforms without modification of path names.
Historical Background
The TDS specification was first published by the TeX Users Group (TUG) in the mid‑1990s as a response to the fragmented file‑system conventions that had evolved among early TeX installations. The initial document, “The TeX Directory Structure (TDS)”, was released in 1995 and has undergone minor revisions to accommodate new file types and operating‑system conventions. Its development involved contributions from major TeX maintainers and distribution developers.
Key Directory Levels
The TDS hierarchy is rooted at a top‑level directory (commonly named texmf or texmf-dist). Under this root, the principal sub‑directories are:
tex/– Macro packages, class files, and plain TeX files.fonts/– Font files, further subdivided intotfm/,type1/,opentype/, etc.doc/– Documentation, typically in PDF, DVI, or plain‑text format.source/– Source code for packages and fonts, often in.dtx/.insform.bibtex/– Bibliography styles and database files.scripts/– Utility scripts (e.g., Perl, Python) used by TeX tools.config/– Configuration files for the TeX engine and related utilities.
Within each of these, further sub‑directories follow conventions that reflect the package name, version, or format (e.g., tex/latex/graphicx/, fonts/tfm/public/cm/).
User vs. System Trees
Modern TeX distributions commonly maintain separate “system” and “user” trees:
- System tree – Populated by the distribution’s package manager; files are shared by all users on the host.
- User tree – Located in a user’s home directory (e.g.,
~/texmf/on Unix‑like systems); intended for personal additions that override or augment system files without requiring administrator privileges.
The TDS specification defines the search order that TeX engines follow, typically checking the user tree first and then the system tree.
Adoption and Influence
All major TeX distributions adopt TDS as their default file‑system layout:
- TeX Live – Implements the structure under
texmf-dist/(system) and~/texmf/(user). - MiKTeX – Uses a similar hierarchy, with configuration files directing the engine to the appropriate TDS‑compliant paths.
- MacTeX – Provides the TDS layout within the bundled
TeXLive/directory structure on macOS.
Package authors are encouraged to package their material according to TDS, facilitating automated installation via package managers such as tlmgr (TeX Live) or MiKTeX’s package manager.
Compatibility and Extensions
While the core TDS guidelines are stable, extensions have emerged to address new file types (e.g., OpenType fonts, LuaTeX modules). The specification permits optional directories, provided they do not conflict with existing paths. Compatibility layers in TeX engines allow legacy installations that deviate from TDS to function, albeit with reduced portability.
References
- TeX Users Group (TUG). The TeX Directory Structure (TDS). 1995, with subsequent revisions. Available at CTAN:
tex-archive/info/tds. - TeX Live Team. TeX Live Documentation – The TeX Directory Structure. 2023.
- MiKTeX Project. MiKTeX Manual – File Organization. 2022.
(All references are derived from publicly accessible documentation maintained by the TeX community.)