Skip to content
LaTeX

LaTeX

Distributions

  • TeX Live: The most mainstream and versatile distribution, supporting Linux, macOS, and Windows. This is what the texlive-* packages in most Linux distributions provide. Suitable for servers, CI, Linux/macOS/cross-platform projects. The TeX Users Group also refers to MiKTeX as the other major free TeX distribution alongside TeX Live.
  • MacTeX: The most recommended choice on macOS — essentially TeX Live packaged for Mac, bundled with Mac-related tools like TeXShop, BibDesk, and Ghostscript.
  • BasicTeX: A slimmed-down version of MacTeX, also based on TeX Live. Ideal for those who don’t want to install a multi-GB package and prefer to install missing components on demand.
  • MiKTeX: Very popular among Windows users, also supports Linux/macOS. Key features include on-demand installation of missing packages and a relatively user-friendly GUI management experience. Best suited for Windows desktop users.
  • TinyTeX: A lightweight LaTeX distribution based on TeX Live. Cross-platform, portable, and especially suited for R Markdown / Quarto / Pandoc / CI scenarios.
  • Tectonic: A modern, single-binary TeX/LaTeX engine based on XeTeX and TeX Live resources. Focuses on automatic dependency downloads, reproducible builds, and minimal configuration. It’s more of a “modern LaTeX build toolchain” rather than a traditional full-scale distribution.
  • ConTeXt Standalone / ConTeXt Suite: Primarily aimed at ConTeXt users, not the first choice for traditional LaTeX users. It’s a complete, independently updatable ConTeXt distribution that can coexist with an existing TeX Live installation.
  • Historically there were also teTeX, proTeXt, fpTeX, gwTeX, etc., but these are generally not recommended for new installations today. For example, teTeX has ceased maintenance and has since been succeeded by TeX Live.

Underlying Engines

  • pdfLaTeX: Previously the most mainstream LaTeX engine. Advantages: stable, fast, best compatibility. Disadvantages: poor native Unicode and system font support. Chinese documents require packages like CJK and ctex, which are less natural compared to XeLaTeX / LuaLaTeX.
  • XeLaTeX: Its biggest feature is native Unicode and system font support — you can directly use system fonts like Song, Source Han Sans, Times New Roman. Extremely common in Chinese documents.
  • LuaLaTeX: A more modern direction, supporting Unicode, OpenType fonts, and also embedding Lua scripting capabilities for more complex typesetting automation. It’s considered one of the recommended directions for the future, though template compatibility may sometimes lag behind pdfLaTeX / XeLaTeX.

Installing TeX Live on Linux

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
cd /tmp

# Download the installer
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-2026 # year changes over time

# Install
sudo perl ./install-tl \
  --no-interaction \
  --scheme=small \
  --no-doc-install \
  --no-src-install

# Configure
TL_YEAR=$(ls /usr/local/texlive | sort -n | tail -1) # get the current installed year version
echo "export PATH=/usr/local/texlive/$TL_YEAR/bin/x86_64-linux:\$PATH" >> ~/.bashrc # add to PATH
source ~/.bashrc

# Verify
lualatex --version
tlmgr --version

Recommended Must-Have Packages

Math Formulas

PackageDescriptionInstall Command
amsmathCore math environments such as align, cases — almost essentialtlmgr install amsmath
mathtoolsSuperset of amsmath, fixes known bugs and extends with more commandstlmgr install mathtools
amsfonts / amssymbMath symbols like ℝ ∀ ∈, \mathbb blackboard bold font familytlmgr install amsfonts
unicode-mathUse Unicode math fonts under XeLaTeX/LuaLaTeXtlmgr install unicode-math
physics\dv, \pdv derivatives, Dirac brackets, and other physics convenience commandstlmgr install physics
bm\bm{} math bold, more robust than \boldsymboltlmgr install bm

Graphics & Drawing

PackageDescriptionInstall Command
graphicx\includegraphics for inserting images — almost essentialtlmgr install graphics
tikz / pgfVector drawing language for flowcharts, circuit diagrams, mind maps, etc.tlmgr install pgf
pgfplotsScientific data charts based on TikZ (line/bar/polar plots)tlmgr install pgfplots
floatThe H option forces float placement — figures and tables stay puttlmgr install float
subcaptionSide-by-side subfigures with independent numbering, replaces the legacy subfigtlmgr install caption
wrapfigText-wrapped figure layoutstlmgr install wrapfig

Tables

PackageDescriptionInstall Command
booktabsThree-line tables (\toprule \midrule \bottomrule) — standard for academic paperstlmgr install booktabs
tabularxThe X column auto-fills remaining width — no more manual column width calculationstlmgr install tabularx
multirow\multirow for cells spanning multiple rowstlmgr install multirow
longtableMulti-page tables with automatic page breakstlmgr install longtable
array>{}<{} column pre/post hooks, extended p/m/b column typestlmgr install array
tabularrayA new-generation table package with a more intuitive syntax — recommended for new projectstlmgr install tabularray

Bibliographies & References

PackageDescriptionInstall Command
biblatexModern bibliography management, supports styles like GB/T, APA, Chicagotlmgr install biblatex
biberRecommended BibLaTeX backend, replacing the legacy BibTeXtlmgr install biber
natbib\citet{}, \citep{} for natural science citation formatstlmgr install natbib

Chinese Language Support

PackageDescriptionInstall Command
ctexAll-in-one Chinese typesetting: fonts, punctuation, layout — one-stop configurationtlmgr install ctex
xeCJKFine-grained control over Chinese/English mixed-line spacing under XeLaTeXtlmgr install xecjk
zhnumberChinese numeral formatting: 一, 二, 三… automatic chapter number conversiontlmgr install zhnumber

Code Typesetting

PackageDescriptionInstall Command
listingsCode syntax highlighting, supports 50+ languages, highly customizabletlmgr install listings
mintedBeautiful code highlighting via Pygments (requires Python)tlmgr install minted
fancyvrbEnhanced verbatim environment with line numbers and framestlmgr install fancyvrb

Page Layout

PackageDescriptionInstall Command
geometryPage dimensions and margin settings — safer than setting parameters manuallytlmgr install geometry
fancyhdrCustom headers/footers with automatic chapter name insertiontlmgr install fancyhdr
titlesecDeep customization of section title fonts, colors, and spacingtlmgr install titlesec
setspace1.5× / double line spacing — commonly used for thesis formattingtlmgr install setspace
parskipParagraph spacing instead of first-line indentation — European typesetting styletlmgr install parskip

Hyperlinks

PackageDescriptionInstall Command
hyperrefPDF hyperlinks, bookmarks, metadata — must be loaded lasttlmgr install hyperref
cleveref\cref{} auto-adds prefixes like “fig.”, “table”, “section” — load after hyperreftlmgr install cleveref
xurlLine-break URLs at any character to prevent overflow beyond page boundariestlmgr install xurl

Fonts & Colors

PackageDescriptionInstall Command
fontspecLoad system OpenType fonts under XeLaTeX/LuaLaTeXtlmgr install fontspec
xcolorColor support; [svgnames] enables 147 standard color namestlmgr install xcolor
microtypeCharacter protrusion and micro-spacing adjustments — significantly improves paragraph typesetting qualitytlmgr install microtype

Utility Packages

PackageDescriptionInstall Command
enumitemFull list customization: spacing, label format, nesting levelstlmgr install enumitem
siunitx\SI{9.8}{\metre\per\second\squared} for physical unit typesettingtlmgr install siunitx
csquotesLanguage-aware smart quotes, essential companion to biblatextlmgr install csquotes
tcolorboxColored info boxes, theorem boxes, sidebar highlight decorationstlmgr install tcolorbox
todonotes\todo{} margin notes for to-dos — invaluable during the writing and revision phasetlmgr install todonotes
soulText decoration effects like \hl{highlight}, \st{strikethrough}tlmgr install soul

Important Notes

  • Load order: xcolorgraphicxamsmathhyperref (last) → cleveref (after hyperref)
  • Chinese users: Just install ctex directly — no need to separately install xeCJK
  • Bibliography: Recommended combination is biblatex + biber, paired with the gb7714-2015 style for Chinese-language references
  • Check installed packages: tlmgr info <package-name>
Last updated on