Skip to content
Data
Skill

/latex-empirical-tables

Set up, format, fix, and clean up LaTeX regression and estimation tables in empirical economics or finance papers. Use when (a) creating a .tex, results.tex, main.tex, or preamble to display regression or estimation output from Python (pyfixest), Stata, or R — including any

From plugin
applied-micro-skills
2017 skills

Claude Code

$ npx -y skills add kennethkhoocy/applied-micro-skills --skill latex-empirical-tables --agent claude-code

SKILL.md

latex-empirical-tables.SKILL.md
name: latex-empirical-tables
description: >-
  Set up, format, fix, and clean up LaTeX regression and estimation tables in empirical
  economics or finance papers. Use when (a) creating a .tex, results.tex, main.tex, or
  preamble to display regression or estimation output from Python (pyfixest), Stata, or R
  — including any mention of estout, esttab, estauto, estwide, or table fragments;
  (b) formatting or repairing estout-style regression tables that overflow the right margin,
  have cramped or boxed notes, misaligned columns, or poor significance stars, or when asked
  to match a reference paper, make the note fill the table width, or choose among \estwide,
  \estauto, and landscape layouts; (c) diagnosing "Misplaced \omit" errors from \input-ed
  table fragments inside tabular environments. Covers \@@input, \estwide, \estauto, \estautoLT,
  \specialcell, \sym, minipage notes below tabulars, and the convert-and-verify workflow.
  Do NOT trigger for general LaTeX documents like beamer presentations, problem sets, letters,
  or CVs.
metadata:
  author: Claude Code
  version: 1.1.0
  date: 2026-07-20
  consolidates: Merges estout-table-formatting, latex-results-preamble, and latex-input-multicolumn-omit-fix into one skill.

LaTeX Empirical Tables

Empirical economics and finance papers export regression and estimation output as estout/esttab "body fragments" — rows of `\multicolumn` headers, coefficients with `\sym` stars, and parenthesised p-values or SEs, with no `\toprule`/`\bottomrule` — pulled into the manuscript through a wrapper macro (`\estauto`/`\estwide`/`\estautoLT`). Done well this reads like a top-journal table. Done naively it looks broken: wide tables spill past the right margin, the note legend is jammed inside the tabular as a boxed cell, columns sit at uneven widths, and `\input`-ed fragments throw "Misplaced \omit". This skill sets a results `.tex` up from scratch, converts ugly estout tables to the gold-standard pattern, and diagnoses the `\omit` error. The reasoning behind each choice is given so you can adapt rather than copy blindly.

Routing

| You want to... | Go to | |----------------|-------| | Set up `results.tex`/`main.tex` and its preamble from scratch | Section A | | Fix or reformat existing estout tables (overflow, cramped notes, stars, alignment) | Section B | | Diagnose a "Misplaced `\omit`" error from an `\input`-ed fragment | Section C | | Merge several self-compiling block `results.tex` files into one master document | Section D | | Fix skipped table numbers (Table 1, Table 3, ...) when `\captionof` + `longtable` are combined | Section D |

---

Section A — Build a results document from scratch

When producing regression or estimation tables, follow this workflow to create a compilable LaTeX document with a standard empirical-economics preamble and estout macros.

Directory structure

All output lives under `outline/` relative to the project root:

outline/
├── preamble/
│   └── preamble.tex    ← LaTeX preamble (no \begin{document})
├── Tables/
│   ├── table_01.tex    ← table fragments (auto-increment)
│   ├── table_02.tex
│   └── ...
├── Figures/
│   └── ...             ← figures (.pdf, .png, etc.)
└── results.tex         ← master document (created on first table)

Step-by-step workflow

1. Ensure directories exist

Create `outline/preamble/` and `outline/Tables/` if they don't already exist. Also create `outline/Figures/` if figures will be produced.

2. Save the preamble

Copy `references/preamble.tex` from this skill's directory to `outline/preamble/preamble.tex`. This file contains everything up to but NOT including `\begin{document}` — the document class, all packages, and the estout macro definitions (`\estauto`, `\estwide`, `\estautoLT`, `\sym`, `\specialcell`). The macros are defined there in full; Section B lists a minimal subset if you only need to graft them onto an existing preamble.

Do NOT create `outline/results.tex` yet — it gets created automatically when the first table is generated.

3. When producing a table

Each time a regression or summary table is generated:

1. Save the table fragment to `outline/Tables/table_XX.tex` with auto-incrementing numbering (01, 02, 03, ...).

2. If `outline/results.tex` does **not** exist, create it:

   \input{preamble/preamble}

   \begin{document}

   \section{Tables}

   \subsection{Descriptive Title}
   \begin{table}[H]
   \caption{Descriptive Title}
   \centering
   \estauto{Tables/table_01.tex}{N}{D{.}{.}{-1}}
   \end{table}
   \FloatBarrier

   \end{document}

3. If `outline/results.tex` **already exists**, insert the following block BEFORE `\end{document}`:

   \subsection{Descriptive Title}
   \begin{table}[H]
   \caption{Descriptive Title}
   \centering
   \estauto{Tables/table_XX.tex}{N}{D{.}{.}{-1}}
   \end{table}
   \FloatBarrier

Where `N` = number of data columns in the fragment (excluding the label column).

Estout table macros

Three macros are defined in the preamble for including table fragments generated by any tool (pyfixest, esttab, R, etc.). All use the TeX primitive `\@@input` to avoid `\multicolumn`/`\omit` errors (Section C explains why this matters).

| Macro | Use case | Environment | |-------|----------|-------------| | `\estauto{file}{ncols}{colspec}` | Standard-width tables | `tabular` | | `\estwide{file}{ncols}{colspec}` | Full-page-width tables | `tabular*` | | `\estautoLT{file}{ncols}{colspec}` | Multi-page tables | `longtable` |

The default column spec is `D{.}{.}{-1}` (decimal-aligned via `dcolumn`). Use `c` only when columns contain non-numeric content.

Table fragment format

Fragments must follow these conventions — the wrapper macros add `\toprule` and `\bottomrule`, so fragments should NOT include them.

Structure:

  • Column headers: `\multicolumn{1}{c}{(1)}` style
  • Group headers: `\multicolumn{N}{c}{Group Name}` with `\cmidrule(lr){start-end}`
  • Coefficients righ
Read more
@kennethkhoocy
Ships withapplied-micro-skills

Claude Code and Codex skills for empirical applied-microeconomics research: reproducibility auditing, LLM-assisted classification methods, event studies, data infrastructure (WRDS, Stata, pyfixest), and publication-grade tables, figures, and documents.

Stars on GitHub

Momentum

stars in total
20
Star history of kennethkhoocy/applied-micro-skills on GitHub, a chart by star-history.com

Other skills on applied-micro-skills.

More skills from other plugins.

context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem05d69k
@mem0ai@mem0aiInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

posthog11d41k
@posthog@posthogInstall Skill

Questions about latex-empirical-tables.

Which coding agents can use latex-empirical-tables?
latex-empirical-tables installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.