Best LaTeX/XeTeX packages
Here’s a curated, “use-it-in-real-life” guide to the most popular and genuinely useful LaTeX/XeTeX packages. This list assumes XeLaTeX and I flag engine caveats where helpful.
Here’s a curated, “use-it-in-real-life” guide to the most popular and genuinely useful LaTeX/XeTeX packages. This list assumes XeLaTeX and I flag engine caveats where helpful.
Core setup (XeTeX-centric)
-
fontspec — load system/OpenType fonts;
\setmainfont{...}, small caps, stylistic sets. (Xe/Lua only) -
polyglossia — multilingual typesetting;
\setmainlanguage{turkish},\setotherlanguage{english}. (Xe/Lua; use babel if you prefer its ecosystem.) -
bidi — proper right-to-left and mixed direction with XeTeX (Arabic/Hebrew). (Xe only; LuaTeX has
luabidi/ built-in support.) -
unicode-math — Unicode input and OpenType math fonts like Latin Modern Math, STIX Two Math. (Xe/Lua; not pdfTeX.)
-
microtype — character protrusion/expansion (better spacing). (Full in pdf/Lua; limited in Xe—protrusion works, expansion mostly off.)
-
geometry — page size, margins, trim; perfect for print/POD specs.
-
xcolor — named/HTML colors, palettes.
-
graphicx — include images;
\includegraphics[width=\textwidth]{...}. -
hyperref — PDF metadata and links; pair with bookmark for robust outlines.
-
csquotes — language-aware quotes, integrates with
biblatex.
Page design & layout
-
fancyhdr — headers/footers (classic). scrlayer-scrpage — headers/footers for KOMA-Script classes.
-
titlesec — section title formatting. (Avoid with KOMA; use KOMA’s built-ins instead.)
-
setspace — line spacing.
-
parskip — no paragraph indent + vertical space.
-
ragged2e — improved ragged/right/left alignment.
-
multicol — balanced newspaper-style columns.
-
tocloft / titletoc — TOC/list formatting.
-
needspace — avoid orphaned headings before page breaks.
Document classes worth knowing
-
KOMA-Script (
scrartcl,scrreprt,scrbook) — modern defaults, great typography, fewer hacks. -
memoir — book/magazine all-in-one with many built-ins.
-
beamer — presentations. (Theme idea: metropolis.)
-
standalone — compile figures/pages (great for covers and TikZ art).
Figures, diagrams, and covers
-
tikz/pgf — vector drawings, shapes, layers; ideal for cover designs.
-
pgfplots — publication-quality plots:
\begin{axis} .... -
graphicx — image placement/scaling.
-
svg — include SVG (converts via Inkscape or rsvg; needs
-shell-escape). -
pdfpages — insert external PDF pages (proofs, front matter).
-
background / eso-pic / wallpaper — full-page backgrounds/watermarks (great for cover images).
-
wrapfig, sidecap — text wrapping around figures; side captions.
-
caption / subcaption — caption styling and subfigures. (Avoid obsolete
subfigure.)
Tables & numbers (print-ready)
-
booktabs — beautiful rules (
\toprule,\midrule,\bottomrule). -
tabularx — table with auto-stretch column (
X). -
longtable / xltabular — multipage tables.
-
array — column definitions (
>{\raggedright\arraybackslash}). -
siunitx — typeset units & align numbers by decimal marker. (Must-have.)
-
multirow, makecell — multirow cells, line breaks in cells.
-
threeparttable — table notes/footnotes that look right.
-
colortbl — colored cells/rows (sparingly in print).
Math, chemistry, physics
-
amsmath, amssymb, mathtools — the core trio; aligned equations, fixes, extras.
-
amsthm / thmtools — theorems/lemmas environments.
-
unicode-math — OpenType math fonts with XeTeX (see above).
-
bm — bold math symbols.
-
siunitx — units, uncertainties, number formatting (again).
-
mhchem — chemical formulae and equations.
-
cancel — strike out terms; physics — handy shortcuts (use judiciously).
-
braket — Dirac notation.
Bibliographies, citations, cross-refs
-
biblatex + biber — modern bibliography/citation framework; APA/Chicago styles available via style options.
-
natbib — classic author-year citations (legacy projects).
-
cleveref — automatic “Figure/Table/Theorem” names:
\cref{fig:...}. -
varioref — page-aware refs (“on the next page”).
-
hyperref — hyperlinks; load last (but before
cleverefconfig), then cleveref.
Lists, boxes, callouts, tips
-
enumitem — fully control list spacing/labels.
-
tcolorbox — gorgeous framed boxes, breakable, skins, verbatim/code integration. (Swiss-army knife for “content-creator style” tip/alert/note cards.)
-
mdframed — simpler framed environments.
-
framed, fancybox — basic frames/shadows.
Code, syntax highlighting, and tech docs
-
minted — Pygments-powered syntax highlighting (hundreds of lexers). Requires
-shell-escapeand Python/Pygments. -
listings — no external deps; fewer languages, plainer output.
-
tcolorbox +
listings— styled code blocks without shell-escape. -
algorithm2e or algorithmicx/algpseudocode — algorithms/pseudocode.
-
bytefield, circuitikz, tikz-cd, forest — networking, circuits, commutative diagrams, trees.
Editorial workflow (drafting, review, production)
-
todonotes — margin TODOs with hyperlinks.
-
changes — track changes (added/deleted/replaced) with author colors.
-
draftwatermark — DRAFT/CONFIDENTIAL watermark.
-
pdfx — PDF/A/X compliance; hyperxmp — embed XMP metadata (author, rights).
-
imakeidx / makeidx — indexes; multiple indexes. glossaries / glossaries-extra — glossary, acronym lists.
-
nomencl — list of symbols.
-
xmpincl (older) — include XMP; prefer hyperxmp now.
Language, localization, accessibility
-
polyglossia — (again) hyphenation, captions (e.g., “Şekil”, “Tablo”). For Turkish:
\setmainlanguage{turkish}ensures correct hyphenation and date formats. -
bidi — bidirectional text with XeTeX.
-
babel — alternative to polyglossia (works in Xe/Lua; bigger ecosystem).
-
accsupp — accessibility support (actual text for symbols). (Full PDF tagging is better in LuaTeX with
tagpdf, but you can still improve accessibility metadata in XeTeX viahyperref+accsupp.)
Automation, modular docs, multi-file projects
-
subfiles — write and compile chapters/parts independently.
-
import — include child files with relative paths.
-
standalone — compile figures/components alone; perfect with TikZ.
-
catchfile, xstring, expl3, xparse, etoolbox — robust macro programming & string ops.
-
pgfkeys — key–value interfaces for your custom commands.
(Build tools you’ll actually use: latexmk for one-command builds, arara for rule-based builds.)
Posters, resumes, forms, schedules (niche but handy)
-
beamerposter / tikzposter — academic posters.
-
moderncv — clean CV templates (class).
-
pgfgantt — Gantt charts/timelines.
-
qrcode — generate QR codes in-doc.
-
acroform (via
hyperref) — simple PDF forms.
“For content creators” quick picks (starter stacks)
A. Clean article/report (XeLaTeX)
\usepackage{fontspec}
\setmainfont{Source Serif 4}
\setsansfont{Source Sans 3}
\setmonofont{JetBrains Mono}
\usepackage{polyglossia}
\setmainlanguage{turkish}
\setotherlanguage{english}
\usepackage{geometry} % set exact trim sizes/margins
\usepackage{xcolor,graphicx}
\usepackage{microtype} % limited in XeTeX but still useful
\usepackage{hyperref}
\usepackage{bookmark}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{siunitx}
\usepackage{booktabs,tabularx,longtable}
\usepackage{caption,subcaption}
\usepackage{tcolorbox}
\usepackage{csquotes}
\usepackage{biblatex}
B. Book/magazine with KOMA-Script
\documentclass[12pt,headings=optiontoaffectothers]{scrbook}
% Prefer KOMA features over titlesec/fancyhdr
\usepackage{scrlayer-scrpage} % headers/footers
\RedeclareSectionCommand[beforeskip=..,afterskip=..]{chapter}
- Use scrlayer-scrpage (not fancyhdr) and KOMA’s
\DeclareNewSectionCommandetc. for a consistent look.
C. Covers & graphic layouts
\usepackage{geometry} % trim/bleed
\usepackage{tikz}
\usepackage{eso-pic} % place full-bleed background
\usepackage{xcolor}
\usepackage{standalone} % compile artwork separately
\usepackage{fontspec}
-
Place a full-page image:
\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{cover-bg.pdf}} -
Use TikZ layers for geometric shapes, patterns, gradients.
D. Slides
- beamer + theme metropolis; for code use minted (enable
-shell-escape) or listings+tcolorbox.
Pitfalls & deprecations (save yourself headaches)
-
inputenc, fontenc: not needed with XeTeX (use fontspec).
-
subfigure: obsolete → use subcaption.
-
times, mathptmx: dated; use newtx family or modern system fonts via fontspec/unicode-math.
-
microtype in XeTeX: expansion mostly disabled; if micro-typography is critical, consider LuaLaTeX.
-
titlesec with KOMA: can conflict—prefer KOMA’s own interfaces.
-
tabu: abandoned; avoid (use
tabularx/xltabular). -
minted: needs
-shell-escape; if that’s impossible (e.g., locked CI), use listings ortcolorboxstyles.
Handy patterns you’ll reuse
Clever references
\usepackage{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref} % \cref{fig:cover}
Tip/Note/Warning boxes
\usepackage[most]{tcolorbox}
\tcbset{sharp corners, breakable, boxrule=0pt, frame hidden, colback=black!3}
\newtcolorbox{tipbox}{colback=green!6}
\newtcolorbox{warnbox}{colback=red!6}
Number alignment in tables
\usepackage{siunitx}
\sisetup{table-number-alignment = center, detect-all}
\begin{tabularx}{\linewidth}{l S[table-format=3.2] X}
\toprule
Item & {Value} & Notes\\
\midrule
Alpha & 10.25 & ...\\
\bottomrule
\end{tabularx}
Bilingual docs (TR–EN)
\usepackage{polyglossia}
\setmainlanguage{turkish}
\setotherlanguage{english}
\newfontfamily\englishfont{Source Serif 4} % optional per-language font
\begin{english}
This is the English abstract...
\end{english}
Bibliography
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{refs.bib}
Quick “shopping list” by goal
-
General quality: fontspec, microtype, geometry, xcolor, graphicx, hyperref, bookmark.
-
Chic tables: booktabs, tabularx, siunitx, threeparttable.
-
Math: amsmath, mathtools, amsthm, unicode-math, bm.
-
Figures: tikz, pgfplots, caption, subcaption, wrapfig.
-
Covers/visuals: tikz, eso-pic, background, standalone, svg.
-
Docs at scale: subfiles, import, imakeidx, glossaries, biblatex.
-
Teaching materials: tcolorbox (exercises/solutions), xsim (exercise management), beamer.
-
Review: todonotes, changes, draftwatermark, pdfx, hyperxmp.
-
Localization: polyglossia (+ bidi if RTL).
Document Classes and Structure
These provide the foundational layout for your PDF documents, such as articles, books, or presentations. They define overall structure, headings, and page elements.
| Package | Description/Function |
|---|---|
memoir | A flexible class for books and reports, offering customizable chapter styles, page layouts, and typography options for professional-looking long documents. |
beamer | Designed for creating presentations (like slides); supports themes, overlays, and multimedia embedding for engaging visual content. |
article, book, report | Built-in classes; article for short papers, book for multi-chapter works with front/back matter, report for technical documents with chapters but no front matter. |
titlesec | Customizes section headings (e.g., fonts, spacing, colors) to enhance document aesthetics. |
subfiles | Allows splitting large documents into sub-files that compile independently, aiding modular content creation. |
Typography and Fonts
Essential for beautiful text rendering, font selection, and micro-adjustments. XeTeX excels here with system font support.
| Package | Description/Function |
|---|---|
fontspec (XeTeX-specific) | Enables use of OpenType/TrueType system fonts; set main fonts with \setmainfont{Font Name} for custom typography in PDFs. |
microtype | Improves text flow with font expansion, protrusion, and kerning; reduces hyphenation for polished, professional PDFs (partial support in XeTeX). |
lmodern | Enhanced version of Computer Modern fonts; better for internationalization and high-quality rendering. |
mathpazo | Uses Palatino fonts with small caps and better kerning; ideal for elegant, readable text. |
xltxtra (XeTeX-specific) | Adds extra features like advanced font handling and OpenType support for complex typography. |
Page Layout and Geometry
Control margins, headers, footers, and overall page design for visually appealing documents.
| Package | Description/Function |
|---|---|
geometry | Easily sets page dimensions and margins (e.g., \usepackage[margin=1in]{geometry}); prevents layout issues like underfull boxes. |
fancyhdr | Customizes headers and footers (e.g., add page numbers, section titles); mimics book-style layouts in any class. |
multicol | Creates multi-column layouts within single-column documents for better content organization. |
parskip | Removes paragraph indentation and adds vertical space; useful for modern, clean document styles. |
savetrees | Compresses text density (modes: subtle, moderate, extreme) to fit more content while maintaining readability, great for page-limited PDFs. |
balance or flushend | Balances column lengths on the last page in two-column documents for a professional finish. |
Mathematics
For typesetting equations, symbols, and theorems; crucial for technical or academic content.
| Package | Description/Function |
|---|---|
amsmath | Provides advanced equation environments (e.g., align, cases) for semantic, well-formatted math. |
amssymb | Adds extensive mathematical symbols; pairs with amsmath for comprehensive notation. |
amsthm | Defines theorem styles and proofs; useful for structured mathematical writing. |
mathtools | Extends amsmath with tools like extensible arrows and centered limits for refined math display. |
bm | Enables bold math symbols for emphasis in equations. |
Graphics and Figures
Incorporate images, diagrams, and plots to enhance visual storytelling in PDFs.
| Package | Description/Function |
|---|---|
graphicx | Includes, scales, and rotates images (e.g., \includegraphics[width=0.5\textwidth]{image}); supports paths for organization. |
tikz | Creates vector graphics and diagrams programmatically; libraries for shapes, 3D, etc., for custom illustrations. |
pgfplots | Builds on tikz for 2D/3D plots; reads data from files (e.g., CSV) for data visualization. |
adjustbox | Scales and adjusts figures (e.g., TikZ plots) to fit widths; improves image integration. |
Tables
Create clean, professional tables with alignment and formatting options.
| Package | Description/Function |
|---|---|
booktabs | Enhances table rules and spacing (e.g., \toprule, \midrule); produces publication-quality tables. |
array | Custom column types in tables for precise formatting. |
tabularx | Auto-adjusts column widths to fit page; flexible for wide tables. |
longtable | Supports tables spanning multiple pages with automatic breaking. |
siunitx | Typesets units and aligns numbers in tables (e.g., \SI{10}{m/s}); ensures consistent scientific notation. |
Bibliographies and Citations
Manage references and create bibliographies for credible, linked content.
| Package | Description/Function |
|---|---|
biblatex | Flexible bibliography styling with Unicode support; uses Biber for sorting. |
natbib | Enhances citation commands; compatible with hyperlinks for clickable references. |
cleveref | Smart referencing (e.g., “Figure 1” without manual type specification); customizable formats. |
glossaries-extra | Generates acronym/symbol lists; expands terms on first use for reader-friendly documents. |
Hyperlinks and PDF Features
Add interactivity and metadata to PDFs for better navigation.
| Package | Description/Function |
|---|---|
hyperref | Creates clickable links, bookmarks, and PDF metadata; makes references and URLs interactive. |
xcolor | Adds color support for text, links, and elements; enhances visual appeal in PDFs. |
Multilingual and Internationalization
Support for multiple languages and scripts, especially in XeTeX.
| Package | Description/Function |
|---|---|
polyglossia (XeTeX-preferred) | Handles language switching and hyphenation; replacement for babel in XeTeX for better Unicode support. |
babel | Provides multilingual hyphenation and text patterns; use with pdfLaTeX, or switch to polyglossia for XeTeX. |
noto | Uses Google Noto fonts for broad script coverage; ideal for international documents. |
inputenc | Handles UTF-8 input encoding; obsolete in modern LaTeX but useful for legacy setups. |
Code Listings
Display source code with highlighting for technical writing.
| Package | Description/Function |
|---|---|
listings | Typesets code with syntax highlighting; supports many languages and external file inclusion. |
Quotes and Notes
Improve readability with proper quotations and annotations.
| Package | Description/Function |
|---|---|
csquotes | Manages context-sensitive quotes (e.g., \enquote{text}); handles nesting automatically. |
todonotes | Adds margin notes and to-do lists; useful for drafting and revisions. |
marginnote (with mparhack, marginfix) | Places notes in margins; fixes positioning issues for clean annotations. |
Other Utilities
Miscellaneous tools for productivity and best practices.
| Package | Description/Function |
|---|---|
nag | Warns about deprecated LaTeX code; promotes modern, error-free documents. |
fixltx2e | Fixes LaTeX kernel bugs; obsolete post-2015 but useful for older setups. |
onlyamsmath | Enforces use of amsmath environments; improves math consistency. |
Document Classes & Basic Setup
Document Classes
-
article,report,book- Standard LaTeX classes for different document types -
memoir- Highly customizable class combining book, report, and article features -
scrartcl,scrreprt,scrbook(KOMA-Script) - European-style document classes with enhanced typography -
beamer- Professional presentations and slides -
moderncv- Modern curriculum vitae/resume templates
Page Layout & Geometry
-
geometry- Easy page margin and paper size configuration -
fancyhdr- Custom headers and footers with full control -
titlepage- Enhanced title page creation -
multicol- Multi-column layouts within documents -
pdflscape- Landscape pages in portrait documents
Typography & Fonts
Font Packages
-
fontspec(XeTeX/LuaTeX) - Use system fonts and OpenType features -
mathptmx- Times Roman with math support -
lmodern- Latin Modern fonts (improved Computer Modern) -
libertine- Linux Libertine and Biolinum fonts -
roboto- Google’s Roboto font family -
sourcecodepro- Adobe’s Source Code Pro for code listings
Typography Enhancement
-
microtype- Subtle typographic refinements (kerning, spacing) -
lettrine- Drop capitals and decorative initials -
parskip- Control paragraph spacing without indentation -
setspace- Line spacing control (double spacing, etc.) -
ragged2e- Better text justification options
Mathematics & Science
Core Math
-
amsmath- Essential AMS mathematics enhancements -
amssymb- Additional mathematical symbols -
amsthm- Theorem environments -
mathtools- Extension and fixes for amsmath -
unicode-math(XeTeX/LuaTeX) - Unicode mathematics support
Advanced Math & Science
-
siunitx- Typeset SI units and numbers correctly -
physics- Simplified commands for physics notation -
chemfig- Draw chemical structures -
mhchem- Chemical equations and formulas -
tikz-cd- Commutative diagrams
Graphics & Visualization
Core Graphics
-
graphicx- Include external images (PNG, JPG, PDF) -
tikz- Powerful graphics programming language -
pgfplots- Publication-quality plots and charts -
svg- Include and manipulate SVG files -
wrapfig- Wrap text around figures
Specialized Diagrams
-
circuitikz- Electrical circuit diagrams -
forest- Tree diagrams with automatic layout -
chronology- Timeline diagrams -
ganttchart- Gantt charts for project management -
smartdiagram- Quick diagrams (flow, circular, etc.)
Tables & Data Presentation
Table Creation
-
booktabs- Professional-quality tables with proper spacing -
longtable- Tables spanning multiple pages -
tabularx- Tables with calculated column widths -
multirow- Cells spanning multiple rows -
array- Enhanced column specifications
Advanced Tables
-
colortbl- Colored table cells and rows -
threeparttable- Tables with notes and captions -
ctable- Centered, captioned tables with footnotes -
pgfplotstable- Generate tables from data files -
spreadtab- Spreadsheet-like calculations in tables
Code & Listings
Code Display
-
listings- Syntax highlighting for many languages -
minted- Pygments-based syntax highlighting (requires Python) -
algorithm2e- Algorithm pseudocode with customizable style -
algorithmicx- Another algorithm typesetting package -
verbatim- Improved verbatim text handling
Color & Design
Color Management
-
xcolor- Extended color support with mixing and models -
pagecolor- Colored page backgrounds -
transparent- Transparency effects -
gradient- Color gradients
Design Elements
-
fancybox- Decorative boxes and frames -
tcolorbox- Highly customizable colored boxes -
mdframed- Framed environments with breakable boxes -
shadethm- Shaded theorem environments
References & Citations
Bibliography
-
biblatex- Modern bibliography management -
natbib- Natural sciences citations -
biber- Unicode-aware bibliography processor (with biblatex) -
apacite- APA style citations -
chicago- Chicago Manual of Style
Cross-references
-
hyperref- Hyperlinks and PDF features -
cleveref- Intelligent cross-references -
nameref- Reference sections by name -
varioref- Page-aware references (“on the next page”)
Language & Internationalization
Multilingual Support
-
babel- Multilingual documents with hyphenation -
polyglossia(XeTeX/LuaTeX) - Modern multilingual typesetting -
CJKutf8- Chinese, Japanese, Korean support -
arabxetex- Arabic script support -
fontenc- Font encoding selection
Text Processing
-
csquotes- Context-sensitive quotation marks -
foreign- Typeset foreign language phrases -
translator- Translate document elements
Document Organization
Structure
-
titlesec- Customize section headings -
titletoc- Customize table of contents -
appendix- Enhanced appendix handling -
minitoc- Mini tables of contents -
glossaries- Create glossaries and lists of acronyms
Notes & Annotations
-
footnote- Enhanced footnote handling -
marginnote- Notes in margins -
todonotes- Inline and margin TODO notes -
changes- Track document changes -
pdfcomment- PDF annotations and comments
Floats & Captions
Float Management
-
float- Define new float types -
subfig- Subfigures and subtables -
subcaption- Modern subfigure support -
caption- Customize caption formatting -
placeins- Control float placement barriers
Special Document Types
Academic Writing
-
thesis- Thesis and dissertation templates -
exam- Create exams and solution sheets -
homework- Homework assignment templates -
tikzposter- Scientific conference posters
Business Documents
-
invoice- Generate invoices -
letter- Formal letters -
scrlttr2(KOMA-Script) - Advanced letter class -
leaflet- Folded brochures and leaflets
Utility Packages
Automation & Programming
-
etoolbox- Programming tools for LaTeX -
xparse- Define document commands -
pgffor- For loops and iterations -
ifthen- Conditional statements -
calc- Arithmetic in LaTeX
Document Information
-
datetime2- Date and time formatting -
lastpage- Reference the last page number -
totcount- Count totals (pages, figures, etc.) -
currfile- Current file information
XeTeX-Specific Packages
Advanced Typography
-
xltxtra- XeLaTeX extras -
xunicode- Unicode support extras -
xeCJK- Advanced CJK typesetting -
bidi- Bidirectional typesetting
Best Practices Tips
-
Essential Starting Set:
geometry,graphicx,hyperref,xcolor,amsmath,booktabs,microtype -
For XeTeX/LuaTeX: Always use
fontspecinstead of traditional font packages -
Package Loading Order: Load
hyperreflast (with few exceptions likecleveref) -
Modern Choices: Prefer
biblatexoverbibtex,subcaptionoversubfig,tcolorboxover older box packages
This comprehensive list should give you the tools to create any type of professional document, from academic papers to business reports, technical documentation to creative layouts. Each package typically has extensive documentation available through CTAN (Comprehensive TeX Archive Network) or by running texdoc packagename in your terminal.
Enjoyed this post?
Follow along for more articles about language, AI, and tech experiments.