Appendix K — B.5 — Overleaf + the AEA LaTeX Template
Your capstone paper has to look like an economics paper, because that is the form a referee — and the Journal of Student-Scientists’ Research (JSSR), GMU Mason Publishing — expects to read. The tool the field uses to produce that look is LaTeX, and this section teaches you enough of it to compile the minimal-but-complete paper skeleton you met in Lab 8, by two routes: Overleaf, a browser editor that needs nothing installed, and a local latexmk/tectonic build on the camp container. It closes the loop you have been building all camp by wiring the paper’s compile step into the one-click replication packet of Lab 8, so that “rebuild the paper from raw data” is one command and the PDF is never hand-assembled.
A clarification up front, so you do not go looking for a tool we do not use: Lab 8 deliberately builds the skeleton on the plain article document class and notes that the official AEA class drops in with a one-line change. This appendix does the same. You learn the shape on article — which compiles anywhere, including a fresh Overleaf project with nothing extra installed — and swap to the AEA class only when the camp distributes the template file. The exact AEA class and BibTeX-style filenames are tagged [CHECK] throughout, because they belong to a file the camp hands you, not one we can copy here.
B.5.1 What LaTeX is, and why papers use it
You have written documents in a word processor: you type, and what you see on screen is what prints. LaTeX works differently. It is a typesetting system — you write a plain-text source file marked up with commands (\section{...}, \cite{...}, $\hat{\beta}$), and a program compiles that source into a finished, beautifully laid-out PDF. The model is “describe what you mean, let the system handle how it looks,” the same separation of content from presentation you have seen between data and a plot, or between a CSV and the table it becomes. You do not drag a figure into position or nudge an equation by hand; you say \includegraphics or open $$...$$ and LaTeX places it according to professional typesetting rules built in decades ago.
Why does empirical economics use it almost universally, when word processors exist? Four reasons, each of which matters for your paper specifically.
The first is mathematics. A regression equation, a matrix expression like \hat{\boldsymbol{\beta}} = (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{y}, a properly set \xrightarrow{p} — LaTeX renders these the way the field reads them, and it is the source of the very math notation CONVENTIONS §3 standardizes for this book. A word processor’s equation editor is a struggle by comparison.
The second, and the one that matters most for the replication discipline you built in Lab 8, is that LaTeX source is plain text, which means it is programmable and diffable. Your analysis code can write a .tex table file directly (you saw 03_analysis.py do exactly this in Lab 8), and your paper can \input it — so the coefficient −1.8 lives in one generated file and flows into the PDF untouched by human hands. A binary word-processor document cannot be generated by a script or version-controlled line-by-line; a .tex file can be committed to Git, reviewed in a pull request, and rebuilt from raw data on a stranger’s machine. LaTeX is what makes the “no number is ever typed by hand” promise mechanically enforceable.
The third is cross-references and citations that maintain themselves. You label a table \label{tab:main} and refer to it as Table~\ref{tab:main}; if you reorder sections and it becomes Table 3, every reference updates on the next compile. You cite a paper with \cite{key} and LaTeX assembles the reference list and numbers it for you. Renumbering by hand — the classic way to ship a paper that says “see Table 2” pointing at Table 4 — simply does not happen.
The fourth is consistency and journal conformance: every section heading, every caption, every margin is set by the document class, so the paper looks uniform and matches the journal’s house style by loading the journal’s class file. That is precisely what the AEA template does.
B.5.2 Overleaf basics: projects and compiling
Overleaf is LaTeX in a web browser. It needs nothing on your machine — no TeX install, no command line — which is exactly why Lab 8 names it the fallback for students whose laptops have no LaTeX engine. You write source in the left pane, click Recompile, and the PDF renders in the right pane. For a camp where some students are on locked-down school laptops, this is the path that always works.
The unit of work in Overleaf is a project — a folder of files (your main.tex, a tables/ subfolder, a figures/ subfolder, a references.bib) that compile together into one PDF. To start your capstone paper, create a new blank project, then upload your paper/ folder preserving its structure: main.tex at the top, the tables/ and figures/ subfolders beneath it. The structure matters because your source refers to those subfolders by relative path — \input{tables/main_results.tex} and \graphicspath{{figures/}} only resolve if Overleaf keeps the folders where your .tex expects them, and it does.
Three settings get a first compile working, all under the project menu:
- Main document. Tell Overleaf which file is the root to compile —
main.tex. (Overleaf usually auto-detects the file containing\documentclass, but set it explicitly if it guesses wrong.) - Compiler. Set it to pdfLaTeX for the plain-
articleskeleton. When you add BibTeX citations (B.5.4), Overleaf still runs the right sequence automatically; you do not change the compiler for that. - Recompile. Click it. The PDF appears; warnings and errors show in a log panel you can expand. Overleaf reruns LaTeX as many passes as your cross-references and citations need, so a
\refthat shows as??on a first manual pass resolves on its own here.
There is one discipline Overleaf does not enforce, and it is the same one Lab 8 hammers: the tables/ and figures/ you upload must be the ones your code just generated, not files you edited in the browser. Overleaf is a compiler, not a place to author results. If you fix a coefficient by hand in the Overleaf editor, you have broken the chain from raw data to PDF and reintroduced exactly the drift the replication packet exists to prevent. The honest workflow is: regenerate the artifacts with your analysis (locally or on the container), then upload them; Overleaf only typesets. Overleaf also supports a Git/GitHub link, so an advanced workflow pushes the generated paper/ folder from your repo and Overleaf pulls it — but the rule is unchanged: results are authored by code, Overleaf merely renders them.
B.5.3 A minimal AEA-style article skeleton
Here is the complete skeleton — the same one Lab 8 builds, reproduced so this appendix stands on its own as the setup reference. It is small but complete in shape: a title block, an abstract, the standard empirical-paper sections, a results section that pulls in a generated table and a generated figure, and a reference list. Write it to paper/main.tex.
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx} % \includegraphics for figures
\usepackage{booktabs} % \toprule/\midrule/\bottomrule for clean tables (Appendix D)
\usepackage{amsmath} % aligned equations, \text, matrices
\usepackage{hyperref} % clickable \ref and \cite
\graphicspath{{figures/}} % so \includegraphics finds figures/ without a path prefix
\title{Fair-Lending Examination Programs and the Minority--White Denial Gap}
\author{Maya R.\thanks{ASSIP 2026 (Aspiring Scientists Summer Internship Program), George Mason University.}}
\date{August 12, 2026}
\begin{document}
\maketitle
\begin{abstract}
We estimate how state fair-lending examination programs affect the county-level
minority--white mortgage-denial gap, exploiting the staggered timing of adoption.
We find the gap narrows by about 1.8 percentage points after adoption, with flat
pre-adoption trends consistent with the identifying assumption.
\end{abstract}
\section{Introduction}
The hook, the one-line contribution, and a one-sentence preview of the finding.
\section{Data}
Sources, sample, and construction; point at the data cards in the packet.
\section{Empirical design}
State the specification in the CONVENTIONS \S4 form: outcome, treatment, controls,
fixed effects, clustering, sample, and the identifying-assumption sentence.
\section{Results}
Table~\ref{tab:main} reports the headline estimate; Figure~\ref{fig:event} plots the
event-study coefficients, whose flat pre-period leads visualize the parallel-trends defense.
\input{tables/main_results.tex} % the table the ANALYSIS wrote -- never typed
\begin{figure}[t]\centering
\includegraphics[width=0.72\linewidth]{event_study.pdf} % the figure the analysis wrote
\caption{Event-study estimates with 95\% confidence intervals.}
\label{fig:event}
\end{figure}
\section{Conclusion}
What you showed, under which assumption, and what you are \emph{not} claiming.
\begin{thebibliography}{9}
\bibitem{cs} Callaway, B., \& Sant'Anna, P.~H.~C. (2021). Difference-in-differences
with multiple time periods. \textit{Journal of Econometrics}, 225(2), 200--230.
\end{thebibliography}
\end{document}Read the structure top to bottom. \documentclass[12pt]{article} picks the class and a base font size; the \usepackage{...} lines load features (geometry for margins, graphicx for figures, amsmath for math, hyperref for clickable links, booktabs for the table rules Appendix D requires). \title/\author/\date populate the header that \maketitle then prints. abstract is a named environment — \begin{abstract}...\end{abstract} — and so is figure. Each \section{...} starts a numbered section. The two load-bearing lines, and the entire reason this is not copy-and-paste, are \input{tables/main_results.tex} — which splices in the table file your code generated — and \includegraphics[...]{event_study.pdf} — which embeds the figure your code saved. The number −1.8 appears only inside the generated main_results.tex; main.tex reads it, never contains it.
Dropping in the real AEA class. When the camp distributes the AEA template, the body of this file does not change — only the first line and the bibliography mechanism. You write \documentclass[12pt]{aea} instead of article, and (B.5.4) switch the manual reference list for a BibTeX .bib file with the AEA’s .bst style. Everything between \begin{document} and \end{document} — the title block, abstract, sections, the \input/\includegraphics — stays identical. [CHECK] the exact AEA class and .bst filenames against the template the camp hands you; they are referenced here by their standard names, not copied from a distributed file. The AEA’s official author resources page (https://www.aeaweb.org/journals/policies/templates [CHECK]) is the authoritative source.
B.5.4 BibTeX hygiene, and the natbib trap from Lab 8
The skeleton above hard-codes its one reference inside a thebibliography block. That is fine for a single citation, but a real paper cites twenty or fifty, and you do not want to format each by hand or renumber them when you add one. The scalable mechanism is BibTeX: you keep your references in a separate .bib database, cite each by a short key in the text, and a .bst bibliography style file formats the reference list automatically in the journal’s house style.
A .bib file is a plain-text list of entries, one per source. Put yours in paper/references.bib:
@article{callaway2021,
author = {Callaway, Brantly and Sant'Anna, Pedro H. C.},
title = {Difference-in-Differences with Multiple Time Periods},
journal = {Journal of Econometrics},
year = {2021},
volume = {225},
number = {2},
pages = {200--230}
}The token right after the brace — callaway2021 — is the citation key, your handle for this source. In the text you write \cite{callaway2021} (or \citet/\citep under natbib, below), and at the spot you want the reference list you replace the manual thebibliography block with two lines naming the style and the database:
\bibliographystyle{aer} % the AEA/AER .bst style -- [CHECK] exact filename
\bibliography{references} % reads references.bib; the .bib extension is impliedNow LaTeX builds the reference list from only the entries you actually \cite, formats them per the style, and numbers and orders them for you. Add a source by adding a .bib entry and citing it; delete one by removing the \cite. This is the version of “the data lives in one place” applied to your bibliography.
The natbib trap — the exact bug that bit the verification of Lab 8. There are two ways to make references, and you must pick one, never half of each. (1) The manual way:
\cite{key}with a hand-written\begin{thebibliography}...\bibitem{key}...\end{thebibliography}block, as in the B.5.3 skeleton. (2) The BibTeX way: a.bibfile with\bibliographystyle{}and\bibliography{}, as just shown. The mistake is to load thenatbibpackage (which gives author-year citations like “Callaway and Sant’Anna (2021)” via\citet/\citep) and keep a manualthebibliographyblock. In author-year mode,natbibis incompatible with a hand-writtenthebibliography, and the build dies withPackage natbib Error: Bibliography not compatible with author-year citations. The fix is to commit to one mechanism: either plain\cite{}+\bibitem{}with no natbib (the working skeleton), or full BibTeX with a.bibfile and a.bststyle (and then natbib’s\citet/\citepare fine, because the reference list is generated, not hand-written). Do not mix the half-and-half.
So natbib vs. plain, decided: plain \cite{} produces numbered references (“[1]”) and pairs happily with a manual thebibliography for a tiny paper. natbib produces the author-year citations economics readers expect (“Callaway and Sant’Anna, 2021”) and is what the AEA style assumes — but only with a generated BibTeX bibliography, never a hand-written one. For your capstone, the clean choice is the BibTeX path with the AEA .bst; the manual path in the skeleton is the training-wheels version that compiles with zero extra files. One more hygiene rule: every .bib entry is a citation, so every entry must be verifiable — CONVENTIONS §6 demands a real primary source for every empirical claim, and Chapter 6.5 warns that an LLM will fabricate perfectly formatted but nonexistent references. Verify each entry against the journal or a DOI before it enters references.bib, and tag anything you cannot confirm [CHECK] rather than letting fiction into your bibliography.
B.5.5 The local latexmk / tectonic path
On the camp container you skip the upload and compile in place. The TeX engine is installed (Lab 8’s setup confirms latexmk, tectonic, and pdflatex on the PATH), so the build is one command. The robust choice is latexmk, a driver that figures out how many passes LaTeX needs to resolve cross-references and citations — and runs bibtex in between for you — so you do not have to remember the latex/bibtex/latex/latex incantation by hand:
cd paper
latexmk -pdf -interaction=nonstopmode main.tex # builds main.pdf, reruns passes as needed-pdf selects PDF output (via pdflatex); -interaction=nonstopmode means a recoverable warning does not halt to wait for keyboard input — essential when this line runs unattended inside a Makefile. If you prefer a single self-contained engine that needs no separate driver and downloads any missing packages on first use, tectonic is one command:
cd paper
tectonic main.tex # resolves passes internally, writes main.pdfEither way you get paper/main.pdf. To start clean while debugging — which you will do constantly — latexmk -C deletes every auxiliary file (.aux, .bbl, .log, .fls, .fdb_latexmk, .out) and the PDF, so the next build is from nothing. Two things from verifying Lab 8 carry over. First, a first run on a fresh paper may print “Latex failed to resolve N reference(s)” and rerun automatically — that is latexmk doing its job across passes, not a failure; the final exit code is what you check. Second, a genuinely broken build (a missing \input file, an undefined command, the natbib clash above) exits non-zero and names the offending line in main.log — find it with grep -nE "^!|Error" main.log. If you are on a personal laptop with no TeX install and none of these resolve, that is fine: use the Overleaf path of B.5.2 instead. The .tex is the durable deliverable; the PDF is a convenience some machines produce and some cannot.
B.5.6 Wiring the paper into the one-click replication packet
This is where the appendix earns its place: the paper compile is the last target of the one-click replication packet you built in Lab 8. The packet’s whole claim is that a stranger can type one command and watch your paper rebuild from raw data to finished PDF — and the PDF step is exactly the latexmk line above, invoked by make after the data has been pulled, the dataset built, and the tables and figures generated by code into paper/tables/ and paper/figures/.
Recall the dependency chain from Lab 8’s Makefile: make all wants paper, which depends on tables and figures, which depend on data. The paper target is just the compile:
paper: tables figures ## compile the manuscript, pulling in the just-built artifacts
cd paper && latexmk -pdf -interaction=nonstopmode main.texBecause paper depends on tables figures, make guarantees the generated .tex table and the .pdf figure exist before LaTeX runs — so \input{tables/main_results.tex} and \includegraphics{event_study.pdf} always find current, code-written files, never stale or hand-edited ones. For a teammate without make (Windows laptops especially), Lab 8’s run_all.py does the same thing and gates the compile on whether an engine exists, via shutil.which: if latexmk or tectonic is present it compiles; if neither is, it skips cleanly and prints that the .tex is assembled and ready to build on Overleaf. That gate is the bridge between this section’s two roads — local build when an engine exists, Overleaf when it does not — wired so the same packet works on both.
The honesty test from Lab 8 closes the loop: make clean && make all deletes every derived file and rebuilds from nothing, and md5sum -c before.txt confirms the table .tex comes back byte-identical. (The figure PDF comes back identical too only if you pinned its metadata date — savefig(..., metadata={"CreationDate": None}) — because matplotlib otherwise stamps the wall-clock time into the PDF; knowing that a changed timestamp is cosmetic while a changed coefficient is a broken packet is the skill.) The LaTeX you learned here is the typesetting half of that machine: code writes the numbers into .tex, LaTeX renders the .tex into a PDF, and make chains the two so no number is ever typed by hand.
B.5.7 Where this connects
This appendix sits at the end of the toolchain Appendix B builds. The conda environment and editor are from B.1; the GitHub repository this paper lives in, and pushes to Overleaf from, is from B.2; the licensed-data caveat — the packet ships the pull recipe, never the data — comes from B.3 and, for the on-cluster compute, B.4. The table craft you will pour into main_results.tex (booktabs rules, what goes in the notes, significant digits) is Appendix D.1; the replication-packet standard the whole compile serves is Appendix D.4; and the build-it-live procedure is Lab 8. The single sentence to carry out of here: LaTeX is the typesetting engine that lets your code write your paper’s numbers, so that “rebuild the paper from raw data” stays one honest command from the first commit to the conference. Confirm every [CHECK] — the AEA class name, the .bst style filename, the official template URL — against the template the camp distributes before you submit, and the rest is the workflow you just learned, unchanged.