| name | latex-beamer |
| description | LaTeX compilation and Beamer presentation patterns for macOS with TeX Live. Covers pdflatex, latexmk, bibtex, error diagnosis, and Beamer slide authoring. |
| origin | local |
LaTeX & Beamer on macOS (TeX Live)
When to Activate
- Compiling
.tex files on macOS
- Authoring or editing Beamer presentations
- Diagnosing LaTeX compilation errors
- Working with bibliographies (bibtex/natbib)
Prerequisites Check
which pdflatex
pdflatex --version
which latexmk
If missing: install MacTeX from https://tug.org/mactex/ (full install ~5 GB) or BasicTeX (~100 MB, minimal).
Compilation
Standard (manual, 2 passes)
Always run twice — first pass builds .aux, second pass resolves cross-references and TOC.
cd /path/to/project
pdflatex main.tex && pdflatex main.tex
With bibliography (bibtex)
pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.tex
With latexmk (preferred — handles passes automatically)
latexmk -pdf main.tex
latexmk -pdf -pvc main.tex
latexmk -C
Clean auxiliary files manually
rm -f *.aux *.log *.out *.toc *.bbl *.blg *.nav *.snm *.vrb
Common Errors and Fixes
| Error | Cause | Fix |
|---|
! LaTeX Error: File 'X.sty' not found | Missing package | tlmgr install <package> |
! Undefined control sequence \X | Typo or missing \usepackage | Check spelling, add package |
Overfull \hbox | Text overflows column/frame | Use \small, \footnotesize, or \linebreak |
! Missing $ inserted | Math outside math mode | Wrap in $...$ or \(...\) |
natbib: cannot find bibliography | .bib file not found or bibtex not run | Check path, run bibtex main |
| PDF not updating | Viewer caching or compilation error | Check .log, re-run |
Read the log
grep -n "^!" main.log
grep -n "Warning" main.log
Install missing packages (TeX Live)
sudo tlmgr update --self
sudo tlmgr install <package-name>
sudo tlmgr install collection-latexrecommended
Beamer Patterns
Minimal slide structure
\documentclass[aspectratio=169]{beamer}
\usetheme{SimplePlus} % or Madrid, Warsaw, etc.
\usepackage{amsmath,amssymb,bm}
\usepackage{graphicx,booktabs}
\title{Title}
\author{Author}
\date{\today}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Contenido}
\tableofcontents
\end{frame}
\section{Sección 1}
\input{sections/01_intro.tex}
\end{document}
Frame types
% Two columns
\begin{frame}{Título}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
Columna izquierda
\end{column}
\begin{column}{0.48\textwidth}
Columna derecha
\end{column}
\end{columns}
\end{frame}
% Alert / Example blocks
\begin{alertblock}{Problema}
Texto en rojo.
\end{alertblock}
\begin{exampleblock}{Solución}
Texto en verde.
\end{exampleblock}
% Figure
\begin{frame}{Figura}
\begin{center}
\includegraphics[width=0.8\linewidth]{fig/nombre.png}
{\footnotesize Descripción de la figura}
\end{center}
\end{frame}
% Table
\begin{frame}{Tabla}
\begin{table}
\small
\begin{tabular}{@{}lcc@{}}
\toprule
\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} \\
\midrule
A & 1.23 & 4.56 \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
TikZ diagrams in Beamer
\usepackage{tikz}
\usetikzlibrary{arrows.meta, positioning, shapes.geometric}
\begin{frame}{Diagrama}
\begin{center}
\begin{tikzpicture}[
node distance=0.5cm and 0.4cm,
box/.style={draw, rounded corners, minimum width=2cm, minimum height=0.8cm,
align=center, font=\small},
done/.style={box, fill=green!20, draw=green!60!black},
curr/.style={box, fill=orange!20, draw=orange},
future/.style={box, fill=gray!15, draw=gray},
arrow/.style={-{Stealth[length=2mm]}, thick}
]
\node[done] (a) {Fase 0\\\checkmark};
\node[curr, right=of a] (b) {Fase 1\\En curso};
\node[future, right=of b] (c) {Fase 2\\Futuro};
\draw[arrow] (a) -- (b);
\draw[arrow] (b) -- (c);
\end{tikzpicture}
\end{center}
\end{frame}
Math in Beamer
% Inline
$\omega_e = (P/2)\,\omega_m$
% Display
\begin{equation}
\mathbf{e}_{\alpha\beta} = K_e\,\omega_m\,\mathbf{s}(\theta_e)
\end{equation}
% Aligned
\begin{align}
f_1 &= \frac{1}{L}(u_1 - e - R\,i) \\
f_2 &= \frac{1}{L}(u_2 - e - R\,i)
\end{align}
Placeholder for missing figures
\newcommand{\placeholder}[2][0.8\textwidth]{%
\begin{center}
\fcolorbox{gray}{gray!10}{%
\parbox{#1}{\centering\vspace{1cm}\textit{#2}\vspace{1cm}}%
}
\end{center}
}
% Usage:
\placeholder[0.6\textwidth]{Figura: ripple vs velocidad}
Project Layout (modular)
presentation/
├── main.tex # root: \input{sections/...}
├── reference.bib # bibliography
├── fig/ # all images (.png, .pdf, .eps)
├── sections/
│ ├── 01_intro.tex
│ ├── 02_theory.tex
│ └── ...
└── theme/ # custom .sty files if any
- Keep one
\section per file in sections/.
- Use
\input{}, not \include{} (no forced page breaks).
- Store figures as PNG (≥150 DPI) or PDF (vector, preferred for equations).
Open PDF after compilation (macOS)
open main.pdf
open -a Skim main.pdf
Skim (free, recommended): https://skim-app.sourceforge.io/