tlmgr-path
Configure TeX Live's PATH environment variable
TLDR
Add symlinks to TeX Live files
Remove symlinks to TeX Live files
SYNOPSIS
tlmgr-path <action> [options]
Actions: show
| add
| remove
| set
PARAMETERS
show
Displays the current TeX Live related paths that are or should be in PATH
and MANPATH
. If sourced, it prints commands to be executed for adding/removing.
add
Adds the TeX Live binary and man directories to the current PATH
and MANPATH
environment variables. This action is usually sourced to affect the current shell.
remove
Removes TeX Live binary and man directories from PATH
and MANPATH
. Similar to 'add', this action is typically sourced.
set
Resets PATH
and MANPATH
to include only the TeX Live directories and standard system paths, effectively removing other custom entries. Use with caution as it can clear other important paths.
--all
(Used with show
) Displays path information for all detected TeX Live installations on the system, rather than just the active one.
--dry-run
Performs a simulated run, showing what changes would be made to the environment variables without actually applying them. Useful for previewing changes.
--windows
Handles path manipulation specific to Windows environments, often involving system-wide path modifications via the registry.
--dont-execute
Instructs the script not to execute any commands, typically used for internal debugging or specific programmatic interactions. Similar to --dry-run
.
DESCRIPTION
tlmgr-path
is a crucial helper script for TeX Live, designed to manage the PATH
and MANPATH
environment variables. It ensures that the executables and manual pages distributed with TeX Live are correctly accessible from your command line. While often invoked indirectly via the tlmgr path
subcommand, tlmgr-path
can also be used directly. Its primary function is to report, add, remove, or set the necessary directories in your shell's environment variables, making utilities like pdflatex
, xelatex
, bibtex
, and their respective manual pages discoverable by the system. Proper configuration of these paths is essential for a functional TeX Live setup, allowing users to run TeX-related commands without specifying full paths.
CAVEATS
It is critical to understand the difference between executing tlmgr-path
and sourcing it. When executed directly (e.g., tlmgr-path add
), the script performs actions only within its own subshell, and the changes do not persist in the parent shell's environment. To permanently modify the current shell's PATH
and MANPATH
, tlmgr-path
must be sourced (e.g., source tlmgr-path add
or . tlmgr-path add
). Using the set
action can be destructive if you rely on other custom paths, as it will clear all non-TeX Live and non-system paths. Incorrect usage can lead to your TeX Live binaries becoming inaccessible.
SOURCING THE SCRIPT
To make tlmgr-path
's changes effective in your current shell session, you must source the script. This means running it with the source
command or its shorthand .
(dot) command, like source /path/to/tlmgr-path add
or . /path/to/tlmgr-path add
. This executes the script within the current shell, allowing it to modify the PATH
and MANPATH
environment variables of that shell. Without sourcing, any path modifications made by tlmgr-path
will only apply to the subshell in which it was executed and will disappear immediately after the script finishes.
HISTORY
tlmgr-path
is an integral component of the TeX Live distribution, developed alongside the TeX Live Manager (tlmgr
) to standardize and simplify the management of executable and manual page paths for TeX Live installations across various Unix-like systems and Windows. Its functionality ensures that users can easily integrate TeX Live into their existing shell environments without manual path configuration, evolving as TeX Live itself has grown and added features over its development history.