LinuxCommandLibrary

tlmgr-generate

Rebuild the TeX Live format files

TLDR

Remake the configuration file storing into a specific location

$ tlmgr generate --dest [output_file]
copy

Remake the configuration file using a local configuration file
$ tlmgr generate --localcfg [local_configuration_file]
copy

Run necessary programs after rebuilding configuration files
$ tlmgr generate --rebuild-sys
copy

SYNOPSIS

tlmgr generate [OPTION...] { ls-R | fmtutil | language | all }

PARAMETERS

ls-R
    Generates the main ls-R file, a database of all files in the TeX Live installation for quick lookup. This is equivalent to running mktexlsr.

fmtutil
    Generates the fmtutil.cnf configuration file, which defines how TeX formats are built. This is then used by fmtutil.

language
    Generates the language.dat, language.dat.lua, and language.def files, which are essential for hyphenation patterns and language definitions used by packages like Babel.

all
    Generates all the above-mentioned files (ls-R, fmtutil.cnf, and language files).

--local
    Operates only on the local TeX Live installation tree, ignoring system-wide or network installations.

--rebuild-fmt
    (Applicable with 'fmtutil' or 'all') After generating fmtutil.cnf, it also triggers the actual rebuilding of all TeX formats based on the new configuration.

--dest


    (Applicable with 'ls-R') Specifies an alternative directory where the ls-R file should be written, instead of the default TeX Live root.

--only-installed
    (Applicable with 'language') When generating language files, only include languages corresponding to currently installed packages, omitting those not in use.

--quiet
    Suppresses most output messages, showing only critical errors.

--debug
    Enables verbose debug output, useful for troubleshooting.

--help
    Displays a short help message and exits.

--version
    Displays the tlmgr version information and exits.

DESCRIPTION

The tlmgr generate command is a crucial utility within the TeX Live distribution, responsible for regenerating various essential configuration and database files. These files ensure the correct functioning of your TeX Live installation, especially after updates, new package installations, or custom modifications. It unifies the process of creating files like ls-R, fmtutil.cnf, and the language.dat, language.dat.lua, and language.def files.

The ls-R file is a comprehensive database of all files within the TeX Live tree, enabling efficient file lookup by TeX programs. The fmtutil.cnf file defines how various TeX formats (e.g., LaTeX, Plain TeX) are built and managed. The language.* files are vital for hyphenation and language-specific settings, primarily used by packages like Babel and Polyglossia.

While tlmgr generate is often automatically invoked by other tlmgr commands (such as tlmgr update or tlmgr install), it can be run manually to address specific configuration issues, force a rebuild of these files, or after making manual changes to the TeX Live tree. Its primary purpose is to maintain consistency and ensure that all components of the TeX system can locate necessary files and use correct configurations.

CAVEATS

Running tlmgr generate manually is generally not required for typical usage, as its functions are automatically invoked by other tlmgr commands like update and install.

For system-wide TeX Live installations, executing this command often requires administrative privileges (e.g., using sudo) to ensure the generated files can be written to their proper locations.

The generation process, especially for ls-R on large installations or rebuilding all formats, can be time-consuming and resource-intensive.

PURPOSE OF GENERATED FILES

  • ls-R: A flat-file database containing the path and modification time of every file in the TeX Live tree. TeX engines and utilities use this for fast file lookup, avoiding slow recursive directory scans.
  • fmtutil.cnf: The configuration file for fmtutil, which lists all available TeX formats (like LaTeX, ConTeXt, Plain TeX) and specifies the source files and options needed to build their corresponding format files (.fmt).
  • language.dat, language.dat.lua, language.def: These files provide a mapping from language names to hyphenation patterns and other language-specific definitions. They are crucial for packages like Babel and Polyglossia to correctly typeset documents in various languages by enabling proper hyphenation and locale-specific features.

HISTORY

The tlmgr utility, which encompasses tlmgr generate, was introduced as the primary management tool for TeX Live distributions from version 2008 onwards. It aimed to consolidate and streamline various maintenance tasks previously handled by separate scripts or manual interventions, such as managing packages, updating the distribution, and regenerating critical configuration files. The generate subcommand specifically unified the regeneration of the TeX file database (ls-R) and format/language configuration files, making TeX Live maintenance more robust and user-friendly.

SEE ALSO

tlmgr(1), mktexlsr(1), fmtutil(1), tex(1), latex(1)

Copied to clipboard