home / skills / meleantonio / awesome-econ-ai-stuff / latex-tables

latex-tables skill

/_skills/writing/latex-tables

This skill generates publication-ready LaTeX regression and summary statistics tables with captions, notes, and aligned numeric output.

npx playbooks add skill meleantonio/awesome-econ-ai-stuff --skill latex-tables

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.9 KB
---
name: latex-tables
description: Generate publication-ready regression tables in LaTeX.
workflow_stage: writing
compatibility:
  - claude-code
  - cursor
  - codex
  - gemini-cli
author: Awesome Econ AI Community
version: 1.0.0
tags:
  - latex
  - tables
  - regression
  - booktabs
---

# LaTeX Tables

## Purpose

This skill creates clean, publication-ready tables in LaTeX for regression results and summary statistics, using standard academic formatting.

## When to Use

- Converting model output into LaTeX tables
- Standardizing table style across a paper
- Adding notes, significance stars, and labels

## Instructions

Follow these steps to complete the task:

### Step 1: Understand the Context

Before generating any code, ask the user:

- What type of table is needed (regression, summary stats, balance)?
- What software produced the results (Stata, R, Python)?
- Which formatting style is required (journal-specific, AEA, etc.)?

### Step 2: Generate the Output

Based on the context, generate LaTeX code that:

1. **Uses `booktabs`** for clean horizontal rules
2. **Includes labels and captions** for referencing in the paper
3. **Adds notes** for standard errors and significance
4. **Aligns numeric columns** for readability

### Step 3: Verify and Explain

After generating output:

- Explain how to compile the table
- Highlight any assumptions in the formatting
- Suggest refinements for journal submission

## Example Prompts

- "Create a regression table with three models in LaTeX"
- "Format summary statistics with mean and sd columns"
- "Add significance stars and standard error notes"

## Example Output

```latex
% ============================================
% Regression Table
% ============================================
\begin{table}[htbp]\centering
\caption{Effect of Treatment on Outcome}
\label{tab:main_results}
\begin{tabular}{lccc}
\toprule
 & (1) & (2) & (3) \\
\midrule
Treatment & 0.125*** & 0.118*** & 0.102** \\
 & (0.041) & (0.039) & (0.046) \\
Controls & No & Yes & Yes \\
Fixed Effects & No & Yes & Yes \\
\midrule
Observations & 2,145 & 2,145 & 2,145 \\
R-squared & 0.18 & 0.24 & 0.31 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item Notes: Standard errors in parentheses. * p<0.10, ** p<0.05, *** p<0.01.
\end{tablenotes}
\end{table}
```

## Requirements

### Software

- LaTeX distribution (TeX Live or MikTeX)

### Packages

- `booktabs`
- `threeparttable` (optional for notes)

## Best Practices

1. **Keep tables compact** and readable
2. **Use consistent notation** for standard errors and stars
3. **Provide clear captions and labels**

## Common Pitfalls

- Overly wide tables that do not fit the page
- Missing notes for standard errors
- Inconsistent labeling across tables

## References

- [LaTeX booktabs documentation](https://ctan.org/pkg/booktabs)
- [AEA Author Guidelines](https://www.aeaweb.org/journals/policies/author-instructions)

## Changelog

### v1.0.0

- Initial release

Overview

This skill generates publication-ready LaTeX tables for regression results and summary statistics with academic formatting. It produces clean code using booktabs, aligned numeric columns, labels, captions, and notes for standard errors and significance stars. The output is ready to drop into a LaTeX document and easy to adapt to journal styles.

How this skill works

You tell the skill the table type (regression, summary, balance), the software that produced the output (Stata, R, Python), and any journal/style constraints. The skill builds a LaTeX table using booktabs, optional threeparttable for notes, aligned numeric columns, and a caption/label. It also adds significance stars, standard-error rows, and a compact notes block, and returns brief compilation and refinement instructions.

When to use it

  • Converting regression output from Stata, R, or Python into LaTeX
  • Standardizing table style across a manuscript or replication package
  • Preparing summary statistics or balance tables for appendices
  • Adding clear notes, significance stars, and labels for submission
  • Creating multi-model side-by-side regression tables

Best practices

  • Keep tables as narrow as possible; prefer compact variable names and abbreviations
  • Use booktabs for horizontal rules and threeparttable for notes when needed
  • Align numeric columns on the decimal point for readability
  • Include clear captions, labels, and a notes block explaining standard errors and stars
  • Test compile with your target LaTeX class and adjust column widths or font size for fit

Example use cases

  • Three-column regression table with controls and fixed effects, plus standard errors in parentheses
  • Summary statistics table with mean and standard deviation columns and sample size
  • Balance table for pre-treatment covariates with mean differences and p-values
  • Appendix tables formatted to AEA-style with notes and data source line
  • Quick conversion of a Python/R model summary into ready-to-use LaTeX code

FAQ

Which LaTeX packages are required?

booktabs is required for clean rules; threeparttable is recommended for notes. Use siunitx if you want automatic decimal alignment.

Can you match a journal-specific style?

Yes. Provide the journal or a sample table and I will adapt caption, label placement, font size hints, and notes formatting to match common journal conventions.