跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
演示文稿

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 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.

kennethkhoocy · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add kennethkhoocy/applied-micro-skills --skill latex-empirical-tables

技能说明


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 scratchSection A
Fix or reformat existing estout tables (overflow, cramped notes, stars, alignment)Section B
Diagnose a "Misplaced \omit" error from an \input-ed fragmentSection C
Merge several self-compiling block results.tex files into one master documentSection D
Fix skipped table numbers (Table 1, Table 3, ...) when \captionof + longtable are combinedSection 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).

MacroUse caseEnvironment
\estauto{file}{ncols}{colspec}Standard-width tablestabular
\estwide{file}{ncols}{colspec}Full-page-width tablestabular*
\estautoLT{file}{ncols}{colspec}Multi-page tableslongtable

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
阅读完整来源 ↗