---
paths:
  - "**/*.tex"
---

# Rule: No Hard-Coded Results in LaTeX

## Principle

**Never hard-code computed results directly into `.tex` files.** Numbers, statistics, table contents, and regression outputs must come from exported files generated by the code pipeline, referenced via `\input{}`. If a value was computed, it must be imported — not typed.

## What Counts as Hard-Coding

- Typing specific coefficients, p-values, standard errors, or test statistics into a `.tex` file
- Writing sample sizes, means, or summary statistics directly in the text or tables
- Copy-pasting regression output into a `tabular` environment instead of importing a generated `.tex` table
- Manually entering figure captions with computed values (e.g., "N = 1,247" or "p < 0.001")

## What To Do Instead

- Use `\input{output/tables/table1.tex}` to include code-generated tables
- Use `\input{output/stats/descriptives.tex}` for inline statistics
- Use `\includegraphics{}` for code-generated figures (already standard practice)
- If the code pipeline has not yet generated the output file, use a placeholder:
  ```latex
  \input{output/tables/table1.tex} % TODO: generate from code
  ```
  This makes the dependency explicit and compilation will fail loudly if the file is missing, rather than silently embedding stale numbers.

## When This Applies

- Any `.tex` document that includes empirical results — papers, Beamer decks, presentations, reports
- Both `paper/` directories and standalone LaTeX projects
- Any time you are asked to "add results" or "include the output" in a document

## When to Skip

- **Illustrative or hypothetical examples** — made-up numbers for pedagogical purposes, not from real data
- **Metadata that IS the source of truth** — dates, author names, paper titles, grant numbers
- **Quick exploratory decks** — when the user explicitly says "just put the numbers in for now"
- **Teaching slides** — where values are pedagogical, not from an active analysis pipeline

## Why This Matters

Hard-coded results are non-replicable, non-traceable, and silently go stale. When the analysis is re-run, the exported files update but the hard-coded values in the deck do not — creating contradictions. The `\input{}` pattern ensures a single source of truth: the code pipeline generates the numbers, and the document simply displays them.
