Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX Distribution Setup: Complete Guide to TeX Live, MiKTeX, and MacTeX

A complete guide to choosing, installing, and managing a LaTeX distribution for research, comparing TeX Live, MiKTeX, and MacTeX across major platforms.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

A LaTeX distribution is a complete software suite that packages the TeX typesetting engine, the LaTeX macro format, standard font metrics, hyphenation patterns, compilation utilities, and thousands of community packages from the Comprehensive TeX Archive Network (CTAN). Rather than requiring researchers to build typesetting binaries from source code or manually configure font metrics, a LaTeX distribution provides an integrated compiler environment that converts plain-text markup into publication-quality PDF documents for academic journals, conference proceedings, dissertations, and technical monographs.

In academic workflows, researchers typically interact with LaTeX through dedicated editors such as TeXstudio, TeXworks, or Visual Studio Code. However, an editor cannot compile documents on its own; it depends entirely on the local LaTeX distribution to execute compiler passes, manage bibliography processing, and locate system fonts. Understanding how a distribution functions, how its package trees are structured, and how to maintain it across operating systems ensures reliable document compilation and reproducible research pipelines.

What a LaTeX distribution is used for in research

In scholarly research, a LaTeX distribution operates as the backend compiler for document generation, enforcing typographical precision across complex mathematical notation, chemical diagrams, and structured bibliographies. Unlike word processors that format text dynamically via a graphical interface, LaTeX compiles declarative markup into vector output using deterministic typesetting algorithms designed for publication consistency.

The modern LaTeX software stack comprises three distinct operational layers:

  • The Archive (CTAN): The Comprehensive TeX Archive Network serves as the global public repository holding thousands of macro packages, document classes, and font collections.
  • The Distribution (TeX Live, MiKTeX, MacTeX): The distribution packages CTAN assets into a functional operating system environment, supplying precompiled binaries, directory structures, and package managers.
  • The Editor or Front-End (TeXstudio, VS Code, TeXworks): The front-end editor provides an interface for authoring code, syntax highlighting, and invoking distribution commands.

Every standard distribution organizes its assets according to the TeX Directory Structure (TDS). Key trees include texmf-dist for upstream packages and documentation, texmf-var for dynamically generated formats and font caches, texmf-config for user configuration files, and texmf-local for institution-wide classes and custom style files that survive distribution updates.

Local distributions provide unconstrained computational resources for heavy rendering tasks, seamless Git version control integration, and an offline alternative when cloud services hit barriers such as Overleaf compilation timeout errors. Researchers retain direct control over compilation flags, shell-escape utilities, and exact package versions.

How to install or access a LaTeX distribution

Accessing a LaTeX distribution requires installing an official release matching your operating system. The primary distributions used across academic institutions are TeX Live, MiKTeX, and MacTeX.

Installing TeX Live on Linux

TeX Live is the comprehensive cross-platform distribution maintained by the TeX Users Group (TUG). On Linux workstations, researchers can install TeX Live via the official network installer or the system package manager:

  1. Download the network installer archive install-tl-unx.tar.gz from the official TUG portal.
  2. Extract the archive and run the installer script via perl install-tl (or sudo perl install-tl for system-wide installation).
  3. Select your desired installation scheme (scheme-full for complete package coverage, or scheme-small for a lightweight footprint).
  4. Add the binary directory (such as /usr/local/texlive/2026/bin/x86_64-linux) to your environment PATH.

Alternatively, Debian and Ubuntu users can install packaged builds via the terminal with sudo apt update ; sudo apt install texlive-full, though package updates remain pinned to official distribution release cycles.

Installing MiKTeX on Windows

MiKTeX is an open-source distribution optimized for Windows that provides on-the-fly package installation, fetching missing CTAN packages automatically during document compilation:

  1. Download the Basic MiKTeX Installer from the official MiKTeX portal.
  2. Run the setup wizard, selecting either a private single-user setup or a system-wide deployment.
  3. Set the on-the-fly package policy to ‘Yes’ for automatic background installation or ‘Ask me first’ for interactive confirmation prompts.
  4. Launch the MiKTeX Console after setup, navigate to the Updates tab, and run a check to synchronize the local package database.

Installing MacTeX on macOS

MacTeX is the dedicated macOS distribution distributed by the TeX Users Group, bundling the full TeX Live tree with native macOS utilities:

  1. Download MacTeX.pkg from the official TUG MacTeX distribution portal.
  2. Execute the installer package, which places binaries in /usr/local/texlive/2026 and creates symlinks in /Library/TeX/texbin.
  3. Access bundled GUI utilities located in /Applications/TeX/, including TeXShop and BibDesk.
  4. For disk-constrained Apple systems, install BasicTeX instead, which provides a compact 110 MB core distribution manageable through tlmgr.

How to compile a research document step by step

Compiling a research manuscript involves coordinating typesetting engines and bibliographic processors across multiple passes to resolve labels, citations, and structural cross-references.

  1. Initialize the project workspace: Create a project folder containing the root manuscript (manuscript.tex), a figures directory, and your bibliography file (references.bib).
  2. Author the root document: Structure the source file declaring class options, packages, and citation callouts:
    \documentclass[11pt,a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath,amssymb}
    \usepackage{graphicx}
    \usepackage[backend=biber,style=numeric]{biblatex}
    \addbibresource{references.bib}
    \title{Empirical Analysis of Computational Models}
    \author{Research Team}
    \begin{document}
    \maketitle
    \section{Introduction}
    Reproducible analysis requires verified software environments \cite{knuth1984}.
    \printbibliography
    \end{document}
  3. Verify bibliographic entries: Confirm that references.bib adheres to standard BibTeX file structure, ensuring citation keys match \cite{} commands in text.
  4. Select the compilation engine: Match the engine to your formatting and font requirements:
    • pdflatex: The standard engine for established journal pipelines, generating direct PDF output with support for 8-bit European fonts and microtypography.
    • xelatex: The Unicode-native engine designed for multilingual typography and direct loading of OpenType and TrueType operating system fonts.
    • lualatex: The modern Lua-embedded engine that expands memory limitations for massive bibliographies, executes embedded Lua scripts, and supports advanced font features.
  5. Execute the multi-pass compilation sequence: Resolve cross-references and citations through sequential passes:
    • Pass 1: Run pdflatex manuscript.tex to parse structure, write initial pages, and generate manuscript.aux recording citation keys.
    • Pass 2: Run biber manuscript (or bibtex manuscript depending on chosen LaTeX bibliography styles) to process citation requests and output formatted entries to manuscript.bbl.
    • Pass 3: Run pdflatex manuscript.tex to incorporate bibliography entries and update citation markers.
    • Pass 4: Run pdflatex manuscript.tex once more to finalize page cross-references, table of contents pagination, and hyperlink destinations.
  6. Automate with latexmk: Simplify multi-pass workflows by executing latexmk -pdf -synctex=1 manuscript.tex. The build utility tracks auxiliary file changes and automatically runs the required compilation passes to compile LaTeX documents locally.

How to read the output

Executing a LaTeX compilation command produces a primary document (manuscript.pdf), real-time terminal output, and several auxiliary data files. Reading these outputs correctly allows researchers to diagnose structural document errors quickly.

Auxiliary File Functions

  • .aux: Stores internal state between passes, including cross-reference labels, citation keys, and section numbers.
  • .log: The complete execution log detailing engine banners, loaded package paths, font metrics, and diagnostic messages.
  • .bbl and .blg: The formatted bibliography data file and its corresponding generation log produced by Biber or BibTeX.
  • .toc, .lof, .lot: Cached entries for tables of contents, figures, and tables from prior compiler passes.
  • .synctex.gz: Coordinate mapping data enabling synchronized navigation between editor source lines and PDF locations.

Interpreting Compiler Warnings and Errors

  • Fatal Errors (!): An exclamation mark signals a fatal condition that halts typesetting, such as ! Undefined control sequence (an unimported package or misspelled macro) or unclosed environments. The terminal displays the source file line number responsible.
  • Box Violations: Overfull \hbox alerts indicate text spilling past margin boundaries, often caused by long URLs or unbroken mathematical expressions. Underfull \hbox indicates loose spacing where the engine stretched text to fill a line.
  • Undefined References: LaTeX Warning: Reference undefined indicates that a label has not yet been resolved in .aux, requiring an additional compilation pass.

Troubleshooting a LaTeX distribution

Common distribution issues involve missing package dependencies, misconfigured PATH variables, or stale filename databases.

Handling Missing Package Errors

When compilation halts with ! LaTeX Error: File '.sty' not found, the distribution cannot find the required package in its TDS search path.

  • TeX Live: Run tlmgr install from the command line, or locate the package providing a specific file using tlmgr search --global --file .sty.
  • MiKTeX: Open MiKTeX Console, navigate to Packages, search for the package, and select Install. Ensure that ‘Install missing packages on the fly’ is enabled under Settings.
  • Refreshing Databases: After adding manual style files to texmf-local, refresh the distribution filename database by running mktexlsr in TeX Live or initexmf --update-fndb in MiKTeX.

Fixing PATH and Execution Errors

If commands such as pdflatex or latexmk return ‘command not found’, verify that your operating system PATH includes the binary path:

  • On Linux, add the binary path (e.g., /usr/local/texlive/2026/bin/x86_64-linux) to your shell profile.
  • On macOS, verify that /Library/TeX/texbin is configured in /etc/paths or exported in your shell configuration.
  • On Windows, confirm that the MiKTeX or TeX Live bin folder is registered in the system Environment Variables.

Updating Packages and Clearing Formats

Resolving macro conflicts between packages requires keeping package versions current:

  • In TeX Live, update all packages using tlmgr update --self --all.
  • In MiKTeX, open MiKTeX Console and check for updates in the Updates tab.
  • If format files become corrupted after updates, rebuild engine dumps with fmtutil-sys --all in TeX Live or initexmf --dump in MiKTeX.

Free alternatives to a LaTeX distribution

While a local LaTeX distribution offers unconstrained execution and offline reliability, researchers have several free alternatives depending on their collaboration requirements and storage limitations. The data table below compares these alternatives across operational criteria.

Alternative Platform Software Architecture Local Disk Requirement Offline Capability Ecosystem Compatibility Primary Research Application
Overleaf Community Edition Cloud web platform None (browser client) No (online required) Full CTAN TeX Live container Collaborative multi-author manuscript drafting without local distribution maintenance.
Typst Modern CLI typesetting engine Under 50 MB Yes Dedicated Typst package registry Rapid technical report preparation and papers where standard LaTeX publisher templates are not required.
Pandoc with Typst or PDF Engine Document conversion utility Under 150 MB Yes Markdown with template extensions Converting research notes, grant summaries, and reports between Markdown, PDF, and HTML formats.
BasicTeX Minimal TeX Live subset Around 110 MB Yes Selective CTAN via tlmgr Storage-constrained macOS environments needing native engines without full 9 GB packages.
Containerized TeX Live (Docker) Container runtime image 3 to 5 GB image Yes Fixed TeX Live release snapshot Automated continuous integration build verification and reproducible computational pipelines.

For submissions to IEEE, ACM, Springer, or Elsevier journals, maintaining a standard LaTeX distribution remains standard practice because publisher editorial systems require source LaTeX files and official document classes.

Frequently asked questions

What is the difference between a LaTeX distribution and a LaTeX editor?

A LaTeX distribution is the backend compiler system (such as TeX Live or MiKTeX) containing typesetting binaries, font metrics, hyphenation dictionaries, and CTAN macro packages needed to turn markup into a PDF. A LaTeX editor is a user-facing text editing program (such as TeXstudio, TeXworks, or VS Code) where researchers write source code and trigger compilation commands. An editor requires an installed distribution to build documents.

What is the best LaTeX distribution?

The best distribution depends on operating system and storage constraints. On Linux, TeX Live is the standard choice, offering complete package availability and robust command-line tooling. On macOS, MacTeX delivers a full TeX Live installation with native Apple utilities. On Windows, MiKTeX is popular for its dynamic on-the-fly package installation and intuitive MiKTeX Console, while TeX Live for Windows is favored for offline consistency with Linux servers.

Do I need to install a LaTeX distribution?

Installing a local distribution is not necessary if you write research documents using cloud platforms like Overleaf, which provide pre-installed server-side TeX Live environments. However, researchers working offline, managing restricted datasets that cannot be hosted on third-party cloud servers, or automating document generation via scripts require a local distribution.

How do I install LaTeX on Windows, Mac, or Linux?

On Windows, install Basic MiKTeX from miktex.org or TeX Live via the TUG network installer. On macOS, download MacTeX from tug.org/mactex (or install BasicTeX using Homebrew). On Linux, install complete TeX Live through your system package manager (such as sudo apt install texlive-full on Ubuntu) or execute the official install-tl script from TUG.

How do I update packages in my LaTeX distribution?

In TeX Live, update packages from the command line by executing tlmgr update --self --all. In MiKTeX, open the MiKTeX Console application, select the Updates tab, click ‘Check for updates’, and apply available updates. Regular updates ensure compatibility with current journal templates and bug fixes.

Sources

Data: LaTeX Distribution Architectural and Operational Specifications

Comparative technical specifications of major TeX and LaTeX distributions compiled from official TeX Users Group documentation, MiKTeX project manuals, and CTAN guidelines, detailing package architectures, storage footprints, and administrative tooling.

LaTeX Distribution Architectural and Operational Specifications
Distribution NamePrimary PlatformPackage Management CLIDynamic On-The-Fly InstallationBase Disk Footprint (GB)Default Typesetting EngineAdministrative GUISoftware License
TeX LiveCross-platform (Linux, Windows, Unix)tlmgrNo (requires manual tlmgr install or pre-install)8.5pdfTeX (with XeTeX and LuaTeX bundled)tlshell / tlcockpit (optional)LPPL, GPL, and free software licenses
MiKTeXWindows, macOS, LinuxmpmYes (automatic background download or user prompt)0.3pdfTeX (with XeTeX and LuaTeX bundled)MiKTeX ConsoleGPL and free software licenses
MacTeXmacOS (Apple Silicon and Intel)tlmgrNo (installs full TeX Live tree)9.2pdfTeX (with XeTeX and LuaTeX bundled)TeX Live UtilityLPPL, GPL, and free software licenses
BasicTeXmacOStlmgrNo (requires tlmgr install for extra packages)0.11pdfTeX (with XeTeX and LuaTeX bundled)None (CLI tlmgr)LPPL, GPL, and free software licenses
TeX Live Small SchemeCross-platform (Linux, Windows)tlmgrNo (requires tlmgr install for extra packages)0.45pdfTeX (with basic macros)None (CLI tlmgr)LPPL, GPL, and free software licenses

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about LaTeX Distribution Setup: Complete Guide to TeX Live, MiKTeX, and MacTeX

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →