LinuxCommandLibrary

tlmgr-search

Search for LaTeX packages within TeX Live

TLDR

Search for a package name and descriptions of all locally installed packages from a specific regex

$ tlmgr search "[regex]"
copy

Search for all file names of all locally installed packages from a regex
$ tlmgr search --file "[regex]"
copy

Search for all file names, package names, and descriptions of all locally installed packages from a regex
$ tlmgr search --all "[regex]"
copy

Search the TeX Live database, instead of the local installation
$ tlmgr search --global "[regex]"
copy

Restrict the matches for package names and descriptions (but not for file names) to whole words
$ tlmgr search --all --word "[regex]"
copy

SYNOPSIS

tlmgr search [option...] <pattern>
Example: tlmgr search --file report.cls
Example: tlmgr search --description "graphics"

PARAMETERS

<pattern>
    The regular expression or string to search for. This is the core search query.

--file <pattern>
    Searches for files whose names or paths match the provided <pattern>. Useful for finding which package provides a specific file.

--description <pattern>
    Searches within the long descriptions of TeX Live packages for the given <pattern>. This helps in discovering packages by their functionality.

--global
    Searches the remote TeX Live package repository. Often synonymous with --remote. This is typically the default for description searches.

--local
    Searches only the currently installed TeX Live packages on your system. Useful for checking what's already present.

--all
    Combines --local and --global (or --remote) to search both the local installation and the remote repository.

--list
    For each matching package, lists all files (when used with --file) or the full description (when used with --description), instead of just the package name.

--verbose
    Provides more detailed output, potentially showing additional information about matches and the search process.

--help
    Displays a concise help message for the tlmgr search command, outlining its options and usage.

--version
    Shows the version information for tlmgr, which applies to the search subcommand as well.

DESCRIPTION

tlmgr search is a vital subcommand of the TeX Live Manager, tlmgr, designed for efficient discovery within the extensive TeX Live distribution. It empowers users to search for specific packages, files provided by packages, or even package descriptions. This command is invaluable for identifying which package contains a particular .sty or .cls file, locating packages relevant to a specific LaTeX topic, or confirming the availability of software within TeX Live. Depending on the options used, tlmgr search can query your locally installed TeX Live tree or the remote TeX Live repository, making it a flexible tool for both installed and available content. Its regex-enabled pattern matching allows for precise and powerful searches.

CAVEATS

tlmgr search can yield extensive results, especially with broad or common patterns, which might require careful parsing.
Searches involving --global or --remote naturally require an active internet connection to query the TeX Live mirrors.
Patterns are typically interpreted as Perl-compatible regular expressions (PCREs); ensure correct syntax and proper shell escaping for special characters to avoid unexpected behavior.
Performance can vary significantly based on network speed and the current load on the CTAN mirrors.

SEARCH SCOPE BEHAVIOR

Understanding the search scope is crucial. By default, tlmgr search --file often searches locally, while tlmgr search --description defaults to remote. Using --local, --global (or --remote), or --all explicitly controls whether the command queries your installed TeX Live tree, the online repository, or both respectively. This distinction is vital for finding both installed and available packages.

REGULAR EXPRESSION SUPPORT

The <pattern> argument in tlmgr search commands is interpreted as a Perl-compatible regular expression (PCRE). This allows for powerful and flexible matching, but users should be familiar with regex syntax. For simple string searches, literal patterns usually work, but for complex queries (e.g., matching start/end of line, specific character sets), full regex capabilities can be utilized.

HISTORY

The tlmgr utility, which encapsulates search, was introduced to centralize the management of TeX Live, succeeding older, more disparate tools like texconfig and updmap. The search subcommand has been a foundational part of tlmgr since its early versions, evolving to support more flexible search scopes (local vs. remote) and types (file, description). Its development reflects the need for users to easily navigate and identify components within the ever-expanding TeX Live distribution, ensuring efficient package discovery and problem-solving.

SEE ALSO

tlmgr(1), kpsewhich(1), texdoc(1)

Copied to clipboard