Wave Walker DSP

DSP Algorithms for RF Systems

Most Popular

Brand New Book!

DSP for Beginners: Simple Explanations for Complex Numbers! The second edition includes a new chapter on complex sinusoids.

Install and Run LaTeX on macOS
January 5, 2022

Table of Contents

Introduction

Install and run LaTeX on macOS done in four easy steps:

  • Install Homebrew
  • Install pdflatex with Homebrew
  • Install more LaTeX packages with tlmgr
  • Compiling LaTeX with a Makefile

Check out more blogs:

Install Homebrew

Homebrew is a package manager for mac. You can get the latest installation instructions for Homebrew at their website brew.sh.

Homebrew is used to install pdflatex, a command line utility for converting LaTeX into PDFs.
Homebrew is used to install pdflatex, a command line utility for converting LaTeX into PDFs.

At the time of writing (December 2021) the installation command is:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Follow the command prompts to install Homebrew.

Install pdflatex with Homebrew

pdflatex is a command line utility which converts raw .tex files into a PDF document. Once Homebrew is installed you can then install pdflatex:

$ brew install pdflatex

If Homebrew can’t find pdflatex, try installing BasicTeX:

$ brew install basictex

Install More Packages with tlmgr

tlmgr is the package manager bundled with pdflatex. First update tlmgr:

$ sudo tlmgr update --self

Then install all of the extra packages:

$ sudo tlmgr install collection-latexextra

You may get some warning messages at the end, but double check to see make sure there are no errors which stopped the install of the packages.

Compiling LaTex with a Makefile

A Makefile simplifies the compilation of the LaTeX into a PDF with a single command. First create the following file named Makefile:

all:
    pdflatex filename.tex
    pdflatex filename.tex
    bibtex filename # remove if no references/bibliography
    pdflatex filename.tex # remove if no references/bibliography
    open filename.pdf &

clean:
    rm -f *.pdf *.aux *.log *.toc *.blg *.out *.bbl

Note that you will need to remove the bibtex line (and third compilation) if your LaTeX does not have references or a bibliography. Now run the makefile and it will compile and open the PDF:

$ make filename

You’re all done!

Check out more blogs:

God, the Lord, is my strength; he makes my feet like the deer’s; he makes me tread on my high places. Habakkuk 3:19

3 Responses

  1. I tried running brew install pdflatex, but got this error:
    Warning: No available formula with the name “pdflatex”. Did you mean pdf2htmlex?
    Looks like you updated this page last month, so how could pdflatex not be found?
    I definitely can’t use pdf2htmlex; pandoc won’t accept it.

    1. Hey Rick, thanks for commenting. Not sure why pdflatex didn’t show up in homebrew for you. Try installing basictex with homebrew:

      $ homebrew install basictex

      This should give you the pdflatex executable and the rest of the instructions will apply. Let me know if that worked.

Leave a Reply

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.