How to use the command 'tlmgr paper' (with examples)

How to use the command 'tlmgr paper' (with examples)

The command ’tlmgr paper’ is used to manage paper size options of a TeX Live installation. It allows users to view and modify the default paper size used by TeX Live programs. This article will provide examples of various use cases of the ’tlmgr paper’ command.

Use case 1: Show the default paper size used by all TeX Live programs

Code:

tlmgr paper

Motivation: By using the command ’tlmgr paper’ without any arguments, users can quickly view the default paper size used by all TeX Live programs. This is useful when users want to verify the current paper size setting.

Explanation: This command does not require any arguments. It simply displays the default paper size.

Example output:

Default paper size: letter

Use case 2: Set the default paper size for all TeX Live programs to A4

Code:

sudo tlmgr paper a4

Motivation: Users may want to change the default paper size for all TeX Live programs to suit their specific needs. For example, if they predominantly work with documents that use the A4 paper size, it would be more convenient to set A4 as the default.

Explanation: The argument ‘a4’ is provided to specify the desired paper size. By running the command with superuser privileges (using ‘sudo’), the change in the default paper size will be applied system-wide.

Example output: (No output will be displayed upon successful execution)

Use case 3: Show the default paper size used by a specific TeX Live program

Code:

tlmgr pdftex paper

Motivation: When managing different TeX Live programs, it can be helpful to verify the default paper size used by a specific program. This information is useful for troubleshooting or ensuring that the desired paper size is set for a particular program.

Explanation: In this example, ‘pdftex’ is provided as an argument to specify the TeX Live program. The ‘paper’ option is used to retrieve the corresponding default paper size.

Example output:

Default paper size for pdftex: letter

Use case 4: Set the default paper size for a specific TeX Live program to A4

Code:

sudo tlmgr pdftex paper a4

Motivation: Users may want to change the default paper size for a specific TeX Live program. This is useful if certain programs require a different paper size than the system-wide default.

Explanation: By providing the program name (‘pdftex’) and the desired paper size (‘a4’), users can set a specific TeX Live program to use a different default paper size. Superuser privileges are required to apply the change system-wide.

Example output: (No output will be displayed upon successful execution)

Use case 5: List all available paper sizes for a specific TeX Live program

Code:

tlmgr pdftex paper --list

Motivation: It can be beneficial to know the available paper sizes for a specific TeX Live program. This information helps users make informed decisions when setting the default paper size.

Explanation: The ‘–list’ option is used to list all available paper sizes for the ‘pdftex’ program.

Example output:

Available paper sizes for pdftex:
- a0
- a1
- a2
- ...

Use case 6: Dump the default paper size used by all TeX Live programs in JSON format

Code:

tlmgr paper --json

Motivation: Users may require the default paper size information in a machine-readable format. By using the ‘–json’ option, the command outputs the default paper size in JSON format, which can be easily processed by scripts or other programs.

Explanation: The ‘–json’ option is used to specify the desired output format. This option ensures that the command returns the default paper size in JSON format.

Example output:

{
  "default_paper_size": "letter"
}

Conclusion:

The ’tlmgr paper’ command provides a convenient way to manage the default paper size of TeX Live programs. By understanding and utilizing the different use cases presented in this article, users can easily view, modify, and retrieve the default paper size settings to suit their specific requirements.

Related Posts

How to use the command rexec (with examples)

How to use the command rexec (with examples)

rexec is a command-line tool used to execute commands on a remote host.

Read More
Using the Git Status Command (with examples)

Using the Git Status Command (with examples)

The git status command is used to show the changes to files in a Git repository.

Read More
How to use the command nginx (with examples)

How to use the command nginx (with examples)

Nginx is a web server that is known for its high performance, stability, and scalability.

Read More