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

LaTeX on macOS: Complete Installation, Command-Line and TeXShop Guide

Complete guide to running LaTeX on macOS: MacTeX and BasicTeX setup, zsh path configuration, Terminal and TeXShop compilation, tlmgr, and troubleshooting.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

Running LaTeX on macOS provides academic researchers and quantitative analysts with an enterprise-grade, offline mathematical typesetting environment integrated directly into Apple’s Unix-based Darwin operating system. By combining the official TeX Live distribution packaged as MacTeX or BasicTeX with native front-ends like TeXShop or command-line tools in zsh Terminal, researchers can compose complex monographs, multi-file dissertations, and peer-reviewed journal manuscripts with full control over typographical standards, bibliography databases, and cross-references. For researchers evaluating editing software across the Apple ecosystem, our guide to native macOS LaTeX editors examines standalone desktop editing environments.

What it is used for in research

LaTeX is the international standard for technical typesetting across STEM disciplines, quantitative economics, computational linguistics, and formal philosophy. On macOS, LaTeX bridges Unix terminal flexibility with Apple Quartz graphics rendering, delivering several structural advantages for scientific research teams:

  • Deterministic Typesetting and Formula Formatting: Academic publishers and preprint servers expect camera-ready submissions. LaTeX formats multi-line mathematical proofs, matrices, and chemical notation according to rigorous typographical standards, eliminating pagination shifts and font reflow errors common in commercial word processors.
  • Modular Document Structuring: Long-form research projects such as doctoral dissertations, grant proposals, and book monographs easily exceed hundreds of pages. LaTeX allows researchers to split projects across logical chapter subfiles using input{} and include{} directives while preserving continuous equation numbering, figure indexes, and citation keys.
  • Automated Bibliographic Integration: Working with reference engines such as BibTeX and Biber, LaTeX parses .bib databases and formats citations according to APA, IEEE, Chicago, or custom journal specifications without manual re-entry. For researchers managing persistent identifiers, understanding how a Crossref DOI resolves metadata ensures clean citation parsing in bibliography styles.
  • Reproducible Computational Pipelines: Modern empirical workflows link data analysis directly to manuscript production. macOS researchers embed LaTeX engines into automated pipelines, calling command-line compilers like pdflatex or latexmk from shell scripts, Makefiles, RStudio (via knitr), and Quarto documents.
  • Native Apple Silicon Architecture: Current macOS releases compile TeX documents using Universal Darwin binaries compiled natively for Apple Silicon (M1, M2, M3, and M4 series processors) and legacy Intel x86_64 systems, delivering rapid processing of vector graphics and multi-page compilations without translation latency.

How to install or access it

Installing LaTeX on macOS requires obtaining an official TeX distribution rather than a single standalone application. The TeX Users Group (TUG) maintains MacTeX, the official macOS redistributable of TeX Live. Depending on available local disk storage and network bandwidth, researchers choose between the full MacTeX bundle and the minimal BasicTeX distribution.

The standard MacTeX package provides an exhaustive, out-of-the-box installation containing the complete TeX Live archive, all standard CTAN packages, extensive font collections, Ghostscript, and native GUI front-ends. For an in-depth breakdown of package contents and version histories, see our guide to the full MacTeX distribution package.

  1. Download Installer: Navigate to the official TeX Users Group portal at https://www.tug.org/mactex/ and download MacTeX.pkg. The 2026 distribution download is approximately 6.4 GB and expands to roughly 8.8 GB of disk space.
  2. Execute Package Installer: Open the downloaded package from your Downloads folder or Finder. macOS Installer guides you through the Welcome, Software License Agreement, and Destination Selection screens.
  3. Select Installation Components: Click Customize on the installation summary screen if you wish to exclude secondary utilities such as Ghostscript or GUI applications; otherwise, accept standard defaults and click Install. Enter your macOS administrator password when prompted.
  4. Verify Binary Placement: MacTeX installs TeX Live binaries into year-specific directories (such as /usr/local/texlive/2026/) and updates the symbolic link at /Library/TeX/texbin. GUI applications (TeXShop, BibDesk, TeX Live Utility) are installed into /Applications/TeX/.

Method 2: BasicTeX Lightweight Distribution

Researchers operating with constrained local solid-state storage or working on cloud virtual machines can opt for BasicTeX, a minimal distribution packaged by TUG.

  1. Download BasicTeX: Obtain BasicTeX.pkg directly from https://www.tug.org/mactex/morepackages.html. The download footprint is approximately 134 MB and expands to approximately 350 MB on disk.
  2. Install: Run the installer package, which installs essential binaries (including pdflatex, xelatex, lualatex, and tlmgr) to /usr/local/texlive/2026basic/ and establishes the symlink at /Library/TeX/texbin.
  3. Install Supplemental Packages: Because BasicTeX excludes secondary font sets and specialized macro packages, you must install additional packages as needed using the terminal-based TeX Live Manager (tlmgr).

Method 3: Package Management via Homebrew

Researchers who maintain macOS development environments using the Homebrew package manager can automate distribution deployment via Homebrew Casks:

  • Full MacTeX: Execute brew install --cask mactex in Terminal.
  • BasicTeX: Execute brew install --cask basictex in Terminal.

macOS Security and Notarization Mechanics

Modern macOS releases enforce strict Gatekeeper verification and security notarization. Official MacTeX packages released by TUG are digitally signed with an Apple Developer ID and notarized. However, if macOS blocks an installer package downloaded via third-party mirrors or curl, check and clear quarantine attributes in Terminal using:

xattr -d com.apple.quarantine ~/Downloads/MacTeX.pkg

In the March 2026 MacTeX release, the ConTeXt LuaMetaTeX binary was temporarily excluded from the primary installer because upstream binaries lacked notarization signatures. Researchers utilizing ConTeXt can cleanly restore these packages post-installation via TeX Live Utility without signature rejection.

Configuring the macOS Shell PATH

macOS defaults to the Z shell (zsh). The MacTeX installer automatically registers the TeX binary path by placing a configuration file at /etc/paths.d/TeX containing the string /Library/TeX/texbin. When a new terminal session starts, /usr/libexec/path_helper reads this file and injects the directory into your environment $PATH.

If your terminal or integrated IDE terminal returns command not found: pdflatex, manually append the path to your shell configuration by editing ~/.zshrc:

export PATH="/Library/TeX/texbin:$PATH"

After editing, reload the configuration using source ~/.zshrc.

Step-by-step instructions

To master the macOS LaTeX toolchain, researchers should understand both the command-line compilation workflow in Terminal and the graphical authoring process in TeXShop. Follow this complete step-by-step walkthrough to create, compile, and manage a research manuscript on macOS.

Part 1: Command-Line Compilation in macOS Terminal

  1. Open Terminal and Create a Project Directory: Launch Terminal from /Applications/Utilities/Terminal.app or via Spotlight (Cmd + Space, type Terminal). Create a new working folder and navigate into it:

    mkdir -p ~/Documents/latex-project && cd ~/Documents/latex-project
  2. Verify Compiler Installation: Confirm that the TeX distribution is active and reachable in your current shell:

    which pdflatex

    The terminal should return /Library/TeX/texbin/pdflatex. Run pdflatex --version to verify the engine version.
  3. Draft the Source Manuscript: Create a minimal document file named manuscript.tex using your preferred text editor (such as nano, Vim, or VS Code):

    cat < manuscript.tex (or create the file directly in your editor) containing:

    documentclass[11pt,a4paper]{article}
    usepackage{amsmath,amssymb}
    usepackage{booktabs}
    title{Sample Research Protocol}
    author{Research Division}
    date{today}
    begin{document}
    maketitle
    begin{abstract}
    This protocol demonstrates local LaTeX compilation on macOS systems.
    end{abstract}
    section{Introduction}
    Quantitative analysis requires robust mathematical typesetting:
    begin{equation}
    f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2pi i xi x} dxi
    end{equation}
    end{document}
  4. Execute Single-Pass Compilation: Compile the document directly to PDF using the pdfTeX engine:

    pdflatex manuscript.tex

    The compiler parses packages, calculates text geometry, typesets mathematical equations, and generates manuscript.pdf in the working directory.
  5. Execute Automated Multi-Pass Compilation: In academic manuscripts featuring citations, cross-references, and tables of contents, compile using latexmk to automate necessary passes:

    latexmk -pdf manuscript.tex

    For comprehensive details on multi-pass resolution and engine selection, consult our guide to compiling LaTeX documents locally.
  6. Preview Output in macOS Preview: Launch the resulting document in the native macOS PDF viewer directly from Terminal:

    open -a Preview manuscript.pdf

Part 2: GUI Authoring and SyncTeX in TeXShop

TeXShop is the Cocoa-native LaTeX editor bundled with MacTeX, maintained by Richard Koch at the University of Oregon. It provides bidirectional synchronization with Apple PDFKit engine.

  1. Launch TeXShop: Open /Applications/TeX/TeXShop.app from Finder or Launchpad.
  2. Configure Default Engine: Navigate to the top menu bar, select TeXShop → Preferences, and switch to the Engine tab. Verify that the default command under pdfTeX is set to pdflatex --file-line-error --synctex=1. Click OK to save.
  3. Open Document: Choose File → Open (or press Cmd + O) and select your manuscript.tex file. TeXShop displays the syntax-colored source text in the editor window.
  4. Execute Compilation: In the upper-left toolbar, verify that the drop-down menu is set to LaTeX. Click the Typeset button or press the macOS shortcut Cmd + T. TeXShop invokes the compiler and opens a companion PDF preview window.
  5. Use SyncTeX Bidirectional Navigation: Hold the Command key and click any word or equation in the PDF preview window. TeXShop immediately jumps to and highlights the corresponding line of LaTeX code in the source editor. Conversely, pressing Cmd + Click on a source line highlights the rendered paragraph in the PDF.

Part 3: Package Management with tlmgr and TeX Live Utility

When compiling documents that require newly published CTAN packages or font sets, update and install packages through TeX Live Manager.

  1. Command-Line Package Installation: Open Terminal and execute:

    sudo tlmgr update --self

    sudo tlmgr install biblatex csquotes microtype

    Enter your macOS administrator password when prompted.
  2. Graphical Package Management: Launch /Applications/TeX/TeX Live Utility.app. The application contacts the official CTAN mirror, refreshes the repository package catalogue, and displays installed, upgradable, and available packages. To install a package, search for its name in the top search field, right-click the package row, and select Install Selected Packages.

Output and how to read it

Understanding LaTeX compilation output is essential for diagnosing formatting errors and managing auxiliary files generated on macOS systems.

The Console Log Stream

When you invoke pdflatex or compile within TeXShop, the engine emits a real-time console log. A standard successful compilation sequence proceeds through distinct stages:

  • Engine and Format Banner: The first lines identify the engine version, distribution year, and preloaded format file (for example, pdfTeX 3.141592653-2.6-1.40.26 (TeX Live 2026/MacTeX)).
  • Package and File Ingestion: As the compiler processes preamble declarations, it prints file paths in parentheses: (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsmath.sty). An unclosed parenthesis indicates an error occurred inside that specific file.
  • Page Shipouts: As each page of text is typeset and written to the output stream, the compiler logs the page number in square brackets (such as [1], [2]). This enables you to pinpoint the exact physical page where an issue occurs.
  • Output Summary: A clean compilation ends with memory statistics and file generation confirmation: Output written on manuscript.pdf (1 page, 42180 bytes).

Auxiliary File Structure on macOS

LaTeX operates via multi-pass compilation, caching structural metadata across several auxiliary files in the document directory:

  • .pdf: The finalized portable document format file rendered by pdfTeX, XeTeX, or LuaTeX.
  • .log: The complete verbatim transcript of the compilation session, including font loading paths, warning messages, and error traces.
  • .aux: Contains serialized label references, section titles, citation keys, and page numbers required to resolve cross-references on subsequent passes.
  • .bbl and .blg: The formatted bibliography output and diagnostic log produced by BibTeX or Biber when resolving citation markers.
  • .synctex.gz: A gzipped coordinate database mapping positions between source code lines and PDF coordinates, enabling bidirectional navigation in TeXShop, VS Code, and Skim.
  • .toc, .lof, .lot: Table of contents, list of figures, and list of tables generated during intermediate passes.

Interpreting Warning and Error Messages

LaTeX issues three principal categories of diagnostic notifications:

  1. Fatal Compilation Errors: Preceded by an exclamation point (!). For example, ! LaTeX Error: File 'algorithm2e.sty' not found. indicates a missing CTAN package. The console halts and displays a question mark prompt (?). Press x and return to abort compilation, or press h for guidance.
  2. Undefined Control Sequence: Indicates an unrecognized macro or typographical error in command syntax: ! Undefined control sequence. l.15 textcolr{blue}{text}. The line number indicates the exact source location.
  3. Overfull and Underfull Box Warnings: An Overfull hbox warning indicates that a line of text, mathematical formula, or table exceeds the printable margin of the page layout. An Underfull hbox signifies loose typographic justification with excessive whitespace between words.

Troubleshooting

When running LaTeX on macOS, environment configurations, security controls, and shell settings can generate specific system errors. Apply these verified diagnostic and remediation procedures:

1. “command not found: pdflatex” or “command not found: tlmgr”

This error occurs when the shell environment cannot locate the TeX Live binary folder. In macOS, terminal windows that bypass login shells (such as tmux sessions or integrated IDE terminals) may fail to evaluate /etc/paths.d/TeX.

Remedy: Verify the physical existence of the symlink by running ls -l /Library/TeX/texbin. If the directory exists, add the export path directly into your personal user configuration:

echo 'export PATH="/Library/TeX/texbin:$PATH"' >> ~/.zshrc && source ~/.zshrc

2. Apple Silicon vs. Intel Binary Architecture Conflicts

MacTeX 2026 builds Universal Darwin binaries that run natively on Apple Silicon (ARM64) and Intel (x86_64). However, if you migrate settings from an older Intel Mac via Time Machine, your shell or Homebrew may default to Rosetta 2 emulation.

Remedy: Inspect the architecture of the active compiler in Terminal:

file $(which pdflatex)

The terminal should return: Mach-O universal binary with 2 architectures: [x86_64] [arm64]. If the output indicates x86_64 translation only, verify that your terminal emulator is not configured to run in Rosetta mode (check Finder → Applications → Utilities → Terminal → Get Info → ensure “Open using Rosetta” is unchecked).

3. Gatekeeper Blocks Installer or Helper Binaries

If macOS displays an alert reading “MacTeX.pkg cannot be opened because Apple cannot check it for malicious software” or prevents an auxiliary binary from executing, Gatekeeper has flagged the file with a quarantine attribute.

Remedy: Strip the quarantine attribute via Terminal:

sudo xattr -r -d com.apple.quarantine /Applications/TeX/

Alternatively, open System Settings → Privacy and Security, scroll to the Security section, and click Open Anyway adjacent to the blocked application.

4. Missing LuaMetaTeX and ConTeXt in MacTeX 2026

In the MacTeX 2026 release, upstream ConTeXt dependencies on LuaMetaTeX were temporarily dropped from the initial installer because LuaMetaTeX lacked Apple code notarization.

Remedy: Launch TeX Live Utility from /Applications/TeX/. Under the package list, locate context and context.universal-darwin (marked as forcibly removed). Highlight both items, navigate to the menu bar, and choose Actions → Reinstall Selected Packages. Reinstallation completes without notarization rejection because network package updates are not checked by the installer sandbox.

5. Permission Denied During tlmgr Package Installation

Executing tlmgr install [package] without administrative privileges triggers a write permission error because TeX Live installs to root-owned paths (/usr/local/texlive/).

Remedy: Either run administrative commands with root privilege via sudo tlmgr install [package], or initialize a rootless user tree in your personal home library:

tlmgr init-usertree
tlmgr --usermode install [package]

This installs personal packages to ~/Library/texmf/, requiring no administrative privileges.

6. System Font Discovery Failures in XeLaTeX and LuaLaTeX

Modern engines like XeLaTeX and LuaLaTeX access native macOS system fonts installed in /System/Library/Fonts/ and ~/Library/Fonts/. If an engine fails to locate an installed TrueType or OpenType font, the font cache requires regeneration. For modern OpenType typesetting, see our guide to LuaLaTeX engine workflows.

Remedy: Force a complete rebuild of the LuaTeX font database in Terminal:

luaotfload-tool --update --force

Free alternatives

While MacTeX with TeXShop represents the canonical, TUG-supported environment on macOS, researchers can choose from several mature, free, and open-source alternatives depending on their specific technical requirements. The data table below compares primary macOS LaTeX distributions, packages, and desktop interfaces.

For researchers seeking an integrated development environment with advanced autocomplete and structural navigation, TeXstudio provides multi-cursor editing, inline syntax checking, and configurable compilation macros. Programmers who manage research code alongside manuscripts often prefer Visual Studio Code paired with the open-source LaTeX Workshop extension, which provides integrated Git source control, PDF previewing, and automated background builds on save. Researchers requiring minimal terminal setups without graphical overhead rely on BasicTeX with a text editor like Vim or Neovim.

The following table outlines key specifications for free macOS LaTeX options across installation footprints and feature sets:

Environment / Editor Distribution Base Interface Type SyncTeX Support Best Suited For
TeXShop MacTeX / BasicTeX Cocoa Native GUI Yes (Bidirectional) Standard macOS research writing, thesis drafting, low-memory footprint
TeXstudio MacTeX / TeX Live Qt Cross-Platform GUI Yes (Integrated) Large multi-file projects, interactive equation drafting, syntax analysis
VS Code + LaTeX Workshop MacTeX / BasicTeX Electron IDE Yes (Webview / Tab) Reproducible research combining Python/R code, Git, and automated compilation
BasicTeX + Terminal BasicTeX Minimal CLI (zsh / bash) Manual CLI Tools Storage-constrained systems, headless build servers, continuous integration
GNU Emacs + AUCTeX TeX Live / MacTeX Extensible Editor Yes (via Skim/Preview) Advanced keyboard-driven authoring, macro management, reproducible research

Frequently asked questions

Does MacTeX install TeX Live on macOS?

Yes. MacTeX is the official macOS redistributable of TeX Live produced by the TeX Users Group (TUG). It installs the complete TeX Live Unix tree into /usr/local/texlive/YYYY/ alongside native macOS GUI applications (TeXShop, BibDesk, TeX Live Utility) in /Applications/TeX/.

How do I check which LaTeX version is installed in macOS Terminal?

Open Terminal and run pdflatex --version. The output displays the engine version, the Web2C compiler version, and the TeX Live release year (for example, pdfTeX 3.141592653-2.6-1.40.26 (TeX Live 2026/MacTeX)). You can also run which pdflatex to verify that the path resolves to /Library/TeX/texbin/pdflatex.

Should I install full MacTeX or BasicTeX on my Mac?

Most academic researchers should install full MacTeX if they have at least 10 GB of available solid-state drive storage. Full MacTeX contains all standard CTAN packages, eliminating build failures caused by missing macro files. Install BasicTeX only if you operate with tight storage limits and are comfortable installing missing packages via sudo tlmgr install [package] in Terminal.

How do I add /Library/TeX/texbin to my zsh PATH on macOS?

Open Terminal and append the export line to your personal zsh configuration file by running echo 'export PATH="/Library/TeX/texbin:$PATH"' >> ~/.zshrc, then reload your shell environment with source ~/.zshrc. On standard installations, the macOS system helper /usr/libexec/path_helper configures this automatically through /etc/paths.d/TeX.

How do I update LaTeX packages on macOS?

You can update packages graphically by launching TeX Live Utility from /Applications/TeX/, waiting for mirror synchronization, and clicking Update All Packages. Alternatively, update packages via Terminal by executing sudo tlmgr update --self followed by sudo tlmgr update --all.

Can I run LaTeX natively on Apple Silicon (M1, M2, M3, M4) Macs?

Yes. Modern MacTeX and BasicTeX releases compile Universal Darwin binaries that run natively on Apple Silicon ARM64 architecture as well as Intel x86_64 hardware. They do not require Rosetta 2 translation.

Sources

Data: macOS LaTeX Distributions and Environments Comparison

A comparative evaluation of LaTeX distributions and environments available on macOS, compiled from official TeX Users Group release specifications, CTAN archives, and project technical documentation. Evaluates download footprint, installed size, package manager, Apple Silicon native execution, bundled tools, and typical academic research use cases.

macOS LaTeX Distributions and Environments Comparison
Distribution / EnvironmentDownload Size (MB)Installed Footprint (GB)Package ManagementApple Silicon SupportDefault GUI IncludedPrimary Research Use Case
MacTeX (Full Distribution)65538.8tlmgr and TeX Live UtilityNative ARM64 / Universal DarwinTeXShop, BibDesk, TeX Live UtilityComprehensive research writing, large monographs, and automated builds with full CTAN collection
BasicTeX1340.35tlmgr (command-line)Native ARM64 / Universal DarwinNone (command-line only)Storage-constrained laptops, lightweight drafting, and containerized or CI/CD pipelines
Homebrew Cask (mactex)65538.8Homebrew Cask + tlmgrNative ARM64 / Universal DarwinTeXShop, BibDesk, TeX Live UtilityAutomated macOS workstation provisioning and developer-managed toolchains
Homebrew Cask (basictex)1340.35Homebrew Cask + tlmgrNative ARM64 / Universal DarwinNone (command-line only)Command-line scripting, scriptable data processing, and minimal terminal setups
TeXShop (Standalone Editor)540.15External (relies on TeX Live / MacTeX)Native ARM64 / Universal DarwinCocoa Editor & PDFKit ViewerDedicated macOS document preparation with low-latency PDF preview and SyncTeX navigation
TeXstudio (Standalone IDE)1250.38External (relies on TeX Live / MacTeX)Native ARM64 / Universal DarwinQt5 / Qt6 Integrated IDEMulti-file projects requiring advanced code completion, structure sidebars, and equation wizards

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 on macOS: Complete Installation, Command-Line and TeXShop Guide

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 →