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/03-text-formatting.md

View on GitHub
# Text Formatting

---

## Basic Inline Formatting

Handle nesting: process inner commands before outer wrappers.
`\textbf{\emph{text}}` → `***text***`

| LaTeX | Quarto |
|-------|--------|
| `\textbf{text}` | `**text**` |
| `\textit{text}` | `*text*` |
| `\emph{text}` | `*text*` |
| `\texttt{text}` | `` `text` `` |
| `\textrm{text}` | `text` (remove wrapper — markdown default is roman) |
| `\textsl{text}` | `*text*` (slanted ≈ italic) |
| `\underline{text}` | `[text]{.underline}` |
| `\textsc{text}` | `[text]{.smallcaps}` |
| `\textsuperscript{x}` | `^x^` |
| `\textsubscript{x}` | `~x~` |
| `\sout{text}` (ulem) | `~~text~~` |
| `\textbf{\emph{text}}` | `***text***` |
| `\emph{\textbf{text}}` | `***text***` |

### Old LaTeX2e Font Commands

| LaTeX | Quarto |
|-------|--------|
| `{\bf text}` | `**text**` |
| `{\it text}` | `*text*` |
| `{\tt text}` | `` `text` `` |
| `{\em text}` | `*text*` |
| `{\sc text}` | `[text]{.smallcaps}` |
| `{\rm text}` | `text` (remove) |

---

## Footnotes

| LaTeX | Quarto |
|-------|--------|
| `\footnote{text}` | `^[text]` |
| `\footnote{See \cite{key} for details.}` | `^[See [@key] for details.]` |
| `\footnote{Values are \textbf{not} adjusted.}` | `^[Values are **not** adjusted.]` |
| `\footnotemark` + `\footnotetext{text}` | Flag for manual review — convert if the pairing is unambiguous |

Footnotes may contain inline formatting and citations; apply those rules inside the `^[...]`.

---

## Hyperlinks and URLs

| LaTeX | Quarto |
|-------|--------|
| `\url{https://example.com}` | `<https://example.com>` |
| `\href{https://example.com}{link text}` | `[link text](https://example.com)` |
| `\href{mailto:foo@bar.com}{email}` | `[email](mailto:foo@bar.com)` |
| `\href{#sec-intro}{see Section}` | `[see Section](#sec-intro)` (internal link) |

---

## Font Size Commands (Remove)

Font size commands adjust visual presentation but carry no semantic meaning in prose.
Remove the size wrapper and keep the text content.

| LaTeX | Action |
|-------|--------|
| `{\tiny text}` | `text` |
| `{\scriptsize text}` | `text` |
| `{\footnotesize text}` | `text` |
| `{\small text}` | `text` |
| `{\normalsize text}` | `text` |
| `{\large text}` | `text` |
| `{\Large text}` | `text` |
| `{\LARGE text}` | `text` |
| `{\huge text}` | `text` (flag if used for a section title effect) |
| `{\Huge text}` | `text` |

---

## Color (Flag for Review)

`\textcolor{red}{text}` → `[text]{style="color:red"}` (HTML only).
Flag in report: this will not render color in PDF without additional configuration.

Common colors: `red`, `blue`, `green`, `gray`, `orange`.

---

## Quoted Text

| LaTeX | Quarto |
|-------|--------|
| `` `word' `` (single LaTeX quotes) | `'word'` |
| ` ``word'' ` (double LaTeX quotes) | `"word"` |
| `\enquote{text}` (csquotes) | `"text"` |
| `\textquoteleft` / `\textquoteright` | `'` / `'` |
| `\textquotedblleft` / `\textquotedblright` | `"` / `"` |

---

## Spacing and Line Breaks in Prose

| LaTeX | Quarto |
|-------|--------|
| `~` (non-breaking space, e.g., `Figure~\ref{}`) | ` ` or `&nbsp;` depending on context; typically just a regular space after cross-ref conversion |
| `\,` (thin space in prose) | Remove (not meaningful in markdown) |
| `\ ` (forced space after command) | ` ` (regular space) |
| `\\` or `\newline` (line break in prose) | Two trailing spaces or a blank line (paragraph break) |
| `\noindent` | Remove |
| `\par` | Blank line |

---

## Emphasis Nesting Note

When `\emph{}` appears inside already-italic text, LaTeX toggles back to upright.
In Quarto markdown, `*...*` within `*...*` does not toggle — it creates broken markup.
Flag these cases for manual review.

Example: `\emph{This is \emph{important} here}` → `*This is* important *here*`
(the inner word reverts to upright in LaTeX; replicate manually).
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