Choosing a TeX Engine for Unicode and OpenType Font Support
A decision guide for selecting pdfTeX, XeTeX, or LuaTeX when a document needs full Unicode and OpenType font support, with a concrete LuaTeX setup and validation steps.
17 Aug 2026, 07:32 UTC

Decision and constraints
When starting a new document you need full Unicode coverage, the ability to use any OpenType system font, and continued compatibility with the majority of LaTeX packages. The choice of TeX engine determines how these requirements are met.
Supported options
| Engine | Unicode support | Font handling | Lua scripting | Maturity | Typical use |
|---|---|---|---|---|---|
| pdfTeX | Limited (requires inputenc/fontenc for UTF‑8) | 8‑bit TFM; needs fontenc for T1 encoding | No | Very high | Traditional PDF output, maximal package compatibility |
| XeTeX | Native UTF‑8 | System fonts via fontspec | No | High | Font‑rich documents, straightforward OpenType access |
| LuaTeX | Native UTF‑8 | System fonts via fontspec; direct access to OpenType tables | Yes (Lua 5.3+) | Growing | Advanced typesetting, microtypography, programmable layout |
Trade‑offs
- pdfTeX compiles fastest and works with virtually every legacy package, but Unicode and OpenType features require extra layers and cannot be accessed directly.
- XeTeX simplifies font selection with
fontspecand provides solid Unicode support, yet it lacks a programmable extension point, limiting deep microtypographic tweaks. - LuaTeX combines native Unicode, full OpenType access, and an embedded Lua interpreter, enabling sophisticated adjustments (e.g., character protrusion, font expansion, custom layout). The trade‑off is a slightly longer startup time and occasional incompatibilities with packages that rely on pdfTeX‑specific primitives.
For a project that demands both OpenType flexibility and the ability to run Lua code for microtypography, LuaTeX is the most suitable engine, provided you use a recent TeX distribution (TeX Live 2022 or newer, or MikTeX equivalent).
Concrete LuaTeX implementation
The following minimal example shows how to load an OpenType system font, enable basic microtypography, and include a Unicode string.
\documentclass{article}
\usepackage{fontspec}% loads OpenType system fonts
\setmainfont{Linux Libertine O}% replace with any installed OTF/TTF
\usepackage{microtype}% enables protrusion and expansion
\begin{document}
Hello, world! 𝔘𝔫𝔦𝔠𝔬𝔡𝔢
\end{document}
Save the snippet as demo.tex and compile with:
lualatex demo.tex
Run the command in a terminal where your TeX distribution’s lualatex binary is on the PATH. No special privileges are required; the process reads fonts from your user or system font directories.
Validation steps
- Check the console output: a successful run ends with a line similar to
Output written on demo.pdf (1 page, 20580 bytes)and contains no!error lines. - Inspect the generated PDF’s font table. Using
pdffonts(from Poppler) you can verify embedding:
Look for an entry where the font name containspdffonts demo.pdfLinuxLibertineO(or the font you selected), the type isTrueTypeorOpenType, and the emb column showsyes. - Open
demo.pdf in a viewer that displays font information (e.g., Adobe Reader → File → Properties → Fonts) and confirm that the Unicode characters 𝔘𝔫𝔦𝔠𝔬𝔡𝔢 appear correctly and are rendered with the chosen OpenType font. - Optionally run
luaotfload-tool -f -vto list the fonts loaded by LuaTeX and ensure no “font not found” warnings appear for the selected font.
Limitations and practical checks
Some older packages that depend on pdfTeX‑specific primitives (e.g., certain microtype expansions) may need updates or compatibility layers when used with LuaTeX. If you encounter a package error, consult the package’s documentation for a LuaTeX‑compatible version or consider loading luatex85 as a compatibility layer.
To confirm that your TeX distribution is recent enough, run:
lualatex --version
The output should show a version number from 2022 or later (e.g., This is LuaTeX, Version 1.16.0). Older versions may lack the latest fontspec and luaotfload improvements.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.