Published Apr 19, 2026
Claude Code can write, compile, and iterate on LaTeX
documents directly from your terminal—no GUI, no Overleaf, no manual pdflatex invocations required.
This post walks through the workflow and links to a PDF it generated, including a set of canonical econometric estimators.
This post, the .tex source, and the compiled PDF were produced entirely from the Code section of the Claude mobile app—no laptop, no terminal, no IDE.
The Claude mobile app includes a Code tab that runs a full Claude Code agent in the cloud. It has shell access, can install packages, compile documents, and commit to GitHub—everything you would do in a local terminal session, from your phone or tablet.
.tex file for whatever you need—an equation, a table, a full article.pdflatex (or xelatex) via its Bash tool, reads the .log for errors, and revises until the build is clean.
Because the Code agent has full shell access it can also install missing packages via tlmgr or
apt and place the finished PDF anywhere in your repository.
End every LaTeX request with "compile and fix any errors." For multi-pass documents (bibliographies,
cross-references), ask Claude to use latexmk -pdf instead of bare pdflatex. A minimal prompt looks like:
Write a one-page LaTeX document with the OLS and IV estimators in
amsmath align environments. Use the article class, 11pt font, 1-inch
margins via the geometry package. Compile with pdflatex and fix any
errors. Save to pdfs/estimators.pdf.
Below are the six estimators from the companion PDF, with the LaTeX source for each.
OLS
\hat{\beta}_{\mathrm{OLS}} = (X^\top X)^{-1} X^\top y
2SLS / IV
\hat{\beta}_{\mathrm{2SLS}} = \bigl(X^\top P_Z X\bigr)^{-1} X^\top P_Z y,
\qquad P_Z = Z(Z^\top Z)^{-1}Z^\top
Difference-in-Differences (two-way FE)
Y_{it} = \alpha + \tau D_{it} + \gamma_i + \delta_t + \varepsilon_{it}
Sharp Regression Discontinuity
\tau_{\mathrm{RD}}
= \lim_{x \downarrow c} \mathbb{E}[Y \mid X = x]
- \lim_{x \uparrow c} \mathbb{E}[Y \mid X = x]
Panel Fixed Effects (within estimator)
\hat{\beta}_{\mathrm{FE}}
= (\ddot{X}^\top\ddot{X})^{-1}\ddot{X}^\top\ddot{y},
\quad \ddot{y}_{it} \equiv y_{it} - \bar{y}_i
Efficient GMM
\hat{\theta}_{\mathrm{GMM}}
= \arg\min_{\theta}\; g(\theta)^\top S^{-1} g(\theta)
align environments instantly.estout, stargazer) directly from Python, R or even Stata output.pdflatex and lualatex without touching the source yourself.The companion PDF, the .tex source, and this blog post were all written and committed in a single Claude Code session run from the Code tab of the Claude mobile app— a few prompts and some back-and-forth iteration—all from a porch swing on a sunny Seattle day.
This workflow is collected alongside other tech productivity skills in tech-econ-productivity-skills, a repository of practical tools and techniques for economists working with code.