Back to Blog

automation

Tame LaTeX Regression Tables with This Agent Skill

Learn how this skill automates LaTeX regression table formatting, fixing overflow, alignment, and misplaced \omit errors.

OpenAgentSkillPublished:

Where this fits

You're an economist or quant researcher who just ran a battery of regressions in Python or Stata. You ask your coding agent to drop the results into results.tex with esttab-style formatting. Instead of a clean table, you get columns spilling past the margin, cramped notes, and a cryptic Misplaced \omit error from an \input-ed fragment. This skill exists to make that workflow painless—it knows the quirks of \estwide, \estauto, \specialcell, and the rest of the LaTeX empirical-table toolkit.

Why agents benefit

  • Diagnoses and fixes Misplaced \omit errors by understanding how \@@input and tabular fragments interact, so it doesn't just guess at a workaround.
  • Automatically selects the right layout (\estwide, \estauto, landscape) based on table width, column count, and the target journal's style.
  • Repairs common estout issues: misaligned columns, poor significance stars, cramped or boxed notes, and overflow beyond the right margin.
  • Matches reference paper formatting by parsing an example table and aligning fonts, spacing, and note placement to it.
  • Cleans up preamble and table fragments to avoid conflicts with \specialcell and minipage notes, ensuring a clean compile the first time.

Practical scenarios

Fixing a broken \input-ed table fragment

Your agent dumped a Stata esttab output into results.tex and main.tex throws Misplaced \omit. The skill recognizes the fragment is missing the \estwide wrapper and rewrites the \input structure, then verifies the document compiles.

Reformatting to match a journal's style

You need a three-panel table with notes filling the full width and stars at the 1%, 5%, and 10% levels. The skill reads your reference PDF, adjusts column alignment, chooses \estwide over \estauto, and regenerates the table without manual tweaking.

Converting from Python pyfixest to LaTeX

You have estimation results from pyfixest and want a publication-ready table. The skill generates the .tex preamble, defines the \sym command, and sets up a minipage note area—then runs a compile-and-verify loop to catch errors early.

Add it to your agent workflow

Install the skill with:

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

Then ask your agent: "Generate a regression table from results.csv using this skill, format it like the example in ref_table.pdf, and make sure it compiles." The skill will handle the rest.

Compare before adopting

Before adding this to your toolkit, weigh these factors:

  • Quality signals: Check the skill's star count (47 at time of writing) and whether the author actively maintains it—look for recent commits or issues.
  • Maintenance freshness: The README mentions consolidation of older skills; verify it's still aligned with your LaTeX distribution and estout version.
  • Alternatives: Generic LaTeX formatting skills exist, but they often lack the economics-specific estout and \estwide knowledge. If you only do beamer decks or letters, this is overkill.
  • Workflow fit: It triggers only on regression/estimation tables—make sure your agent doesn't over-apply it to unrelated LaTeX tasks.

Why it is worth tracking

This skill is a solid example of a niche, high-value automation for empirical researchers. Its consolidation of three older skills into one suggests active iteration, and the focus on compile-and-verify adds reliability. If you frequently generate or repair LaTeX tables from statistical software, it's worth evaluating now. For more context, see the skill's page on OpenAgentSkill.

Featured Skill

latex-empirical-tables

Skill by kennethkhoocy

Tame LaTeX Regression Tables with This Agent Skill | OpenAgentSkill