Beamer LaTeX slide workflow: create, compile, review, and polish academic presentations. Use this skill whenever the user works on Beamer .tex slide decks, or asks to create slides, make a presentation, prepare a lecture, build a talk, or generate Beamer slides from a paper. Covers: creation, editing, compilation, proofreading, visual audit, pedagogical review, TikZ diagrams, figure extraction, and comprehensive quality checks. Trigger on: beamer, slides, lecture, presentation, seminar talk, conference talk, defense slides, tikz, compile latex, proofread slides, slide review, 讨论班, 论文讲解. Do NOT trigger on: powerpoint, pptx, PPT, 做PPT — use the powerpoint-slides skill instead.
Universal skill for academic Beamer presentations. Full lifecycle: create → compile → review → polish → verify.
When creating new slides, use this as the default preamble unless the user has a custom template.
\documentclass[aspectratio=169,10pt]{beamer}
\usetheme{Madrid}
\usecolortheme{default}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\usepackage{amsmath,amssymb,amsthm,booktabs,mathtools}
\usepackage{stmaryrd} % for \llbracket, \rrbracket
\usepackage{graphicx} % for \includegraphics (extracted figures)
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,decorations.pathreplacing}
% Semantic colors — use in BOTH text and TikZ for global consistency
\definecolor{positive}{HTML}{0173B2} % blue (correct, advantage)
\definecolor{negative}{HTML}{DE8F05} % orange (limitation, drawback)
\definecolor{emphasis}{HTML}{029E73} % green (highlight, key finding)
\definecolor{neutral}{gray}{0.55} % muted context
\definecolor{cbPurple}{HTML}{CC78BC} % additional accent
\newcommand{\pos}[1]{\textcolor{positive}{#1}}
\newcommand{\con}[1]{\textcolor{negative}{#1}}
\newcommand{\HL}[1]{\textcolor{emphasis}{#1}}
Rules:
10pt — 11pt or 12pt produces oversized, sparse slides.aspectratio=169 — modern projectors are 16:9.\author{Presenter: [name]} and \institute{Shanghai Jiao Tong University}. Override only if user specifies otherwise.\newcommand{\F}{\mathbb{F}}) as needed.\usepackage[ruled,lined]{algorithm2e} — set \SetAlgoLined, \DontPrintSemicolon\usepackage{listings} — set basicstyle=\ttfamily\small, keywordstyle=\bfseries\color{positive}, commentstyle=\color{neutral}. Max 10 lines of code per slide; highlight key lines with escapeinside={(*@}{@*)} and \colorbox.\usepackage{algorithmic} — simpler than algorithm2e, suitable for short procedures.\usepackage{pgfplots} + \pgfplotsset{compat=1.18} — data-driven plots (bar, scatter, error bars, histograms). Far more efficient than manual TikZ coordinate plots for data visualization.\usepackage{subcaption} — multiple subfigures in one frame via \begin{subfigure}{0.48\textwidth}.theorem, lemma, corollary, definition, example, proof out of the box (styled by the theme). Use them for formal statements — they get automatic numbering and consistent styling. Customize with \setbeamertemplate{theorems}[numbered] or [ams style].\pause, \onslide, \only, \uncover. Use multiple slides for progressive builds, color emphasis for attention. Common replacement patterns:
\textcolor{neutral}{} on previously-shown items to mute them.tikzpicture and append new elements — never delete prior elements.alertblock, exampleblock, and block environments add internal padding (~15% less width, ~12-16pt extra height for title bar + vertical padding). Content that fits on a bare slide can overflow inside a box in both directions. Rules:
\[ \]) + text below it inside a single box easily exceeds vertical capacity. Limit box content to one display equation OR 2-3 short bullet items — not both. Never use aggressive \vspace{-Xpt} inside a box; it pulls bottom content past the border.\qquad inside a box; use \quad or ,. If a display equation is wider than ~70% of \textwidth on a bare slide, reformat before placing inside a box.\begin{thebibliography}{9} with \small. Include the primary paper and 3-5 most relevant references.\pos{} = positive/correct (blue), \con{} = negative/limitation (orange), \HL{} = emphasis/key finding (green), \textcolor{neutral}{} = de-emphasized. These are color-blind safe. Limit total palette to 3-5 colors.\textbf, supporting text: normal, labels/captions: \small minimum. Never use \tiny for any user-facing content.\appendix before backup section. Separate from main deck with a \begin{frame}{Backup Slides}\end{frame} divider. Backup slides should NOT count toward the timing allocation. Content to include (derive from Phase 0 material analysis):
\begin{columns}[T] + \column{W\textwidth} for side-by-side content. Rules:
0.48\textwidth each (leave 0.04 gap).0.45-0.55, text column 0.40-0.50, gap 0.05.≤ 0.30\textwidth, only for short items (icons, stats, one-liners).[T] (top-align) unless deliberately centering.Parse $ARGUMENTS to determine which action to run. If no action specified, ask.
compile [file]3-pass XeLaTeX + bibtex for full citation resolution.
# Adapt TEXINPUTS/BIBINPUTS to your project's preamble/bib locations
xelatex -interaction=nonstopmode FILE.tex
bibtex FILE
xelatex -interaction=nonstopmode FILE.tex
xelatex -interaction=nonstopmode FILE.tex
Post-compile checks:
Overfull \\hbox warnings (count and locations)Undefined control sequence or undefined citationsLabel(s) may have changedcreate [topic]Collaborative, iterative lecture creation. Strict phase gates — never skip ahead.
Read first, ask later. Must understand the content before asking meaningful questions.
Do NOT present results or ask questions yet — proceed directly to Phase 1.
Conduct a content-driven interview via AskUserQuestion. The questions below are the minimum required set — you MUST also add paper-specific questions derived from Phase 0.
Minimum required questions (always ask):
Optional question (ask when the talk is a journal club, defense, or user seems to want rehearsal support):
3. Speaker notes: Would you like speaker notes in the Presenter View? If yes, \note{} blocks will be added per frame with telegraphic talking points (key message, transition cue, anticipated questions). Requires adding \setbeameroption{show notes on second screen=right} to the preamble for dual-screen display.
Content-driven questions (derive from Phase 0, ask as many as needed):
Guidelines:
Slide count heuristic: ~1 slide per 1.5-2 minutes.
Timing allocation table:
| Duration | Total slides | Intro/Motivation | Methods/Background | Core content | Summary/Conclusion |
|---|---|---|---|---|---|
| 5min (lightning) | 5-7 | 1-2 | 0-1 | 2-3 | 1 |
| 10min (short) | 8-12 | 2 | 1-2 | 4-5 | 1 |
| 15min (conference) | 10-15 | 2-3 | 2-3 | 5-7 | 1-2 |
| 20min (seminar) | 13-18 | 3 | 2-3 | 6-9 | 2 |
| 45min (keynote) | 22-30 | 4-5 | 5-7 | 10-14 | 2-3 |
| 90min (lecture) | 45-60 | 5-6 | 8-12 | 25-35 | 3-4 |
Talk-type specific tips:
| Talk type | Key emphasis | Common mistake |
|---|---|---|
| Lightning (5min) | One core message, no background review | Cramming a full talk into 5 minutes |
| Conference (10-20min) | 1-2 key results, fast methods overview | Too much technical detail, no big picture |
| Seminar (45min) | Deep dive OK, but need visual rhythm | Wall-to-wall formulas without examples |
| Defense/Thesis | Demonstrate mastery, systematic coverage | Skipping motivation, rushing results |
| Journal club | Critical analysis, facilitate discussion | Summarizing without evaluating |
| Grant pitch | Significance → feasibility → impact | Too technical, not enough "why it matters" |
Time distribution principle: Spend 40-50% of time on core content (results/techniques). Max 3-4 consecutive theory-heavy slides before a worked example or visual break.
Produce a detailed outline. For each section:
Present the plan to the user. Ask: structure OK? Expand/shrink/cut anything?
Do NOT proceed to drafting until user approves.
This phase is the most critical. Follow all sub-rules strictly.
\textbf{} for key terms on first introduction; use \pos{...} for positive properties, \con{...} for drawbacks/limitations, \HL{...} for key findings (defined in preamble).Opening slide (pick one strategy):
The opening should create tension or curiosity that the rest of the talk resolves.
Closing strategies:
Each math-heavy slide should follow one of these patterns:
Definition slide:
[Framing sentence: why this definition matters]
[Formal definition in display math]
[Key properties / immediate consequences as 2-3 bullet items]
Construction/Algorithm slide:
[One-line goal statement]
[Core equation / algorithm steps]
[Complexity analysis: prover cost, verifier cost, soundness]
Comparison slide:
[Side-by-side table: prior work vs this work]
[1-2 lines highlighting the key difference]
Insight/Remark slide (adds value beyond the paper):
[Observation the paper doesn't emphasize, or a comparison with related work]
[Why this matters / what it implies]
Every slide must have a clear takeaway — the one thing the audience should remember.
Theorem/Proof slide (for formal mathematical statements):
[Framing sentence: informal statement of the result]
\begin{theorem}[Optional name]
[Formal statement in display math]
\end{theorem}
[Key implication or "why this matters" as 1-2 bullets]
\begin{proof}[Proof sketch] to signal abbreviated proofs.Cross-referencing between slides:
\label{slide:construction} inside the frame.see Slide~\ref{slide:construction} or clickable \hyperlink{slide:construction}{\beamerbutton{Back to Construction}}.Upper bounds (per slide):
Lower bounds (per slide):
Density self-check after each batch:
xelatex -interaction=nonstopmode) to catch errors early — fixing 2 issues in a 10-slide batch is far cheaper than fixing 12 issues in a 40-slide deck at Phase 5\begin{center}...\end{center}. Left-aligned tables look misaligned on slides.\toprule, making the table appear embedded in the title. Always insert \vspace{4pt} (or introductory text) between the title and the first \toprule. The compiler emits zero warnings for this — it can only be caught by visual inspection.booktabs (\toprule, \midrule, \bottomrule) — never vertical lines (|).r), text left-aligned (l), short labels centered (c).\toprule + header + \midrule).\frametitle{Results (cont'd)}.\resizebox{\textwidth}{!}{...} only as last resort — prefer reducing columns/rows first.\cellcolor{positive!15} or \textbf{} — draw the eye to the result.\small, or use the frame title as the implicit caption.escapeinside in listings or \colorbox in algorithm2e.$x$), functions in sans-serif or typewriter.\ttfamily\small, syntax highlighting via listings. Show only the relevant fragment — never dump an entire source file.Data visualization guidelines (journal figures ≠ slide figures):
\textcolor{blue!70!black}{...} for the key finding, gray for reference.#0173B2) + orange (#DE8F05) over red + green. Add line style differences (solid/dashed/dotted) as redundant encoding. In TikZ:
\definecolor{cbBlue}{HTML}{0173B2}
\definecolor{cbOrange}{HTML}{DE8F05}
\definecolor{cbGreen}{HTML}{029E73}
\definecolor{cbPurple}{HTML}{CC78BC}
\pause).\begin{subfigure}{0.48\textwidth} (requires subcaption package) for side-by-side panels in one frame. Each subfigure gets its own \caption{(a) ...}. Preferred over raw \includegraphics side-by-side when panels need individual captions. Max 2 subfigures per slide (4 panels = split across 2 slides).pgfplots for data-driven figures (preferred over manual TikZ for data):
Use pgfplots whenever plotting numerical data. It handles axes, legends, scaling, and data loading automatically.
% Bar chart from inline data
\begin{tikzpicture}
\begin{axis}[
ybar, bar width=12pt,
xlabel={Method}, ylabel={Accuracy (\%)},
symbolic x coords={Baseline, Ours, Oracle},
xtick=data, ymin=0, ymax=100,
nodes near coords, every node near coord/.append style={font=\small},
width=0.85\textwidth, height=5cm
]
\addplot coordinates {(Baseline,72) (Ours,89) (Oracle,95)};
\end{axis}
\end{tikzpicture}
% Line plot from CSV file
\begin{tikzpicture}
\begin{axis}[
xlabel={Epoch}, ylabel={Loss},
legend pos=north east, grid=major,
width=0.85\textwidth, height=5cm
]
\addplot table[x=epoch, y=train_loss, col sep=comma] {data/results.csv};
\addplot table[x=epoch, y=val_loss, col sep=comma] {data/results.csv};
\legend{Train, Validation}
\end{axis}
\end{tikzpicture}
% Scatter plot with error bars
\begin{axis}[xlabel={$x$}, ylabel={$y$}]
\addplot+[only marks, error bars/.cd, y dir=both, y explicit]
coordinates {(1,2)+-(0,0.3) (2,3.5)+-(0,0.5) (3,5.1)+-(0,0.4)};
\end{axis}
width and height to prevent overflow.\addplot table[col sep=comma]{file.csv} to load data from file — keeps .tex clean.tick label style={font=\small}), thicken lines (thick), use semantic colors (color=positive).After completing the full draft, enter the quality loop:
┌─→ 5a. Compile (2-pass XeLaTeX)
│ 5b. Self-Review (structure + content + visual)
│ 5c. Score (apply rubric)
│ 5d. Fix all issues found
└── If score < 90 and round < 3: loop back to 5a
If score ≥ 90 or round = 3: report to user
5a. Compilation
5b. Self-Review — re-read the .tex and verify:
Structure:
Content density:
TikZ and visuals:
scale + multiple equations above = diagram clipped at bottom\fill, \node, or \draw endpoint that should be on a plotted curve, verify the y-coordinate is computed via \pgfmathsetmacro from the same function, NOT hardcoded. Visually check in PDF that dots/markers visually sit on the curve line\begin{center}...\end{center})\toprule visually merges with the title bar (add \vspace{4pt} or text before first table)\footnotesizeNotation:
5c. Quality Score
Start at 100. Deduct:
| Severity | Issue | Deduction |
|---|---|---|
| Critical | Compilation failure | -100 |
| Critical | Equation overflow (slide or box-interior) | -20 |
| Critical | TikZ diagram overflows slide boundary (clipped at bottom/right) | -15 per diagram |
| Critical | Undefined control sequence / citation | -15 |
| Critical | Overfull hbox > 10pt | -10 |
| Major | Content overflow inside colored box (vertical or horizontal, visual-only) | -10 per box |
| Major | TikZ marked points not on curve (hardcoded y-values instead of computed) | -8 per diagram |
| Major | Sparse slide (≤3 items, no math/diagram) | -5 per slide |
| Major | TikZ label overlap | -5 |
| Major | Missing references slide | -5 |
| Major | Table not centered (standalone table without \begin{center}) | -3 per table |
| Major | Table \toprule visually merged with title bar (no spacing after frame title) | -5 per slide |
| Major | Notation inconsistency | -3 |
| Minor | \vspace overuse (>3 per slide) | -1 |
| Minor | Font size reduction (\footnotesize etc.) | -1 per slide |
Thresholds:
5d. Fix — fix all critical and major issues. Re-compile. If score improves to ≥ 90, exit loop. Max 3 rounds to avoid infinite loops.
[ ] Compiles without errors
[ ] No overfull hbox > 10pt
[ ] All citations resolve
[ ] Score ≥ 90
[ ] Every definition has motivation + worked example
[ ] Max 2 colored boxes per slide
[ ] No sparse slides (all slides have substantive content)
[ ] TikZ diagrams visually verified — no overlaps, no overflow, all marked points on curves
[ ] Tables fit within slide boundaries, are centered, and separated from title bar
[ ] No content overflow inside colored boxes (visual PDF check)
[ ] References slide present (second-to-last, before Thank You)
review [file] or proofread [file]Read-only report, no file edits.
5 check categories:
| Category | What to check |
|---|---|
| Grammar | Subject-verb, articles, prepositions, tense consistency |
| Typos | Misspellings, search-replace artifacts, duplicated words, unreplaced placeholders ([name], [TODO], [XXX], template remnants) |
| Overflow | Long equations without \resizebox, too many items per slide |
| Consistency | Citation format (\citet/\citep), notation, terminology, box usage, denominator consistency across slides |
| Academic quality | Informal abbreviations, missing words, claims without citations, ambiguous abbreviations (same abbreviation for different terms) |
Report format per issue:
### Issue N: [Brief description]
- **Location:** [slide title or line number]
- **Current:** "[exact text]"
- **Proposed:** "[fix]"
- **Category / Severity:** [Category] / [High|Medium|Low]
audit [file]Visual layout audit. Read-only report.
Check dimensions:
\vspace overuse, structural issuesSpacing-first fix principle (priority order):
\resizebox\footnotesize (never \tiny)pedagogy [file]Holistic pedagogical review. Read-only report.
13 patterns to validate:
| # | Pattern | Red flag |
|---|---|---|
| 1 | Motivation before formalism | Definition without context |
| 2 | Incremental notation | 5+ new symbols on one slide |
| 3 | Worked example after definition | 2 consecutive definitions, no example |
| 4 | Progressive complexity | Advanced concept before prerequisite |
| 5 | Fragment reveals (problem→solution) | Dense theorem revealed all at once |
| 6 | Standout slides at pivots | Abrupt topic jump, no transition |
| 7 | Two-slide strategy for dense theorems | Complex theorem crammed in 1 slide |
| 8 | Semantic color usage | Binary contrasts in same color |
| 9 | Box hierarchy | Wrong box type for content |
| 10 | Box fatigue | 3+ boxes on one slide |
| 11 | Socratic embedding | Zero questions in entire deck |
| 12 | Visual-first for complex concepts | Notation before visualization |
| 13 | Side-by-side for comparisons | Sequential slides for related definitions |
Deck-level checks: Narrative arc, pacing (max 3-4 theory slides before example), visual rhythm (section dividers every 5-8 slides), notation consistency, student prerequisite assumptions.
tikz [file]TikZ diagram review and extraction.
Quality standards:
Labels NEVER overlap with curves, lines, dots, or other labels
When two labels are near the same vertical position, stagger them
Visual semantics: solid=observed, dashed=counterfactual, filled=observed, hollow=counterfactual
Line weights: axes=thick, data=thick, annotations=thick (not very thick)
Standard scale: [scale=1.1] for full-width diagrams
Dot radius: 4pt for data points
Minimum 0.2 units between any label and nearest graphical element
Mathematical accuracy of plotted points: NEVER hardcode y-coordinates for points, markers, or dashed-line endpoints that should lie on a plotted curve. ALL such coordinates must be computed from the SAME function used to draw the curve via \pgfmathsetmacro. This applies to:
Common mistake (WRONG — hardcoded y that doesn't match the curve):
\draw[thick] plot[domain=0.8:10] (\x, {0.3*\x + 2.7/\x});
\draw[dashed] (2, 0) -- (2, 3.2); % BAD: 3.2 is not 0.3*2+2.7/2=1.95
\node at (2, 3.2) {BiPerm}; % BAD: label floats above the curve
Correct pattern (ALWAYS compute from the function):
\draw[thick] plot[domain=0.8:10] (\x, {0.3*\x + 2.7/\x});
\pgfmathsetmacro{\yTwo}{0.3*2 + 2.7/2} % = 1.95, exactly on curve
\draw[dashed] (2, 0) -- (2, \yTwo);
\fill (2, \yTwo) circle (2pt);
\node[above left] at (2, \yTwo) {BiPerm};
For curve intersections, solve the system algebraically first, then encode the exact formula:
% Intersection of y=0.5x and y=2.5/x+0.3:
% 0.5x = 2.5/x + 0.3 => x^2 - 0.6x - 5 = 0 => x = (0.6+sqrt(20.36))/2
\pgfmathsetmacro{\xint}{(0.6 + sqrt(20.36))/2}
\pgfmathsetmacro{\yint}{0.5*\xint}
\fill (\xint, \yint) circle (3pt);
TikZ diagram sizing on mixed-content slides: a TikZ diagram sharing a slide with text/equations MUST fit in the remaining vertical space. Beamer 16:9 at 10pt has ~70mm usable height below the title bar. Before writing the TikZ code, estimate:
yscale, shrink coordinate ranges, or move content to a separate slideSafe defaults for mixed slides: xscale=0.5-0.7, yscale=0.4-0.6. For full-slide diagrams: scale=0.9-1.1.
Edge labels on short arrows: when placing node[midway, above] labels on arrows between boxes, the label text can extend past the arrow endpoints into adjacent box borders. Prevention rules:
right= gap). If the label is wider than ~80% of the gap, increase the gap or shrink the label font (\scriptsize / \tiny).above=4pt (or more) instead of bare above to add vertical clearance between label and box border.text width and gap together.Extraction to SVG (for web/Quarto use):
xelatex -interaction=nonstopmode extract_tikz.tex
PAGES=$(pdfinfo extract_tikz.pdf | grep "Pages:" | awk '{print $2}')
for i in $(seq 1 $PAGES); do
idx=$(printf "%02d" $((i-1)))
pdf2svg extract_tikz.pdf tikz_exact_$idx.svg $i
done
TikZ checklist:
[ ] No label-label overlaps
[ ] No label-curve overlaps
[ ] No edge labels overlapping adjacent nodes (check label width vs. arrow length)
[ ] Diagram bounding box fits within remaining slide space (especially mixed text+diagram slides)
[ ] ALL marked points/dots/line-endpoints on curves computed via \pgfmathsetmacro from the SAME function — no hardcoded y-values
[ ] Dashed reference lines terminate exactly at the curve, not at arbitrary coordinates
[ ] Consistent dot style (solid=observed, hollow=counterfactual)
[ ] Consistent line style (solid=observed, dashed=counterfactual)
[ ] Arrow annotations: FROM label TO feature
[ ] Axes extend beyond all data points
[ ] Labels legible at presentation size
[ ] Minimum spacing between labels and graphical elements
Common TikZ diagram patterns:
Use these as starting points, then customize. All patterns assume arrows.meta, positioning, decorations.pathreplacing libraries are loaded (included in default preamble).
Flowchart (horizontal):
\begin{tikzpicture}[
box/.style={draw, rounded corners, minimum width=2.2cm, minimum height=0.8cm,
font=\small, fill=positive!10},
arr/.style={-{Stealth}, thick}
]
\node[box] (A) {Step 1};
\node[box, right=1.5cm of A] (B) {Step 2};
\node[box, right=1.5cm of B] (C) {Step 3};
\draw[arr] (A) -- node[above, font=\scriptsize] {label} (B);
\draw[arr] (B) -- (C);
\end{tikzpicture}
below= instead of right=.Timeline:
\begin{tikzpicture}
\draw[-{Stealth}, thick] (0,0) -- (12,0) node[right] {Time};
\foreach \x/\lab in {1.5/Event A, 5/Event B, 9/Event C} {
\draw[thick] (\x, 0.15) -- (\x, -0.15);
\node[above=3pt, font=\small] at (\x, 0.15) {\lab};
}
\end{tikzpicture}
Tree diagram:
\begin{tikzpicture}[
level distance=1.2cm, sibling distance=2.5cm,
every node/.style={draw, rounded corners, font=\small, minimum width=1.5cm}
]
\node {Root}
child { node {A} child { node {A1} } child { node {A2} } }
child { node {B} child { node {B1} } };
\end{tikzpicture}
Annotated brace:
\draw[decorate, decoration={brace, amplitude=6pt, raise=2pt}]
(start) -- (end) node[midway, above=10pt, font=\small] {annotation};
Coordinate plot with computed intersection:
\begin{tikzpicture}[scale=1.1]
\draw[-{Stealth}, thick] (0,0) -- (6,0) node[right] {$x$};
\draw[-{Stealth}, thick] (0,0) -- (0,4) node[above] {$y$};
\draw[thick, positive] plot[smooth, domain=0.5:5.5] (\x, {0.5*\x});
\draw[thick, negative, dashed] plot[smooth, domain=0.5:5.5] (\x, {2.5/\x + 0.3});
% Exact intersection via \pgfmathsetmacro (see quality standards above)
\end{tikzpicture}
Decision diamond (for algorithm flowcharts):
\node[diamond, draw, aspect=2, inner sep=1pt, font=\small] (D) {condition?};
\draw[arr] (D) -- node[right, font=\scriptsize] {yes} ++(0,-1.2);
\draw[arr] (D) -- node[above, font=\scriptsize] {no} ++(2.5,0);
Iterative TikZ review loop (for complex diagrams):
When a TikZ diagram has ≥ 5 nodes or involves plotted curves, run an iterative review:
┌─→ Step 1: Mentally render — trace every coordinate, compute where each element appears
│ Step 2: Check for issues — overlaps, misalignments, inconsistent semantics
│ Step 3: Classify — CRITICAL (overlap, wrong semantics, geometric error),
│ MAJOR (poor spacing, readability), MINOR (aesthetic)
│ Step 4: Fix all CRITICAL and MAJOR issues
│ Step 5: Re-compile and visually verify in PDF
└── If CRITICAL or MAJOR remain and round < 3: loop back to Step 1
If all clear or round = 3: declare APPROVED or report remaining issues
Verdict criteria:
excellence [file]Comprehensive multi-dimensional review. Use the Agent tool to dispatch review agents in parallel for maximum efficiency.
Parallel agent dispatch — launch these as concurrent Agent calls:
\citet/\citep), notation consistency, academic quality. Report per issue with location and fix."\begin{tikzpicture}) — "Read [file]. For every TikZ diagram: check label overlaps, geometric accuracy, visual semantics, spacing. Be merciless — find every flaw. Report per issue with exact coordinates and fixes."After all agents return, synthesize a combined report:
# Slide Excellence Review: [Filename]
## Overall Quality Score: [EXCELLENT / GOOD / NEEDS WORK / POOR]
| Dimension | Critical | Major | Minor |
|-----------|----------|-------|-------|
| Visual/Layout | | | |
| Pedagogical | | | |
| Proofreading | | | |
| TikZ (if any) | | | |
### Critical Issues (Immediate Action Required)
### Major Issues (Next Revision)
### Recommended Next Steps
Quality score rubric (for multi-agent excellence review — complements the numeric score in Phase 5 which is used during create):
| Score | Critical issues | Medium issues | Meaning |
|---|---|---|---|
| Excellent | 0-2 | 0-5 | Ready to present (≈ Phase 5 score ≥ 90) |
| Good | 3-5 | 6-15 | Minor refinements (≈ Phase 5 score 80-89) |
| Needs Work | 6-10 | 16-30 | Significant revision (≈ Phase 5 score < 80) |
| Poor | 11+ | 31+ | Major restructuring |
devils-advocate [file]Challenge slide design with 5-7 specific pedagogical questions.
Challenge categories:
visual-check [file]PDF→image systematic visual review. Converts compiled PDF to images, then reviews each slide visually. This catches issues invisible in source code and suppressed by the compiler (especially box-interior overflow).
Why this matters: Beamer suppresses overfull warnings inside block/alertblock/exampleblock environments. Zero compile warnings does NOT mean zero visual overflow. This action provides ground truth.
Workflow:
Compile (if not already compiled):
xelatex -interaction=nonstopmode FILE.tex
Convert PDF to images using PyMuPDF:
import fitz
doc = fitz.open('FILE.pdf')
n = doc.page_count # cache before iterating or closing
zoom = 200 / 72 # 200 DPI
matrix = fitz.Matrix(zoom, zoom)
for i in range(n):
page = doc.load_page(i)
pixmap = page.get_pixmap(matrix=matrix)
pixmap.save(f'/tmp/slide-{i+1:03d}.jpg', output='jpeg')
doc.close()
print(f'Exported {n} slides')
Or via bash: python3 -c "import fitz; ..."
Fallback (if PyMuPDF unavailable): Use the Read tool directly on the PDF — Claude Code is multimodal and can read PDF files page by page.
Systematic per-slide inspection — use Read tool to view each image, checking:
alertblock/exampleblock/block)Report per issue:
### Slide N: [slide title]
- **Issue:** [description]
- **Severity:** Critical / Major / Minor
- **Fix:** [specific recommendation]
validate [file] [duration]Automated quantitative validation. Checks measurable properties without reading content.
Checks performed:
Slide count vs. duration (if duration provided):
# Get page count
pdfinfo FILE.pdf | grep "Pages:"
Compare against timing allocation table (Section 2.2, Phase 1). Flag if outside recommended range.
Aspect ratio:
pdfinfo FILE.pdf | grep "Page size:"
Expected: 364.19 x 272.65 pts (16:9 at 10pt) or similar 16:9 ratio. Flag if 4:3 (old projector format).
File size:
Compilation health (from .log file):
grep -c "Overfull \\\\hbox" FILE.log
grep -c "Undefined control sequence" FILE.log
grep -c "Citation.*undefined" FILE.log
grep -c "multiply defined" FILE.log
Source code static checks (from .tex file):
\pause / \onslide / \only usage → must be 0 (Hard Rule 1)\tiny usage → must be 0 (Hard Rule 13)\begin{thebibliography} → warn if missing (Hard Rule 11)Report format:
# Validation Report: [Filename]
| Check | Result | Status |
|-------|--------|--------|
| Slide count | N slides / Xmin duration | OK / WARNING |
| Aspect ratio | 16:9 | OK |
| File size | X.X MB | OK / WARNING |
| Overfull hbox | N warnings | OK / CRITICAL |
| Undefined references | N | OK / CRITICAL |
| Overlay commands | N found | OK / VIOLATION |
| Box fatigue violations | N slides | OK / WARNING |
| References slide | Present / Missing | OK / WARNING |
Overall: PASS / PASS WITH WARNINGS / FAIL
extract-figures [pdf] [pages]Extract figures from a paper PDF and prepare them for inclusion in Beamer slides.
Use when the user wants to reuse figures from an existing paper (their own or a cited work) instead of redrawing in TikZ.
Identify target figures — if user doesn't specify pages, use mcp__pdf-mcp__pdf_get_toc and mcp__pdf-mcp__pdf_read_pages to locate figures in the paper. Ask user which figures to extract if ambiguous.
Extract images from specified pages:
mcp__pdf-mcp__pdf_extract_images(path=PDF_PATH, pages=PAGES, output_dir="figures")
Uses output_dir to save images directly to figures/ as PNG files (original resolution, zero token cost).
Returns {page, index, width, height, format, file_path} metadata only — no base64 data.
Rename to descriptive names following the naming convention:
mv figures/page3_img0.png figures/fig-LABEL.png
Naming convention: fig-<descriptive-label>.png (e.g., fig-architecture.png, fig-results-table.png).
Generate LaTeX snippet — output ready-to-paste code:
Full-width figure:
\begin{frame}{Frame Title}
\begin{center}
\includegraphics[width=0.85\textwidth]{figures/fig-LABEL.png}
\end{center}
\vspace{-6pt}
{\small Source: \citet{author2024paper}}
\end{frame}
Figure + text side-by-side (columns layout):
\begin{frame}{Frame Title}
\begin{columns}[T]
\column{0.50\textwidth}
\includegraphics[width=\textwidth]{figures/fig-LABEL.png}
{\small Source: \citet{author2024paper}}
\column{0.45\textwidth}
Key observations:
\begin{itemize}
\item Point 1
\item Point 2
\end{itemize}
\end{columns}
\end{frame}
Two figures side-by-side (subfigure):
\begin{frame}{Frame Title}
\begin{figure}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{figures/fig-LEFT.png}
\caption{(a) Description}
\end{subfigure}\hfill
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{figures/fig-RIGHT.png}
\caption{(b) Description}
\end{subfigure}
\end{figure}
\end{frame}
Cropping guidance — if the extracted image contains surrounding text or margins that should be removed, use the trim and clip options:
\includegraphics[width=0.85\textwidth, trim=LEFT BOTTOM RIGHT TOP, clip]{figures/fig-LABEL.png}
bp (big points). Estimate from the image dimensions returned by pdf_extract_images.trim=50 200 50 100, clip to remove page margins and surrounding text.{\small Source: ...} below every extracted figure unless it's the user's own paper.booktabs.\usepackage{graphicx} is in the preamble (add if missing). If using subfigures, also ensure \usepackage{subcaption}.from-report [json_file]Generate a reproduction report Beamer presentation from result-analyzer output.
This action directly consumes beamer_report_data.json to auto-generate a complete Beamer .tex file.
Usage:
# Generate .tex from result-analyzer JSON
python beamer-skill/generate_beamer_report.py beamer_report_data.json -o reproduction_slides.tex
# Generate and compile to PDF
python beamer-skill/generate_beamer_report.py beamer_report_data.json -o slides.tex --compile
Integration flow:
result-analyzer (--beamer flag)
↓ outputs beamer_report_data.json
beamer-skill/generate_beamer_report.py
↓ reads JSON, generates .tex
reproduction_slides.tex → XeLaTeX → reproduction_slides.pdf
Generated slides:
Customization: After generation, you can manually edit the .tex or use other beamer-skill actions (review, audit, excellence) to polish the auto-generated slides.
Every task ends with verification. Non-negotiable.
[ ] Compiled without errors (xelatex exit code 0)
[ ] No overfull hbox > 10pt
[ ] All citations resolve
[ ] PDF opens and renders correctly
[ ] Visual spot-check of modified slides
For substantive correctness (not presentation), review through 5 lenses:
Severity: CRITICAL = math wrong. MAJOR = missing assumption. MINOR = could be clearer.
Error: ! Undefined control sequence. \llbracket
Cause: Missing stmaryrd package for double brackets.
Fix: Add \usepackage{stmaryrd} to preamble. Or define \newcommand{\llbracket}{[\![} as fallback.
Error: Overfull \vbox on a specific slide
Cause: Too much content for the frame height.
Fix priority:
\vspace values\small on one element (not the whole slide)\footnotesize (never \tiny)Error: Font "XXX" not found with XeLaTeX
Cause: System font not installed, or wrong font name.
Fix: Use fc-list | grep "FontName" to check available fonts. Fall back to default Latin Modern if custom font unavailable.
Error: Equations overflow slide width Cause: Long multi-term equation. Fix priority:
\begin{align} with line breaks at natural points (=, +)\resizebox{\textwidth}{!}{...} as last resort (degrades readability)Error: PDF images don't render in Quarto/web
Cause: Browsers cannot display PDF inline.
Fix: Convert to SVG: pdf2svg input.pdf output.svg. Never use PNG for diagrams (raster = blurry).
Error: Content visually overflows inside alertblock/exampleblock/block but compiler reports 0 warnings
Cause: Beamer suppresses overflow warnings inside block environments. Two distinct failure modes:
\vspace{-Xpt}.\vspace{-Xpt} inside the box\end{...block})\qquad with \quad or ,\\ at natural points