brycewang-stanford/Auto-Empirical-Research-Skills / skills/22-christopherkenny-skills/skills/latex-to-quarto
latex-to-quarto
VerifiedConverts LaTeX article-class .tex documents to Quarto .qmd format for multi-format publishing (HTML, PDF, Word). Use when asked to convert, port, migrate, or translate a .tex LaTeX file to Quarto; when porting an academic paper or manuscript from LaTeX to Quarto; when a .tex document needs to render to HTML, Word, or Typst PDF. Covers preamble → YAML front matter, section headings, text formatting, math, citations (natbib/biblatex), cross-references, figures, tables, lists, footnotes, hyperlinks, and special characters.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.9 KB |
| references/01-preamble-yaml.md | markdown | 6.0 KB |
| references/02-document-structure.md | markdown | 4.3 KB |
| references/03-text-formatting.md | markdown | 3.7 KB |
| references/04-math.md | markdown | 4.0 KB |
| references/05-citations.md | markdown | 3.4 KB |
| references/06-cross-references.md | markdown | 3.4 KB |
| references/07-figures.md | markdown | 3.8 KB |
| references/08-tables.md | markdown | 3.9 KB |
| references/09-sections-lists.md | markdown | 3.6 KB |
| references/10-misc.md | markdown | 5.2 KB |
references/08-tables.md
View on GitHub# Tables
Convert LaTeX `tabular`/`table` environments to Quarto pipe table syntax.
---
## Pipe Table Syntax Reference
```markdown
| Col A | Col B | Col C |
|:------|:-----:|------:|
| left | center | right |
| val | 2 | 3.14 |
: Table caption here. {#tbl-results}
```
- Column alignment from tabular spec: `l` → `:---`, `c` → `:---:`, `r` → `---:`
- Caption goes **below** the table after `: ` with `{#tbl-label}` at the end
- Blank line required between table body and caption line
---
## Full `table` Environment Conversion
```latex
\begin{table}[h]
\centering
\caption{OLS and IV estimates.}
\label{tab:results}
\begin{tabular}{lrr}
\hline
Method & Estimate & SE \\
\hline
OLS & 1.23 & 0.45 \\
IV & 1.89 & 0.67 \\
\hline
\end{tabular}
\end{table}
```
Becomes:
```markdown
| Method | Estimate | SE |
|:-------|--------:|-----:|
| OLS | 1.23 | 0.45 |
| IV | 1.89 | 0.67 |
: OLS and IV estimates. {#tbl-results}
```
---
## Booktabs Commands
| LaTeX | Action |
|-------|--------|
| `\toprule` | Replace with header separator (handled by pipe table header row) |
| `\midrule` | Remove (pipe table has implicit row separation) |
| `\bottomrule` | Remove |
| `\hline` | Remove (top/bottom), or represent mid-table breaks manually |
| `\cmidrule{2-4}` | Remove — no direct equivalent in pipe tables; flag |
| `\addlinespace` | Remove |
For booktabs tables, the header separator in the pipe table replaces `\toprule`/`\midrule`.
The closing `\bottomrule` is implicit in the pipe table.
---
## `tabular` Column Spec Conversion
| LaTeX spec | Quarto alignment |
|------------|-----------------|
| `l` | `:---` |
| `c` | `:---:` |
| `r` | `---:` |
| `p{3cm}` | `:---` (left-align; note fixed width is lost) |
| `m{3cm}` | `:---:` (center; fixed width lost) |
| `b{3cm}` | `:---` (left-align; fixed width lost) |
| `\|` (vertical rule) | Remove — pipe tables use implicit borders |
| `@{}` (no padding) | Remove |
Example: `{lrrr}` → four columns with alignments `:---`, `---:`, `---:`, `---:`
---
## `table*` (Span Two Columns)
```latex
\begin{table*}
...
\end{table*}
```
Convert the table contents normally. Add a note in your report that `table*`
(two-column spanning) is not directly supported in Quarto pipe tables for PDF output;
the user may need `{.column-page}` or a raw LaTeX block.
---
## `\multicolumn` (Flag for Review)
`\multicolumn{2}{c}{Header}` has no pipe table equivalent.
Flag these tables in your report with:
> **Manual review needed**: Table at line N contains `\multicolumn`. Pipe tables do not
> support cell spanning. Convert to a `knitr::kable()` / `gt` code chunk for full control,
> or restructure the table manually.
---
## `\multirow` (Flag for Review)
Similarly, `\multirow{2}{*}{text}` has no pipe table equivalent.
Flag for manual review with the same recommendation.
---
## `longtable` Environment
`longtable` produces multi-page tables in PDF. In Quarto:
- For static content, convert to a regular pipe table (it will paginate automatically in PDF)
- For computed content, use a code chunk with `knitr::kable()` + `longtable = TRUE`
Flag in report: if the table is very long, consider a code chunk.
---
## `tabularx` / `tabulary`
Convert column types:
- `X` (flexible width) → `:---` (left)
- `L`, `C`, `R` (tabulary) → `:---`, `:---:`, `---:`
The flexible-width behavior is lost in pipe tables; note this in your report.
---
## Inline Table Formatting
Inside table cells, apply the same inline formatting rules as prose:
| LaTeX | Quarto |
|-------|--------|
| `\textbf{val}` | `**val**` |
| `\textit{val}` | `*val*` |
| `\texttt{val}` | `` `val` `` |
| `$x^2$` | `$x^2$` |
---
## No-Caption Tables
A table with no `\caption` or `\label`:
```latex
\begin{tabular}{ll}
A & B \\
C & D \\
\end{tabular}
```
Becomes a plain pipe table with no caption line:
```markdown
| A | B |
|---|---|
| C | D |
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |