本文へ移動
cccskills
無料GitHub で公開

latex-to-quarto

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.

インストール方法を見る

含まれるファイル(11)

  • SKILL.md8.9 KB
  • references/01-preamble-yaml.md6.0 KB
  • references/02-document-structure.md4.3 KB
  • references/03-text-formatting.md3.7 KB
  • references/04-math.md4.0 KB
  • references/05-citations.md3.4 KB
  • references/06-cross-references.md3.4 KB
  • references/07-figures.md3.8 KB
  • references/08-tables.md3.9 KB
  • references/09-sections-lists.md3.6 KB
  • references/10-misc.md5.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

LaTeX to Quarto Conversion

Convert a full LaTeX .tex article to a Quarto .qmd document that renders correctly to HTML, PDF (Typst or LaTeX), and Word. This skill handles the entire conversion pipeline: preamble extraction, document structure, and all inline/block transformations.

This skill writes the output file (overwriting the input or writing to a second path). 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 input .tex file (e.g., paper/paper.tex)
2NoOutput .qmd path. Defaults to same directory, .qmd extension.

Example invocations:

/latex-to-quarto paper/paper.tex
/latex-to-quarto paper/paper.tex paper/paper.qmd

Quick Navigation: Use Which Reference

TaskReference File
\documentclass, \usepackage, \title, \author → YAML01-preamble-yaml.md
\begin{document}, \maketitle, \begin{abstract}, \appendix02-document-structure.md
\textbf, \emph, \texttt, \footnote, \href03-text-formatting.md
equation, align, gather, inline math delimiters04-math.md
\cite, \citep, \citet, natbib/biblatex commands05-citations.md
\label, \ref, \autoref, \eqref, prefix mapping06-cross-references.md
\includegraphics, figure environment, subfigures07-figures.md
tabular, table, booktabs, \multicolumn08-tables.md
\section, \subsection, itemize, enumerate09-sections-lists.md
Special characters, \newpage, verbatim, \input10-misc.md

Step-by-Step Workflow

1. Parse Arguments

Identify the input .tex path (arg 1) and output path (arg 2). If arg 2 is omitted, replace the .tex extension with .qmd in the same directory.

2. Read the File

Use the Read tool to load the full .tex file. Hold the entire content in memory — you will produce one complete .qmd file at the end.

3. Extract and Convert the Preamble

Everything before \begin{document} is the preamble. Extract:

  • \documentclass options → YAML format: settings
  • \title{}, \author{}, \date{} → YAML title:, author:, date:
  • \bibliography{file} / \addbibresource{file} → YAML bibliography:
  • Package hints (geometry, setspace, natbib, biblatex) → YAML format options

See 01-preamble-yaml.md for the full mapping table.

4. Strip Document Wrapper

Remove \begin{document} and \end{document}. Remove \maketitle (title is rendered from YAML automatically). Convert \begin{abstract}...\end{abstract} to YAML abstract:. See 02-document-structure.md.

5. Apply All Body Transformations

Work through the full document body and apply every applicable rule. Key principles:

  • Preserve math regions: Never alter content inside $...$ or $$...$$ except to move \label{} outside display math and convert delimiters (\(...\) → $...$).
  • Handle nesting: \textbf{\emph{text}} → ***text***. Process inner commands first.
  • Be complete: Scan the entire file. Fix every instance of each pattern, not just the first.
  • Apply all categories: Work through every reference file. A single paragraph may require rules from multiple categories.

Apply reference files in this order (structural → inline):

  1. 09-sections-lists.md — headings and lists
  2. 05-citations.md — citations
  3. 06-cross-references.md — labels and references
  4. 07-figures.md — figures
  5. 08-tables.md — tables
  6. 04-math.md — math environments and delimiters
  7. 03-text-formatting.md — inline formatting
  8. 10-misc.md — special characters and remaining patterns

6. Assemble the QMD File

Combine:

  1. YAML front matter (between --- delimiters)
  2. Converted document body (blank line after closing ---)

7. Write the Output File

Use the Write tool to write the complete .qmd file in one pass. Do not use Edit for individual substitutions — a single full write ensures nothing is missed.

8. Report to the User

Tell the user:

  • Output path written
  • Summary of conversions by category (citation count, figure count, table count, etc.)
  • Items requiring manual review with approximate line numbers
  • Reminder to run quarto render to verify the output

Key Conceptual Differences: LaTeX vs. Quarto

Preamble → YAML Front Matter

LaTeX uses a \documentclass preamble; Quarto uses YAML front matter between ---.

% LaTeX preamble
\documentclass[12pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\title{My Paper}
\author{Jane Doe}
\date{\today}
\bibliography{refs}
# Quarto YAML front matter
---
title: "My Paper"
author: "Jane Doe"
date: today
bibliography: refs.bib
format:
  html: default
  pdf:
    documentclass: article
    papersize: a4
    fontsize: 12pt
    geometry: margin=1in
---

Math Content Is Preserved as LaTeX

Unlike conversion to Typst, Quarto uses LaTeX math directly. Inline \(...\) → $...$; display \[...\] → $$...$$. Math content (operators, symbols, matrices) stays unchanged.

Citations Use Pandoc Bracket Syntax

\citep{key} → [@key]; \citet{key} → @key. The .bib file is referenced in YAML and left unchanged.

Cross-References Use @label Not \ref{}

\ref{fig:map} → @fig-map. Labels move from standalone \label{} commands into element attribute blocks {#fig-map}.


Minimal Conversion Example

Input (paper.tex):

\documentclass[12pt]{article}
\usepackage{natbib}
\title{My Study}
\author{Jane Doe}
\date{2025}
\begin{document}
\maketitle
\begin{abstract}
We examine the effect of X on Y.
\end{abstract}
\section{Introduction}
Prior work \citep{smith2020} shows that $x > 0$.
See Figure~\ref{fig:map} for an overview.
\begin{figure}[h]
  \centering
  \includegraphics[width=0.8\textwidth]{figs/map.pdf}
  \caption{Study region.}
  \label{fig:map}
\end{figure}
\bibliography{refs}
\end{document}

Output (paper.qmd):

---
title: "My Study"
author: "Jane Doe"
date: 2025
bibliography: refs.bib
---

## Abstract

We examine the effect of X on Y.

# Introduction

Prior work [@smith2020] shows that $x > 0$.
See @fig-map for an overview.

![Study region.](figs/map.pdf){#fig-map width=80% fig-align="center"}

Patterns Requiring Manual Review

Flag these in your report with a suggested fix but no automatic conversion:

PatternSuggested Quarto Equivalent
\begin{theorem}, \begin{proof}, \begin{lemma}::: {.callout-note} div, or install a theorem extension
\newcommand{}{} / \renewcommand{}{}Inline the macro expansion throughout; flag remaining uses
\input{file} / \include{file}Inline contents or use {{< include file.qmd >}} shortcode
\vspace{} / \hspace{}Remove or replace with CSS; no direct Quarto equivalent
\multicolumn{}{}{} in tablesRequires manual table restructuring
TikZ / PGF diagramsRemove or replace with Mermaid/Observable JS
Beamer \begin{frame}Switch to format: revealjs with ## slide headings
\bibliographystyle{}Remove; use csl: in YAML if a specific citation style is needed
Multiple \label in one align blockEach labeled row may need its own equation block

What to Preserve Unchanged

  • LaTeX math content inside $...$ and $$...$$
  • File paths in \includegraphics and \bibliography (adjust extension if needed)
  • Existing @ref and [@citation] patterns already in correct Quarto form
  • Content inside \begin{verbatim}...\end{verbatim} (convert to fenced block, keep content)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

a1

無料

VS-Enhanced Research Question Refiner - Prevents Mode Collapse and derives differentiated research questions Enhanced VS 3-Phase process: Modal question avoidance, alternatives presentation, differentiated RQ recommendation Use when: refining research ideas, formulating research questions, clarifying scope Triggers: research question, 연구 질문, PICO, SPIDER, research idea

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

a2

無料

VS-Enhanced Theoretical Framework Architect with Critique & Visualization Full VS 5-Phase process: Modal theory avoidance, Long-tail exploration, differentiated framework presentation Absorbed A3 (Devil's Advocate) critique and A6 (Conceptual Framework Visualizer) capabilities Use when: building theoretical foundations, designing conceptual models, deriving hypotheses, critiquing frameworks, visualizing models Triggers: theoretical framework, 이론적 프레임워크, conceptual model, 개념적 모형, hypothesis derivation, critique, devil's advocate, 반론, visualization, diagram

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

a5

無料

Agent A5 - Paradigm & Worldview Advisor - Philosophical foundations for research design. Covers ontology, epistemology, axiology, and methodology alignment. Use when: establishing philosophical foundations, justifying methodological choices, writing positionality statements Triggers: paradigm, 패러다임, ontology, epistemology, worldview, 세계관, philosophical foundations, 철학적 기초

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

Academic paper writing skill with 12-agent pipeline. v2.5: Style Calibration (learn author's writing voice from past papers) + Writing Quality Check (writing quality checklist for natural prose). Supports IMRaD, literature review, theoretical, case study, policy brief, and conference paper structures. APA 7.0 (default), Chicago, MLA, IEEE, Vancouver citation formats. Bilingual abstracts (zh-TW + EN). Multi-format output (LaTeX, DOCX, PDF, Markdown). Triggers on: write paper, academic paper, paper outline, write abstract, revise paper, check citations, convert to LaTeX, guide my paper, parse reviews, revision roadmap, 寫論文, 學術論文, 論文大綱, 寫摘要, 修改論文, 檢查引用, 引導我寫論文, 帶我規劃論文, 逐章規劃, 論文架構, 審查意見, 修訂路線圖.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready manuscript. Use when users want to: (1) write a paper from a detailed outline, (2) ensure quality control during writing, (3) maintain consistency across chapters, (4) prepare a submission-ready manuscript, or (5) systematically execute a planned paper. Triggered by phrases like 'write the paper from this outline,' 'compose the full manuscript,' 'execute the outline,' or when users have completed strategic planning (academic-paper-strategist skill) and are ready to write. Takes optimized outline as input; outputs complete manuscript with iterative quality checks.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

Multi-perspective academic paper review with dynamic reviewer personas. Simulates 5 independent reviewers (EIC + 3 peer reviewers + Devil's Advocate) with field-specific expertise. Supports full review, re-review (verification), quick assessment, methodology focus, and Socratic guided modes. Triggers on: review paper, peer review, manuscript review, referee report, review my paper, critique paper, simulate review, editorial review.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6032026年10月12日 更新

brycewang-stanford のスキルをすべて見る

このスキルの問題を報告する