Logo di Quarto Clean

Quarto Clean

Community
christopherkenny
quarto-clean

Cleans a Quarto (.qmd) file by replacing LaTeX holdovers with proper Quarto/Pandoc syntax so the document renders correctly to HTML, PDF (Typst/LaTeX), and Word. Fixes citations (\citep → [@key]), cross-references (\ref → @label), figures (\includegraphics → markdown), tables, text formatting (\textbf → **bold**), inline math (\( \) → $ $), hyperlinks (\href → [text](url)), footnotes (\footnote → ^[]), list environments, section headings, and R Markdown chunk options (dot-style → #| YAML). Use when asked to clean, fix, modernize, or port a Quarto or R Markdown document; when LaTeX commands appear in a .qmd file; when a document fails to render to Word or Typst; or when citations/cross-references do not appear in non-LaTeX output.

Panoramica

Autorechristopherkenny
Repositoryskills
Nome della skillquarto-clean
Stelle
27
Fork
3
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da christopherkenny su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Quarto Clean in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/christopherkenny/skills/tree/main/skills/quarto-clean
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/christopherkenny/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/quarto-clean .claude/skills/quarto-clean
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Quarto Clean in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Quarto Clean non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Quarto Clean non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Quarto Clean

You clean a Quarto (.qmd) document by replacing LaTeX holdovers with correct Quarto/Pandoc syntax. Many authors migrate manuscripts from LaTeX or R Markdown and leave behind patterns (e.g., \citep{}, \ref{}, \textbf{}) that silently fail when rendering to Word or Typst PDF. This skill finds and fixes them all in a single pass.

This skill modifies the source file in place (or writes to a second path if supplied). Before writing, tell the user what file will be changed and remind them that git diff or file history can recover the original.


Input Arguments

PositionRequiredDescription
1YesPath to the .qmd file to clean (e.g., paper/paper.qmd). Cleaned in place by default.
2NoOutput path. If supplied, writes the cleaned file there instead of overwriting the input.

Example invocations:

/quarto-clean paper/paper.qmd
/quarto-clean paper/paper.qmd drafts/paper-clean.qmd

Step-by-Step Workflow

1. Parse Arguments

Identify the input .qmd path (arg 1) and output path (arg 2, or same as arg 1 if omitted).

2. Read the File

Use the Read tool to load the entire file. Hold the full content in memory — you will rewrite it in one shot with the Write tool at the end.

3. Apply All Transformations

Work through the full content and apply every applicable transformation from the reference tables below. Key principles:

  • Preserve protected regions: Never modify content inside fenced code blocks (``` or ~~~), inline code (` ), display math ($$...$$), inline math ($...$), or YAML front matter (--- to ---). Treat these regions as opaque.
  • Handle nesting correctly: Because you understand the full document structure, handle nested commands naturally. \textbf{something \cite{key}} → **something [@key]**. \footnote{See \cite{key} for details} → ^[See [@key] for details].
  • Apply all categories: Work through every category in the reference below. A single command (\textbf{\emph{text}}) may require multiple rules (***text***).
  • Be complete: Scan the entire file. Do not stop after the first occurrence of a pattern — fix every instance.

4. Write the Cleaned File

Use the Write tool to overwrite the output path with the fully cleaned content. Do not use Edit for individual substitutions — rewrite the whole file so nothing is missed.

5. Report to the User

Tell the user:

  • Output path written
  • Summary of fixes by category (how many of each type were converted)
  • Items requiring manual review — any patterns you could not safely convert automatically (list with approximate line numbers so the user can find them)
  • Reminder to run quarto render to verify

Transformation Reference

Apply every applicable rule. Rules are ordered so that inner/simpler commands are converted before outer/wrapper commands, which handles nesting correctly.

Citations

Convert all natbib/biblatex citation commands to Pandoc bracket syntax. These must work in all output formats (HTML, Word, Typst PDF).

LaTeXQuartoNotes
\cite{key}[@key]
\citep{key}[@key]
\citep{a,b}[@a; @b]Split comma-separated keys
\citep[p.~5]{key}[@key, p. 5]Locator (suffix only)
\citep[see][p.~5]{key}[see @key, p. 5]Prefix + locator
\citet{key}@keyNarrative / in-text citation
\citet{a,b}@a and @bMultiple narrative keys
\citealt{key}@keyNo parentheses
\citeauthor{key}@keyLoses "author-only" semantics; flag in report
\citeyear{key}[-@key]Year only; suppresses author
\nocite{key}Move to YAML nocite: '@key'Remove from body; add to front matter
\nocite{*}Move to YAML nocite: '@*'

Cross-References

Convert \label and \ref commands. The label prefix maps directly:

LaTeX prefixQuarto prefixExample LaTeXExample Quarto
fig:fig-\label{fig:map} → {#fig-map}\ref{fig:map} → @fig-map
tab: or table:tbl-\label{tab:results}@tbl-results
sec: or section:sec-\label{sec:intro}@sec-intro
eq: or eqn:eq-\label{eq:ols}@eq-ols
lst:lst-
thm:, lem:, prop:, etc.same with -

Rules:

  • \ref{type:name} → @type-name (replace : with -, map prefix per table)
  • \autoref{type:name} → @type-name
  • \eqref{eq:name} → @eq-name
  • Drop redundant type words: Figure \ref{fig:x} → @fig-x (Quarto auto-generates "Figure N"). Same for "Table", "Section", "Equation", "Appendix".
  • \label{type:name} must be moved to the appropriate Quarto element as {#type-name}:
    • On a figure: ![Caption](file){#fig-name}
    • On a table caption: : Caption {#tbl-name}
    • On a heading: ## Title {#sec-name}
    • On display math: $$...$$ {#eq-name} (on the line after $$)
  • Replace underscores with hyphens in the name part: fig:my_fig → {#fig-my-fig}

R Markdown Chunk Options

Convert old-style inline chunk options to #| YAML comments. The fence header becomes bare (language only), and each option becomes a #| line inside the chunk.

Before:

```{r my-label, echo=FALSE, fig.cap="My figure", fig.width=6, out.width="80%"}

After:

```{r}
#| label: my-label
#| echo: false
#| fig-cap: "My figure"
#| fig-width: 6
#| out-width: "80%"

Option name mapping (dots → dashes, booleans → lowercase):

OldNew
fig.capfig-cap
fig.widthfig-width
fig.heightfig-height
fig.alignfig-align
fig.altfig-alt
fig.subcapfig-subcap
fig.posfig-pos
fig.envfig-env
out.widthout-width
out.heightout-height
echo=FALSEecho: false
eval=FALSEeval: false
warning=FALSEwarning: false
message=FALSEmessage: false
include=FALSEinclude: false
cache=TRUEcache: true
results='hide'output: false
results='asis'output: asis
tidy=TRUE(remove — deprecated)

The first unnamed token in the old header is the label: {r my-label, echo=FALSE} → #| label: my-label.

Figures

LaTeXQuarto
\includegraphics{file}![](file)
\includegraphics[width=0.8\textwidth]{file}![](file){width=80%}
\includegraphics[width=5cm]{file}![](file){width=5cm}
\centering inside figure envfig-align="center" attribute on the figure

Full figure environment:

latex
\begin{figure}[h]
  \centering
  \includegraphics[width=0.8\textwidth]{figs/map.pdf}
  \caption{A map of the study region.}
  \label{fig:map}
\end{figure}

Becomes:

markdown
![A map of the study region.](figs/map.pdf){#fig-map width=80% fig-align="center"}
  • \begin{figure*} → add fig-env="figure*" to the attribute block
  • For computational figures in code chunks, use #| fig-cap: and #| label: fig-...

Tables

Markdown / pipe tables:

markdown
| Col A | Col B |
|:------|------:|
| val   | 1.23  |

: My table caption. {#tbl-results}
  • Column alignment from tabular spec: l → :---, r → ---:, c → :---:
  • Caption goes below the table, after : , with {#tbl-label} at the end
  • For computational tables (knitr/kable output), add chunk options instead:
    #| label: tbl-results
    #| tbl-cap: "My table caption."

LaTeX table environment → Quarto pipe table:

latex
\begin{table}
  \caption{My table caption.}
  \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 |

: My table caption. {#tbl-results}

Text Formatting

Handle nesting: \textbf{\emph{text}} → ***text***.

LaTeXQuarto
\textbf{text}**text**
\textit{text}*text*
\emph{text}*text*
\texttt{text}`text`
\underline{text}[text]{.underline}
\textsc{text}[text]{.smallcaps}
\textsuperscript{x}^x^
\textsubscript{x}~x~
\sout{text}~~text~~
\footnote{text}^[text]

Math

LaTeXQuarto
\(x + y\)$x + y$
\[x + y\]$$x + y$$
\begin{equation} / \end{equation}$$ / $$ with {#eq-name} after closing $$
\begin{align} / \end{align}$$\begin{aligned} / \end{aligned}$$
\label{eq:name} inside mathRemove from math body; add {#eq-name} after closing $$

Hyperlinks

LaTeXQuarto
\url{https://...}<https://...>
\href{url}{text}[text](url)

Special Characters and Spacing

LaTeXQuartoNotes
\&&Outside math
\%%Outside math
\ldots or \dots...
\footnote{text}^[text](also in Text Formatting above)
\noindent(remove)
\parblank line
\newline or \\blank line or two trailing spacesParagraph break in prose
\newpage or \clearpage{{< pagebreak >}}
~ (tie space) or &nbsp;Context-dependent

Section Headings

LaTeXQuarto
\section{Title}# Title
\subsection{Title}## Title
\subsubsection{Title}### Title
\paragraph{Title}#### Title
\section*{Title}# Title {.unnumbered}
\section{Title}\label{sec:x}# Title {#sec-x}

If a \label{sec:x} appears on the line following a heading, merge it into the heading's attribute block: ## Methods {#sec-methods}.

List Environments

LaTeXQuarto
\begin{itemize} / \itemUnordered list with -
\begin{enumerate} / \itemOrdered list with 1.
\begin{description} / \item[Term]: Term\n: definition

Nested lists: indent continuation lines by two spaces per level.

Abstract and Front Matter

Move these from the document body to YAML:

latex
\begin{abstract}
  We study the effect of X on Y...
\end{abstract}

→ YAML field:

yaml
abstract: |
  We study the effect of X on Y...

Similarly for \title{}, \author{}, \date{} appearing in the body — move to YAML title:, author:, date: fields.


Patterns That Need Judgment

Flag these in your report if you encounter them, with a suggested fix but no automatic conversion (the content depends too much on context):

  • Custom LaTeX environments (\begin{theorem}, \begin{proof}, \begin{lemma}, \begin{frame}, etc.) → suggest converting to ::: {.callout-note} or a theorem div
  • \vspace{} / \hspace{} → no direct Quarto equivalent; suggest removing or using CSS
  • \multicolumn{}{}{} in tables → requires restructuring the table manually
  • \citeauthor{key} → converted to @key but the "author only" rendering is lost; suggest rephrasing (e.g., "Smith [-@smith2020]")
  • cite-method: natbib or cite-method: biblatex in YAML → should likely be removed for non-LaTeX output formats; flag for user decision
  • \\[6pt] or \\[1em] (spacing in math display) → the spacing argument is not valid in Quarto; convert to \\ and note the spacing is lost

What to Preserve Unchanged

  • All content inside ```...``` fenced code blocks (including chunk body code)
  • All content inside `...` inline code
  • All content inside $...$ inline math and $$...$$ display math (except \label{} which must be moved outside, and \( \) / \[ \] delimiters which must be converted)
  • YAML front matter between --- delimiters
  • Quarto shortcodes {{< ... >}}
  • Existing @ref cross-references and [@citation] citations that are already correct
  • Pandoc div/span syntax ::: and []{} that is already valid Quarto

Domande frequenti

Cosa fa la skill IA Quarto Clean?

Cleans a Quarto (.qmd) file by replacing LaTeX holdovers with proper Quarto/Pandoc syntax so the document renders correctly to HTML, PDF (Typst/LaTeX), and Word. Fixes citations (\citep → [@key]), cross-references (\ref → @label), figures (\includegraphics → markdown), tables, text formatting (\textbf → **bold**), inline math (\( \) → $ $), hyperlinks (\href → [text](url)), footnotes (\footnote → ^[]), list environments, section headings, and R Markdown chunk options (dot-style → #| YAML). Use when asked to clean, fix, modernize, or port a Quarto or R Markdown document; when LaTeX commands...

Perché usare Quarto Clean su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Quarto Clean è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Quarto Clean in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/christopherkenny/skills/tree/main/skills/quarto-clean. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Quarto Clean?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Quarto Clean?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Quarto Clean: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Quarto Clean è gratuita?

Sì. È pubblicata su GitHub da christopherkenny con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇