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/05-citations.md

View on GitHub
# Citations

Convert all natbib and biblatex citation commands to Pandoc bracket syntax.
Pandoc citations work in all Quarto output formats (HTML, Word, Typst PDF, LaTeX PDF).

The `.bib` file is referenced in YAML and left **unchanged**.

---

## natbib Commands

| LaTeX | Quarto | Notes |
|-------|--------|-------|
| `\cite{key}` | `[@key]` | |
| `\citep{key}` | `[@key]` | Parenthetical |
| `\citep{a,b}` | `[@a; @b]` | Split comma-separated keys |
| `\citep[p.~5]{key}` | `[@key, p. 5]` | Suffix/locator only |
| `\citep[see][p.~5]{key}` | `[see @key, p. 5]` | Prefix + locator |
| `\citep[see][]{key}` | `[see @key]` | Prefix only |
| `\citet{key}` | `@key` | Narrative (in-text) citation |
| `\citet{a,b}` | `@a and @b` | Multiple narrative — join with "and" |
| `\citealt{key}` | `@key` | No parentheses (like `\citet` without parens) |
| `\citealt[p.~3]{key}` | `@key [p. 3]` | No parentheses with locator |
| `\citealp{key}` | `@key` | Like `\citep` without parentheses |
| `\citeauthor{key}` | `@key` | Author name only — loses "author-only" semantics; flag in report |
| `\citeyear{key}` | `[-@key]` | Year only; `-` suppresses author |
| `\citeyearpar{key}` | `[-@key]` | Year in parentheses |
| `\nocite{key}` | Move to YAML `nocite: '@key'` | Remove from body |
| `\nocite{*}` | Move to YAML `nocite: '@*'` | All bibliography entries |

### Multiple Keys in One Command

| LaTeX | Quarto |
|-------|--------|
| `\citep{a,b,c}` | `[@a; @b; @c]` |
| `\citet{a,b}` | `@a and @b` |
| `\cite{a,b,c}` | `[@a; @b; @c]` |

### Locators: Tilde and Spacing

Remove LaTeX non-breaking spaces and spacing commands in locators:

| LaTeX locator | Quarto locator |
|---------------|---------------|
| `p.~5` | `p. 5` |
| `pp.~5--8` | `pp. 5–8` |
| `chap.~2` | `chap. 2` |
| `fig.~3` | `fig. 3` |

---

## biblatex Commands

| LaTeX | Quarto | Notes |
|-------|--------|-------|
| `\cite{key}` | `[@key]` | |
| `\parencite{key}` | `[@key]` | Parenthetical |
| `\parencite[p.~5]{key}` | `[@key, p. 5]` | With locator |
| `\parencite[see][p.~5]{key}` | `[see @key, p. 5]` | Prefix + locator |
| `\textcite{key}` | `@key` | Narrative (in-text) |
| `\textcite{a,b}` | `@a and @b` | Multiple narrative |
| `\autocite{key}` | `[@key]` | Context-dependent; default to parenthetical |
| `\footcite{key}` | `^[[@key]]` | Footnote citation |
| `\citeauthor{key}` | `@key` | Flag: loses author-only semantics |
| `\citeyear{key}` | `[-@key]` | Year only |
| `\citetitle{key}` | Flag for review | No direct equivalent |
| `\citeurl{key}` | Flag for review | No direct equivalent |

---

## YAML Changes for Bibliography

Remove `\bibliography{}` from the document body (it goes to YAML).
Remove `\bibliographystyle{}` entirely.
Remove `\printbibliography` from the document body (Quarto renders it automatically).

Add to YAML front matter:

```yaml
bibliography: refs.bib
```

Quarto will render the bibliography at the end of the document automatically.
To control placement, add `# References` as a heading where you want it.
To use a specific citation style, add:

```yaml
csl: apa.csl
```

CSL files are available at https://www.zotero.org/styles

---

## cite-method Warning

If the original document's YAML has `cite-method: natbib` or `cite-method: biblatex`,
flag it in your report:

> **Manual review needed**: `cite-method: natbib` in YAML forces LaTeX-only citation
> rendering. Remove this line so Pandoc handles citations in all output formats.
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