Mohamad H. Kazma Mohamad H. Kazma

Setting Up a Local LaTeX Workflow: MacTeX + TeXstudio (macOS)

March 11, 2026

Working locally with MacTeX and TeXstudio is faster, more reliable, and more private than cloud-based editors. Here is how to get set up from scratch on macOS.


Step 1 — Download and Install MacTeX 2026

  1. Go to https://www.tug.org/mactex/ and download the MacTeX.pkg installer (~5 GB — it includes the full TeX Live distribution plus GUI apps).
  2. Open the downloaded .pkg file and follow the installer prompts. MacTeX installs to /usr/local/texlive/2026/.
  3. After installation, open Terminal and verify:
    pdflatex --version
    
    You should see output like pdfTeX 3.141592653-....

Tip: If you only need a minimal install, download BasicTeX instead (~100 MB) and add packages on demand via tlmgr.


Step 2 — Install TeXstudio

  1. Download the latest release from https://www.texstudio.org/.
  2. Move the .app to your /Applications folder.
  3. On first launch, TeXstudio auto-detects your MacTeX installation. You can verify under: Preferences → Build → Default Compiler — set to pdfLaTeX (or LuaLaTeX for Unicode/font-heavy documents).

Step 3 — Configure the Build System

In TeXstudio → Preferences → Build:

SettingRecommended Value
Default CompilerpdfLaTeX
Default Bibliography ToolBibtex or Biber
PDF ViewerInternal (built-in viewer with forward/inverse search)
Build & View shortcutF5

For IEEE/journal papers using biblatex, switch the bibliography tool to Biber.


SyncTeX lets you jump from your .tex source to the exact location in the PDF and vice versa.

  • Forward search (source → PDF): Press F5 or click the green play button.
  • Inverse search (PDF → source): Hold Cmd and click anywhere in the internal PDF viewer — it jumps to the corresponding source line.

This is already enabled by default when using the internal PDF viewer.


Step 5 — Connect Mendeley for BibTeX References

  1. In Mendeley Desktop/Reference Manager, go to Tools → Options → BibTeX (Desktop) or Export (web app).
  2. Enable Sync BibTeX library and point it to a .bib file in your project folder (e.g., references.bib).
  3. In your .tex file, add:
    \bibliography{references}
    
    TeXstudio will auto-complete citation keys as you type \cite{}.

Alternative: Export a .bib file manually from Mendeley via File → Export and place it in your project directory.


Step 6 — Keeping MacTeX Up to Date

MacTeX bundles TeX Live’s package manager tlmgr. To update all installed packages:

sudo tlmgr update --self --all

To install a missing package (e.g., algorithm2e):

sudo tlmgr install algorithm2e

Useful TeXstudio Shortcuts

ActionShortcut
Build & View (compile + open PDF)F5
Compile onlyF6
Show/hide structure panelF4
Comment/uncomment selectionCmd + T
Find & replaceCmd + H
Auto-completeCtrl + Space