LinuxCommandLibrary

xelatex

Compile LaTeX documents to PDF

SYNOPSIS

xelatex [OPTION]... [FILE...]
or: xelatex [OPTION]... \command
or: xelatex [OPTION]... &FORMAT [FILE...]

PARAMETERS

-output-directory=


    Write all output files to the specified directory DIR.

-interaction=
    Set the interaction mode. Common modes include batchmode (no user interaction), nonstopmode (process without stopping for errors), scrollmode, and errorstopmode (stop on first error).

-jobname=
    Use NAME for all output files (e.g., NAME.pdf, NAME.log).

-shell-escape
    Enable the \write18 command, allowing execution of arbitrary shell commands from the LaTeX document. This is a security risk.

-no-shell-escape
    Disable the \write18 command, preventing execution of external commands. This is the default and recommended for security.

-halt-on-error
    Exit immediately upon encountering the first error during compilation.

-file-line-error
    Print error messages in the format file:line:error, which is useful for integration with text editors.

-recorder
    Enable the filename recorder, which creates a .fls file listing all input and output files used during compilation.

-version
    Print the version information of xelatex.

-help
    Display a help message with available options.

-synctex=<0|1>
    Enable (1) or disable (0) SyncTeX support, allowing synchronization between source and output PDF.

-output-format=
    Specify the output file format, e.g., pdf (default) or dvi.

DESCRIPTION

xelatex is a powerful program that compiles LaTeX source files into high-quality typesetting output, typically PDF. It is built upon the XeTeX typesetting engine, which is an extension of Donald Knuth's original TeX system. What sets xelatex apart is its direct support for Unicode (UTF-8) input, allowing users to easily work with a wide range of languages and scripts, including those with complex typographic requirements, without the need for intricate encoding setups.

Furthermore, xelatex provides direct access to system fonts, including modern OpenType and TrueType fonts, leveraging their advanced typographic features such as ligatures, kerning, small caps, and alternative glyphs. This eliminates the need for specialized font packages and conversions often required by traditional LaTeX compilers, greatly simplifying font management. It also handles modern graphics formats like PNG, JPEG, and PDF natively.

While pdflatex remains popular, xelatex is often preferred for documents requiring specific commercial fonts, advanced typographic control, or support for non-Latin scripts. It usually outputs PDF files directly, making it a comprehensive solution for creating professional-grade documents. It is a core component of major TeX distributions like TeX Live and MiKTeX.

CAVEATS

While powerful, xelatex has some considerations:

  • Package Compatibility: Older or highly specialized LaTeX packages might not be fully compatible with xelatex and may require alternatives (e.g., fontspec for font handling) or specific workarounds.
  • Font Availability: Since xelatex relies on system fonts, documents may not compile identically on different systems if the required fonts are not installed or have different versions. Embedding fonts in the PDF can mitigate this.
  • Performance: For extremely large documents with complex font usage, compilation might be slightly slower compared to pdflatex due to the advanced font rendering capabilities.
  • Graphics Drivers: Sometimes, issues can arise with certain graphics drivers or older systems when rendering complex OpenType features.

KEY PACKAGES FOR XELATEX

For effective use of xelatex, the fontspec package is crucial. It provides commands like \setmainfont, \setsansfont, and \setmonofont to easily select and configure system fonts. The xunicode package (often loaded by fontspec) provides Unicode character definitions, ensuring broad character support.

OUTPUT FILES

When you compile a .tex file, xelatex generates several auxiliary files in addition to the .pdf (or .dvi) output. These include: .log (log file), .aux (auxiliary data for cross-referencing), .toc (table of contents), .lof (list of figures), .lot (list of tables), .fls (file list, if -recorder is used), and potentially others depending on the packages used.

HISTORY

The XeTeX engine, which xelatex leverages, was primarily developed by Jonathan Kew starting in 2004. Its initial goal was to provide a direct way to use Unicode and modern system fonts (like OpenType and TrueType) within the TeX typesetting system, features that were challenging or impossible with traditional pdfTeX.

The xelatex command essentially provides the LaTeX macro layer on top of the XeTeX engine, making these advanced capabilities accessible to LaTeX users. It quickly gained traction among users needing support for non-Latin scripts, advanced typography, and direct access to their system's installed fonts, becoming a standard component in major TeX distributions by the late 2000s.

SEE ALSO

latex(1), pdflatex(1), lualatex(1), tex(1), dvips(1), dvipdfm(1)

Copied to clipboard