Using pdftex (with examples)

Using pdftex (with examples)

1: Compile a PDF document

pdftex source.tex

Motivation: Compiling a PDF document is the most basic usage of pdftex. This command will take the source file source.tex and generate a PDF document.

Explanation: The pdftex command is followed by the name of the tex file (source.tex in this case) to specify the source file to be compiled.

Example Output: This command will compile source.tex and generate a PDF document named source.pdf.

2: Compile a PDF document, specifying an output directory

pdftex -output-directory=path/to/directory source.tex

Motivation: Sometimes, it is desirable to specify a specific output directory for the generated PDF document. This can be useful for organizing the generated files.

Explanation: The pdftex command is followed by the -output-directory flag, which is then followed by the desired output directory path (path/to/directory in this case). Finally, the source file source.tex is specified.

Example Output: This command will compile source.tex and generate a PDF document named source.pdf in the specified output directory path/to/directory.

3: Compile a PDF document, exiting on each error

pdftex -halt-on-error source.tex

Motivation: By default, pdftex continues compilation even if errors are encountered. However, there are scenarios where it is preferable to halt compilation upon encountering any error.

Explanation: The pdftex command is followed by the -halt-on-error flag. This flag instructs pdftex to stop compilation as soon as an error is detected in the source file.

Example Output: If an error is encountered in source.tex, pdftex will stop compilation and display an error message indicating the cause of the error.

Related Posts

How to use the command 'ispell' (with examples)

How to use the command 'ispell' (with examples)

The ‘ispell’ command is a utility for interactive spell-checking. It allows users to check for typos in a specified file and interactively apply suggestions.

Read More
How to use the command "yum" (with examples)

How to use the command "yum" (with examples)

The “yum” command is a package management utility specifically designed for use in RHEL (Red Hat Enterprise Linux), Fedora, and CentOS distributions.

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

How to use the command unix2mac (with examples)

The unix2mac command is used to change Unix-style line endings to macOS-style line endings.

Read More