How to use the command tlmgr shell (with examples)
TeX Live Manager (tlmgr) is a command-line tool for managing the TeX Live distribution on Linux, macOS, and Windows. It allows users to install, update, and remove packages, as well as perform other administrative tasks related to the TeX Live distribution. The tlmgr shell
command starts an interactive shell of tlmgr, providing a convenient way to execute multiple commands without having to repeatedly type tlmgr
for each command.
Use case 1: Start an interactive shell of tlmgr
Code:
tlmgr shell
Motivation: Starting an interactive shell of tlmgr allows users to run multiple commands in sequence without having to repeatedly enter tlmgr
for each command. This can save time and make the workflow more efficient.
Explanation: The command tlmgr shell
starts an interactive shell of tlmgr, where users can input tlmgr commands directly without having to prefix each command with tlmgr
.
Example output:
Entering TeX Live shell. Type `quit` to quit.
tlmgr>
Use case 2: Run any tlmgr sub-command in the interactive shell
Code:
sub_command arguments
Motivation: Running tlmgr sub-commands in the interactive shell allows users to perform various administrative tasks related to the TeX Live distribution, such as installing, updating, or removing packages, without the need to exit and re-enter the interactive shell.
Explanation: In the interactive shell of tlmgr, users can directly input any tlmgr sub-command along with its arguments. The sub-command is executed immediately and the result is displayed.
Example output:
tlmgr> install example-package
Installing example-package...
done
Use case 3: Quit the interactive shell
Code:
quit
Motivation: Exiting the interactive shell of tlmgr allows users to return to the normal command-line prompt and continue with other tasks or operations.
Explanation: The quit
command is used to exit the interactive shell of tlmgr. Once executed, users will be returned to the regular command-line prompt.
Example output:
tlmgr> quit
Exiting TeX Live shell.
Use case 4: List all TeX Live variables
Code:
get
Motivation: Listing all TeX Live variables provides users with an overview of the current configuration and settings of the TeX Live distribution.
Explanation: The get
command without any arguments is used to list all TeX Live variables. Each variable, along with its value, is displayed as the output.
Example output:
tlmgr> get
variable1 = value1
variable2 = value2
variable3 = value3
...
Use case 5: Get the value of a TeX Live variable
Code:
get variable
Motivation: Getting the value of a specific TeX Live variable allows users to retrieve specific configuration information or settings related to the TeX Live distribution.
Explanation: The get
command followed by the name of the variable is used to retrieve the value of a specific TeX Live variable. The value of the variable is displayed as the output.
Example output:
tlmgr> get variable1
value1
Use case 6: Set the value of a TeX Live variable
Code:
set variable value
Motivation: Setting the value of a TeX Live variable provides users with the ability to customize the configuration and settings of the TeX Live distribution according to their specific requirements.
Explanation: The set
command followed by the name of the variable and the desired value is used to change the value of a TeX Live variable. The new value is immediately applied and the change is reflected.
Example output:
tlmgr> set variable1 new_value1
Variable 'variable1' set to 'new_value1'
Use case 7: Restart the interactive shell
Code:
restart
Motivation: Restarting the interactive shell of tlmgr allows users to clear any previous state or temporary changes made during the current session and start afresh.
Explanation: The restart
command is used to restart the interactive shell of tlmgr. Upon execution, the shell is terminated and a new interactive shell is started, providing a clean environment for subsequent commands.
Example output:
tlmgr> restart
Restarting TeX Live shell...
Entering TeX Live shell. Type `quit` to quit.
tlmgr>
Use case 8: Print the version of the current protocol
Code:
protocol
Motivation: Printing the version of the current protocol allows users to verify the compatibility of the tlmgr client with the TeX Live distribution server.
Explanation: The protocol
command is used to print the version of the current protocol used by the tlmgr client to communicate with the TeX Live distribution server. The version number is displayed as the output.
Example output:
tlmgr> protocol
Protocol version: 1.27
Conclusion:
The tlmgr shell
command provides a convenient way to interact with the TeX Live Manager through an interactive shell. It allows users to execute multiple commands without having to repeatedly type tlmgr
for each command. The various use cases covered in this article illustrate how to use the tlmgr shell
command for different tasks such as starting the interactive shell, running sub-commands, managing variables, and more.