xetex (with examples)
Use Case 1: Compile a PDF document
Code:
xetex source.tex
Motivation: This use case is used when you want to compile a PDF document from XeTeX source files. XeTeX is a powerful typesetting engine that supports various font formats and advanced typographic features.
Explanation: The xetex
command is followed by the name of the source file (source.tex
). This compiles the source file and generates a PDF document.
Example output: The source file source.tex
is compiled, and a PDF document is generated.
Use Case 2: Compile a PDF document, specifying an output directory
Code:
xetex -output-directory=path/to/directory source.tex
Motivation: This use case is useful when you want to specify a custom output directory for the compiled PDF document. It allows you to keep your source files and generated PDFs organized in separate directories.
Explanation: The -output-directory
option is used to specify the output directory for the compiled PDF document. You need to provide the path to the desired directory after the option. The source.tex
is the input source file that will be compiled.
Example output: The source file source.tex
is compiled, and the resulting PDF document is placed in the specified output directory path/to/directory
.
Use Case 3: Compile a PDF document, exiting if errors occur
Code:
xetex -halt-on-error source.tex
Motivation: This use case is useful when you want to stop the compilation process immediately if any errors occur in the source file. It helps in identifying and fixing errors efficiently.
Explanation: The -halt-on-error
option tells XeTeX to stop the compilation process if any errors are encountered in the source file. By default, XeTeX tries to continue compilation even if errors occur.
Example output: If no errors are encountered in the source file, the compilation process proceeds as usual. However, if any errors occur, XeTeX halts the compilation and displays the error message.