Hubbry Logo
XeTeXXeTeXMain
Open search
XeTeX
Community hub
XeTeX
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
XeTeX
XeTeX
from Wikipedia

XeTeX
Original authorJonathan Kew
Stable release
0.999997 / March 7, 2025; 7 months ago (2025-03-07)
Repository
Written inPascal (WEB), C and C++
Operating systemCross-platform
TypeTypesetting
LicenseMIT License
Websitexetex.sourceforge.net

XeTeX (/ˈztɛx/ ZEE-tekh[1] or /ˈztɛk/; see also Pronouncing and writing "TeX"), sometimes stylized as XeTeX, is a TeX typesetting engine using Unicode and supporting modern font technologies such as OpenType, Graphite and Apple Advanced Typography (AAT). It was originally written by Jonathan Kew and is distributed under the X11 free software license.[2]

Initially developed for Mac OS X only, it is now available for all major platforms. It natively supports Unicode and the input file is assumed to be in UTF-8 encoding by default. XeTeX can use any fonts installed in the operating system without configuring TeX font metrics, and can make direct use of advanced typographic features of OpenType, AAT and Graphite technologies such as alternative glyphs and swashes, optional or historic ligatures, and variable font weights. Support for OpenType local typographic conventions (locl tag) is also present. XeTeX even allows raw OpenType feature tags to be passed to the font. Microtypography is also supported. XeTeX also supports typesetting mathematics using Unicode fonts that contain special mathematical features, such as Cambria Math or Asana Math as an alternative to the traditional mathematical typesetting based on TeX font metrics.

LaTeX developers have announced that they no longer support new LaTeX functionalities on the XeTeX engine, and encourage users to migrate to LuaTeX, another Unicode-supporting engine.[3]

Mode of operation

[edit]
Rendering of ligatures and contextual alternates in XeTeX using an OpenType font (Hoefler Text).

XeTeX processes input in two stages. In the first stage XeTeX outputs an extended DVI (xdv) file, which is then converted to PDF by a driver. In the default operating mode the xdv output is piped directly to the driver without producing any user-visible intermediate files. It is possible to run just the first stage of XeTeX and save the xdv, although as of July 2008 there are no viewers capable of displaying the intermediate format.

Two backend drivers are available to generate PDF from an xdv file:

Starting from version 0.997, the default driver is xdvipdfmx on all platforms. As of version 0.9999, xdv2pdf is no longer supported and its development has been discontinued.[4]

XeTeX works well with both LaTeX and ConTeXt macro packages. It is usually invoked through xelatex when using LaTeX. It is usually used with the fontspec package, which provides a configurable interface for font selection, and allows complex font choices to be named and later reused.[5]

XeTeX is bundled with TeX Live, MacTeX, MiKTeX and Lyx (see the History below for dates and versions).[6]

Example

[edit]

The following is an example of XeLaTeX source and rendered output. The typeface used is OFL-licensed font Linux Libertine. The text is to be processed by the command xelatex.

Arabic support

[edit]

XeTeX also supports right-to-left scripts, such as Arabic. One way of rendering Arabic in XeTeX is to use the package arabxetex. In order to do so, the Arabic is placed inside the following:

\begin{arab}[utf]
.
.
.
\end{arab}

The following code illustrates this:

Features

[edit]

In bibliographic files (see below the BibTeX example) you can use Unicode entities and call them with their native scripting, for example \cite{Ekstrøm}, instead of a transliterated ASCII form like \cite{Ekstrom} which is mandatory using the pdfTeX engine.

% Encoding: UTF8
@ARTICLE(Ekstrom,
        AUTHOR    = "Author w",
        TITLE     = "{Ekstrøm title}",
        JOURNAL   = "Ekstr{\o}m Journal",
        YEAR      = 1965,
    note      = {Working with pdflatex}
        )
 @ARTICLE(Ekstrøm,
        AUTHOR    = "Author Ekstr{\o}m",
        TITLE     = "{Ekstrøm title}",
        JOURNAL   = "Ekstrøm Journal",
        YEAR      = "1965",
    note      = {Not working with pdflatex but with xelatex}
        )

History

[edit]

XeTeX was initially released for Mac OS X only in April 2004[7] with built-in AAT and Unicode support. In 2005 support for OpenType layout features was first introduced. During BachoTeX 2006 a version for Linux was announced, which was ported to Microsoft Windows by Akira Kakuto a few months later, and finally included into TeX Live 2007 for all major platforms. XeTeX is also supported by LyX since version 2.0[8] and shipped with MiKTeX since version 2.7. As of the inclusion in TeX Live, XeTeX supports most macro packages written for LaTeX, OpenType, TrueType and PostScript fonts without any specific setup procedure. Version 0.998 announced at BachoTeX 2008 supports Unicode normalization via the \XeTeXinputnormalization command. Version 0.9999, released in May 2013, switched from ICU Layout Engine to HarfBuzz for OpenType layout, and Graphite2 engine for Graphite layout, as well Core Text framework instead of ATSUI on Mac OS X.

XeTeX's original SourceForge code repository has not seen changes since January 20, 2020.[9] It's still included in the TeX Live repository and occasionally receives fixes, but there have been no major developments. LaTeX developers have stated that it won't be supported in their ongoing effort to produce tagged PDF,[3] and one developer consider it unmaintained.[10]

See also

[edit]

References

[edit]

Further reading

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
XeTeX is a engine that extends Donald Knuth's system with native support for and modern font technologies, including , , and Apple Advanced Typography (AAT). It enables high-quality for complex scripts and multilingual documents by directly accessing system fonts without requiring specialized font metrics. Developed initially by Jonathan Kew at SIL International for linguistic research on Macintosh systems, XeTeX produces an extended DVI format that is typically converted to PDF using the xdvipdfmx driver. XeTeX supports micro-typographic features similar to pdfTeX, such as font expansion and protrusion, while providing seamless integration with and features like ligatures, , and mathematical typesetting. It is commonly invoked in conjunction with through the XeLaTeX workflow, allowing users to leverage packages like fontspec for easy font selection and customization. As part of the distribution since its inception, XeTeX remains actively maintained by the community, with the latest updates included in TeX Live 2025. First publicly released in April 2004, XeTeX addressed limitations in traditional engines for handling non-Latin scripts and contemporary demands, making it a preferred choice for , , and international documentation. Its open-source nature under the X11 License, hosted on CTAN and , facilitates contributions and ensures compatibility across Unix, macOS, and Windows platforms. Today, XeTeX powers tools in environments like and , continuing to evolve with enhancements to PDF output and font handling in recent releases.

Overview

Definition and Purpose

XeTeX is a engine built as an extension of Knuth's original system, specifically engineered to natively handle input and output while leveraging modern font formats such as and (with historical support for Apple Advanced Typography on older macOS versions). Since 2019, it incorporates the library for enhanced shaping and complex script support. It inherits the core algorithmic capabilities of , including its precise control over layout and spacing, but replaces TeX's traditional 8-bit character encoding with full /ISO 10646 support, allowing for the direct processing of encoded source files without the need for external conversion tools. Developed by Jonathan Kew at SIL International, XeTeX was created to enable the of complex international scripts directly within TeX's framework, overcoming the restrictions of legacy engines like pdfTeX that rely on limited character sets and preprocessing for non-Latin languages. The primary purpose of XeTeX is to facilitate the creation of multilingual documents and advanced typographic designs by integrating 's programmable formatting with contemporary font rendering technologies, thereby supporting features like ligatures and glyph variants (with packages for ) without additional software layers for basic font rendering. This addresses key limitations in traditional engines, which struggle with the diversity of global writing systems due to their dependence on fixed encodings and basic font metrics. By processing Unicode text internally in UTF-16 and interfacing with system fonts, XeTeX ensures high-fidelity output, particularly in PDF format, making it suitable for , technical documentation, and projects involving scripts such as , , or Cyrillic. At its core, XeTeX embodies the fusion of 's mathematical precision in line breaking and justification with the expressive power of modern fonts, allowing users to specify font families and features declaratively in their documents for seamless rendering of typographic nuances. This design choice not only preserves 's renowned quality for Western European languages but extends it globally, promoting for non-Roman scripts while maintaining compatibility with existing macros and packages through its e-TeX foundation.

Licensing and Availability

XeTeX is distributed under the X11 License, a permissive that allows free use, modification, distribution, and incorporation into both academic and commercial projects without restrictive requirements. The engine is integrated into prominent distributions, including since its 2007 release, on Windows, and on macOS, enabling users to access it through standard installation packages without separate downloads in most cases. Source code and development resources are hosted on the project's repository, from which users can obtain the latest versions for compilation or contribution. Originally developed with native support for macOS in its 2004 initial release, XeTeX was ported to and Windows in 2006, providing cross-platform compatibility via these major TeX distributions on systems, Windows, and macOS. Documentation is available through the TeX Users Group at tug.org/xetex, and downloads via TeX distributions like .

Technical Operation

Processing Workflow

XeTeX operates through a two-stage pipeline to generate output from input source files. In the initial stage, the XeTeX engine compiles the source into an extended DVI format known as XDV (xdv), which incorporates detailed glyph positioning, font references, and layout instructions derived from the computations. This xdv file serves as an that preserves the full fidelity of the without the constraints of traditional DVI's limited character set support. The second stage involves converting the xdv file to a final PDF output using a dedicated driver program, ensuring compatibility with modern document viewers. The default driver for this conversion has evolved across XeTeX versions to enhance portability and performance. Starting with version 0.997, xdvipdfmx became the standard driver across all supported platforms, leveraging its robust handling of fonts, images, and PDF features originally developed for Asian in pdfTeX workflows. This shift improved cross-platform consistency and integration with system resources. An earlier alternative driver, xdv2pdf, was used for PDF generation on macOS but was discontinued as of version 0.9999 to streamline development and focus on xdvipdfmx's more mature capabilities. A core innovation of the xdv format is its direct embedding of Unicode character codes and font metrics, which allows XeTeX to bypass the 8-bit encoding limitations inherent in classical and traditional DVI files. By storing glyph indices and font descriptors natively within the xdv stream, the format enables seamless access to system-installed fonts (such as and ) during the driver conversion, facilitating high-fidelity rendering of complex layouts without requiring intermediate font conversion or encoding mappings. This approach supports 's full range (up to U+10FFFF) throughout the pipeline, promoting accurate representation of international text and typographic features in the resulting PDF. XeTeX also supports XeLaTeX, a configuration that combines the XeTeX engine with the macro package via a dedicated format file and wrapper script, simplifying document preparation for users familiar with LaTeX syntax while leveraging XeTeX's advanced font and capabilities. The xelatex executable acts as this wrapper, automatically loading the appropriate LaTeX format (xelatex.fmt) and invoking XeTeX for processing, which follows the same two-stage workflow to produce PDF output. This integration allows LaTeX documents to benefit from XeTeX's features without manual engine specification.

Font and Unicode Handling

XeTeX provides native support for , enabling direct processing of encoded input files without the need for or additional encoding packages. This allows users to include international characters seamlessly in source documents, as the engine reads Unicode text up to 1,114,111 characters via primitives like \Uchar. Input normalization options, such as NFC or NFD, can be configured using \XeTeXinputnormalization to handle character decomposition consistently. For font integration, XeTeX primarily utilizes system-installed fonts, accessing them directly from the operating system's font database to support advanced glyph rendering and shaping. It includes fallback mechanisms to for complex script shaping in fonts that require it, specified via the /GR renderer, and to Apple Advanced Typography (AAT) on macOS systems using the /AAT renderer for legacy font features. Fonts in formats like .otf, .ttf, and .pfb can be loaded using the \font primitive with identifiers in square brackets, such as [fontname], enabling straightforward access to installed resources. In XeLaTeX, the fontspec package facilitates font loading through the \fontspec command, which allows specification of font families, weights, styles, and options like ligature activation for enhanced typographic control. This command integrates with the underlying XeTeX to select and configure fonts dynamically, supporting both named fonts and file paths. XeTeX supports a range of features for precise glyph selection and positioning, including adjustments via the +kern tag to ensure optically consistent spacing between characters. Optical margins are managed through protrusion controls like \XeTeXprotrudechars, which enable and letterforms at line edges for improved ragged margin alignment (set to 0 for off, 1 for on without line-breaking impact, or 2 for protrusion affecting hyphenation). Variant glyphs, such as alternates or stylistic sets, are accessed using feature tags like +aalt or \XeTeXglyph, often configured via font feature files in fontspec to apply discretionary substitutions.

Capabilities

Script and Language Support

XeTeX provides robust support for a wide array of writing systems through its integration of text encoding and font technologies, enabling the handling of left-to-right (LTR), right-to-left (RTL), and vertical scripts without relying on legacy 8-bit encodings. This foundation allows for the rendering of complex layouts, where shaping engines apply script-specific glyph substitutions, positioning, and ligatures to ensure accurate typographic representation. For scripts lacking full coverage, XeTeX incorporates font technology, which offers an alternative shaping mechanism for advanced layout features in non-Roman scripts. Right-to-left scripts, such as and Hebrew, benefit from XeTeX's implementation of the bidirectional algorithm, which determines text directionality based on character properties and reorders mixed LTR/RTL content accordingly. However, for comprehensive RTL support including proper joining and cursive connections in , additional packages like arabxetex or bidi are required; these facilitate paragraph-level reordering, contextual forms, and integration with environments to handle the script's inherent complexity. The bidi package, in particular, extends XeTeX's capabilities by providing primitives for bidirectional typesetting, ensuring that RTL text flows correctly while embedding LTR elements like numbers or Latin insertions. XeTeX excels in East Asian typesetting, offering full coverage for Chinese, Japanese, and Korean (CJK) languages through vertical writing modes supported by and Apple Advanced Typography (AAT) fonts. This includes glyph rotation, (vertical) layout adjustments, and line-breaking rules tailored to character-based languages without spaces, allowing seamless horizontal-to-vertical transitions in documents. For South Asian scripts, such as and other Indic systems, XeTeX employs features to manage conjunct characters—clusters of consonants and vowels formed through reph, , and halant substitutions—ensuring faithful reproduction of syllabic structures. A key advantage of XeTeX is its ability to produce multilingual documents that mix disparate scripts, such as English alongside Hebrew or , directly within a single stream, obviating the need for separate preprocessing steps or multiple engine runs. This is achieved by leveraging the underlying font handling mechanisms to map Unicode codepoints to appropriate glyphs across scripts, with the resolving any directional conflicts. XeTeX provides limited support for characters, rendering them in black and white if supported by the font. Full color emoji output is not natively supported and requires workarounds, such as including images or using specialized packages.

Typographic and Mathematical Features

XeTeX enhances microtypography through the integration of packages like microtype, which supports character protrusion for justified text alignment. Protrusion allows certain glyphs, such as , to extend slightly beyond the margins, creating more optical edges and reducing the ragged appearance of justified lines. This feature is particularly effective for , where opening quotes and closing punctuation protrude into the left or right margins, respectively, to maintain even visual margins without altering the text block's geometric alignment. Optical margins are further improved by these adjustments, ensuring that the overall appears balanced, especially in . However, font expansion—stretching or shrinking glyphs to optimize line breaks—is not supported in XeTeX, limiting its microtypographic adjustments compared to engines like pdfTeX or . A key strength of XeTeX lies in its access to font-specific features via the fontspec package, enabling fine-grained typographic control. Users can activate old-style figures, which align numerically with lowercase letters for a more harmonious appearance in running text, by specifying the Numbers=OldStyle option; for example, numerals in fonts like Gyre Adventor shift to a lowercase style. Similarly, small capitals can be invoked with Letters=SmallCaps, converting lowercase letters to scaled uppercase variants suitable for headings or emphasis, as supported in modern fonts. Swashes, decorative flourishes on letters, are accessible through Style=Swash or dedicated feature sets, allowing elegant alternates in script or italic faces for enhanced aesthetic variety. These options leverage XeTeX's native handling, providing typographers with precise control over font variations without manual glyph substitution. For mathematical typesetting, XeTeX integrates seamlessly with the unicode-math package, which implements Unicode-based mathematics using OpenType math fonts. This setup supports a wide range of mathematical symbols directly via Unicode input, eliminating the need for legacy TeX math codes and enabling natural entry of expressions like integrals or summations. Spacing and delimiters are automatically managed according to OpenType math tables, which define metrics for horizontal and vertical positioning, accent placement, and fraction rules, ensuring consistent rendering across different fonts such as Latin Modern Math or STIX Two Math. The package requires an OpenType font with math table support and works exclusively with XeTeX or , providing extensible commands for customizing math styles (e.g., upright or italic symbols) while preserving 's traditional spacing algorithms. XeTeX's Unicode input capabilities extend to bibliographic handling, allowing direct inclusion of Unicode characters in .bib files when paired with tools like biblatex and its biber backend, which fully support encoded entries for multilingual references. This facilitates accurate rendering of non-Latin scripts or special symbols in citations without resorting to macros, streamlining workflows for international scholarship.

Practical Usage

Basic Implementation

XeLaTeX, the interface to XeTeX, enables straightforward document creation by incorporating the fontspec package for font management. A basic setup begins with the standard \documentclass{article} declaration, followed by loading the fontspec package via \usepackage{fontspec} in the preamble, and selecting a main font using the \setmainfont{FontName} command, where FontName refers to an available system font supporting the desired scripts. For a minimal multilingual document, consider the following example that incorporates English, Greek, and Cyrillic text:

latex

\documentclass{article} \usepackage{fontspec} \setmainfont{Noto Serif} % A font supporting multiple scripts \begin{document} English: Hello! Greek: Γειά σου! Cyrillic: Привет! \end{document}

\documentclass{article} \usepackage{fontspec} \setmainfont{Noto Serif} % A font supporting multiple scripts \begin{document} English: Hello! Greek: Γειά σου! Cyrillic: Привет! \end{document}

This code produces a PDF showcasing the text in a unified font, leveraging XeTeX's native handling of diverse glyphs. To compile such a .tex file, invoke XeLaTeX from the command line as xelatex filename.tex, assuming the source file is encoded in UTF-8, which XeTeX processes directly without additional encoding declarations. By default, XeTeX generates PDF output that embeds subsets of the used fonts, ensuring portability and consistent rendering across viewers without requiring external font installations.

Advanced Configurations

Advanced configurations in XeTeX enable the handling of complex multilingual documents through integrated packages that manage bidirectional text and sophisticated font manipulations. The polyglossia package facilitates seamless language switching in XeTeX documents, allowing users to define primary and secondary languages such as English and Arabic, while integrating with the bidi package to control bidirectional paragraphs for mixed left-to-right (LTR) and right-to-left (RTL) content. For instance, commands like \setmainlanguage{english} and \setotherlanguage{arabic} establish the document's linguistic structure, with bidi ensuring proper paragraph directionality in RTL sections, preventing visual disruptions in hybrid texts. A practical application of this integration appears in RTL documents using the arabxetex package, which extends XeTeX's capabilities for Arabic-script languages by processing input via TECkit mappings to Unicode and rendering bidirectional text with embedded LTR elements, such as Western numerals in Arabic sentences. In an example setup, arabxetex vocalizes Arabic text in three modes while maintaining LTR orientation for numbers, as in typesetting phrases like "العدد 123" where the digits flow left-to-right within the RTL context; this is achieved through XeTeX's native Unicode bidirectional algorithm, briefly referencing core RTL mechanics for script support. Such configurations are particularly useful for critical editions or Quranic texts, where arabxetex combines with tools like ednotes for layered bidirectional rendering. XeTeX's advanced font features, accessed via the fontspec package, allow loading of variable fonts for dynamic adjustments like weight , enhancing typographic flexibility in multilingual setups. For example, the command \setmainfont[FontWeight=500]{VariableFont} interpolates along the font's weight axis to produce intermediate boldness levels, supporting continuous variation without discrete style files; this is especially effective for scripts requiring nuanced emphasis in variable fonts. Complementing this, XeTeX supports shaping for non-standard scripts through font-specific features, enabling custom glyph positioning and diacritic stacking beyond standard . A representative case is rendering Burmese text with the Padauk/GR font, declared as \font\myfnt="Padauk/GR" at 7.5pt and paired with \XeTeXlinebreaklocale "my" for locale-aware line breaking in space-less scripts, ensuring accurate stacking of matras and conjuncts. For , XeTeX configurations handle CJK vertical writing by combining font selection with direction commands in the xeCJK package, which adapts CJK typesetting for vertical flow. An example involves setting a vertical font family with \setCJKfamilyfont{vert}[Script=CJK]{SimSun} and switching modes via \CJKvert to rotate glyphs appropriately, producing upright vertical text such as "朝发轫于苍梧兮" flowing top-to-bottom; this requires fonts with vertical metrics and may incorporate features like +vert for adjustment.

Development and Evolution

Historical Development

XeTeX was developed by Jonathan Kew starting in 2004, initially as a proof-of-concept extension of the typesetting engine to incorporate native support and leverage modern font technologies on Mac OS X. Kew, working at SIL International, aimed to address TeX's limitations in handling complex scripts and non-Latin languages by integrating platform-native font rendering, beginning with Apple Advanced Typography (AAT). The first public release, version 0.3, occurred in April 2004 exclusively for Mac OS X, providing built-in Unicode input, access to system-installed fonts, and AAT-based layout features. Key expansions followed rapidly to broaden accessibility. In April 2006, Kew ported XeTeX to , marking its first public release on that platform during the BachoTeX conference. Shortly thereafter, in June 2006, William Adams contributed a Windows port based on version 0.994, enabling cross-platform use through open-source libraries like ICU for layout and dvipdfmx for output. XeTeX was integrated into the distribution with version 0.996 in February 2007, making it available across all major platforms as a standard component. A significant milestone came in 2009 with version 0.997, which introduced xdvipdfmx as the default PDF driver, enhancing output quality by embedding native fonts and improving graphics handling on all platforms. Over the ensuing years, XeTeX evolved from its initial AAT-centric design toward greater reliance on features, with support added in version 0.9 in February 2005 to enable advanced typographic controls like ligatures and glyph substitution. Minor updates continued through the 2010s, focusing on stability, enhancements, and integration with tools like for script shaping. By 2012, XeTeX reached version 0.9999, a major release emphasizing performance and compatibility, included in 2013 as version 0.9999.3. Updates became sparse thereafter, with development shifting toward maintenance rather than frequent revisions.

Current Status and Alternatives

XeTeX's latest stable release is version 0.999997, incorporated into 2025. This minor update, effective as of March 2025, addressed issues such as memory leaks in AAT font handling and compatibility with hybrid / fonts. Despite these incremental changes, XeTeX has seen no major development since around 2020, with its original repository inactive since 2015. The Project considers XeTeX unmaintained and recommends against its use for new projects, citing limited ongoing support and engine constraints like unreliable tagged PDF production. Nonetheless, XeTeX remains integrated into modern tools, including for online compilation and Emacs' AUCTeX for enhanced editing workflows. As alternatives, serves as the primary successor, offering embedded Lua scripting for greater extensibility, dynamic content handling, and web-friendly integrations that XeTeX lacks. For simpler Unicode needs without advanced font features, pdfTeX provides a lightweight option. Emerging engines like HarfTeX, built on with integration, address gaps in complex script shaping for world languages. Community efforts include patches for specific bugs, such as font rendering issues on macOS, though no widespread forks have gained prominence beyond experimental ports like a implementation.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.