Skip to content

brycewang-stanford/Auto-Empirical-Research-Skills / skills/22-christopherkenny-skills/skills/latex-to-quarto

latex-to-quarto

Verified

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

references/02-document-structure.md

View on GitHub
# Document Structure

---

## Wrapper Commands (Remove)

Remove these structural LaTeX commands — they have no Quarto equivalent in the body:

| LaTeX | Action |
|-------|--------|
| `\begin{document}` | Remove |
| `\end{document}` | Remove |
| `\maketitle` | Remove (title rendered from YAML automatically) |
| `\tableofcontents` | Remove from body; add `toc: true` under the relevant format in YAML |
| `\listoffigures` | Remove (no direct equivalent; flag if needed) |
| `\listoftables` | Remove (no direct equivalent; flag if needed) |

---

## Abstract

Move `\begin{abstract}...\end{abstract}` to YAML (see [01-preamble-yaml.md](01-preamble-yaml.md)):

```latex
\begin{abstract}
  We study the effect of X on Y using panel data from 1990–2020.
  Our results show a significant positive relationship.
\end{abstract}
```

→ Remove from body; add to YAML front matter:

```yaml
abstract: |
  We study the effect of X on Y using panel data from 1990–2020.
  Our results show a significant positive relationship.
```

If there is a `\section*{Abstract}` heading followed by body text (no environment), move
the text to YAML the same way and remove the heading.

---

## Keywords

| LaTeX | Quarto YAML |
|-------|-------------|
| `\keywords{key1, key2, key3}` | `keywords: [key1, key2, key3]` |
| `\begin{keywords}...\end{keywords}` | `keywords: [...]` (move to YAML) |

---

## Appendices

| LaTeX | Quarto |
|-------|--------|
| `\appendix` (standalone command) | Remove the command; mark the first appendix section (see below) |
| `\section{Data}` (after `\appendix`) | `# Data {.appendix}` |
| `\section*{Data}` (after `\appendix`) | `# Data {.appendix .unnumbered}` |

The `{.appendix}` attribute on the first post-appendix heading triggers Quarto's appendix
numbering (A, B, C...). All subsequent headings at the same level in the appendix region
are automatically included.

```latex
% LaTeX
\appendix
\section{Additional Tables}
\section{Proofs}
```

```markdown
<!-- Quarto -->
# Additional Tables {.appendix}

# Proofs
```

---

## Acknowledgements

| LaTeX | Quarto |
|-------|--------|
| `\section*{Acknowledgements}` + body text | Keep as `# Acknowledgements {.unnumbered}` in body |
| `\thanks{...}` inside `\author{}` | Move content to `acknowledgements:` YAML field or a body footnote `^[...]` |
| `\thanks{...}` inside `\title{}` | Move to a footnote on the title or `acknowledgements:` YAML field |

---

## Theorem-Like Environments (Flag for Review)

These require manual review — there is no single automatic conversion:

| LaTeX | Suggested Quarto |
|-------|------------------|
| `\begin{theorem}...\end{theorem}` | `::: {.callout-note}\n**Theorem.** ...\n:::` |
| `\begin{proof}...\end{proof}` | `::: {.callout-tip}\n**Proof.** ... $\square$\n:::` |
| `\begin{lemma}...\end{lemma}` | `::: {.callout-note}\n**Lemma.** ...\n:::` |
| `\begin{corollary}...\end{corollary}` | `::: {.callout-note}\n**Corollary.** ...\n:::` |
| `\begin{remark}...\end{remark}` | `::: {.callout-tip}\n**Remark.** ...\n:::` |
| `\begin{definition}...\end{definition}` | `::: {.callout-note}\n**Definition.** ...\n:::` |
| `\begin{example}...\end{example}` | `::: {.callout-note}\n**Example.** ...\n:::` |
| `\begin{assumption}...\end{assumption}` | `::: {.callout-caution}\n**Assumption.** ...\n:::` |
| `\begin{proposition}...\end{proposition}` | `::: {.callout-note}\n**Proposition.** ...\n:::` |

For numbered theorems (e.g., "Theorem 2"), consider the
[`theorems` Quarto extension](https://github.com/quarto-ext/theorem-callouts) or
leave as a callout div with a manually added number.

### Callout Syntax Reference

```markdown
::: {.callout-note}
**Theorem 1.** For all $x > 0$, we have $f(x) > 0$.
:::

::: {.callout-tip}
**Proof.** By definition of $f$... $\square$
:::
```

Available callout types: `note`, `warning`, `important`, `tip`, `caution`.

---

## Multi-Part and Include Files (Flag for Review)

| LaTeX | Suggested Quarto |
|-------|------------------|
| `\input{sections/intro}` | Inline the file contents directly, OR use `{{< include sections/intro.qmd >}}` |
| `\include{sections/intro}` | Same as `\input` — inline or use `{{< include >}}` |

When inlining, convert the included file using the same rules as the main document.
When using `{{< include >}}`, note that the included file must be `.qmd`, not `.tex`.

Flag each `\input`/`\include` occurrence with the filename so the user can decide.
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall