Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Convert Markdown to publication-quality PDF with LaTeX math rendering
.claude/skills/brycewang-stanford-md-to-pdf-academic/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 130% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 131% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 119% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 372% | 0% |
Many researchers prefer writing in Markdown for its simplicity and readability, but academic publishing demands the typographic quality of LaTeX-rendered PDFs. The Markdown to PDF Academic skill bridges this gap by providing a complete workflow for converting Markdown documents—including mathematical equations, citations, cross-references, figures, and tables—into publication-quality PDFs using Pandoc and LaTeX as the rendering backend.
This approach gives you the best of both worlds: you write in clean, portable Markdown that is easy to version-control and collaborate on, while producing output that is indistinguishable from a paper written directly in LaTeX. The workflow supports all standard academic elements including numbered equations, BibTeX citations, figure floats, and custom LaTeX templates for specific journal or conference formats.
This skill is particularly useful for researchers who find LaTeX syntax cumbersome for drafting but need LaTeX-quality output, for teams where some members are not comfortable with LaTeX, and for documents that need to be published in multiple formats (PDF, HTML, DOCX) from a single source.
Install the following tools:
bash# macOS brew install pandoc brew install --cask mactex # Full LaTeX distribution # or for a minimal install: brew install basictex sudo tlmgr install collection-fontsrecommended latexmk # Ubuntu/Debian sudo apt-get install pandoc texlive-full # Verify installation pandoc --version pdflatex --version
Install useful Pandoc filters for academic writing:
bash# Citation processing pip install pandoc-citeproc # or use --citeproc flag (built-in since Pandoc 2.11) # Cross-referencing (figures, tables, equations, sections) pip install pandoc-crossref # Include code from external files pip install pandoc-include
Download or create a LaTeX template for your target venue. The Eisvogel template is an excellent general-purpose starting point:
bash# Download Eisvogel template mkdir -p ~/.pandoc/templates wget https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest/download/Eisvogel.tar.gz tar -xzf Eisvogel.tar.gz -C ~/.pandoc/templates/
Start your Markdown document with YAML metadata:
yaml--- title: "Your Paper Title" author: - name: "Author One" affiliation: "University of Example" email: "author@example.edu" - name: "Author Two" affiliation: "Institute of Research" date: "March 2026" abstract: | This is the abstract of the paper. It can span multiple lines using the YAML block scalar syntax. keywords: ["keyword one", "keyword two", "keyword three"] bibliography: references.bib csl: ieee.csl numbersections: true header-includes: - \usepackage{amsmath} - \usepackage{booktabs} ---
Use standard LaTeX math syntax within Markdown. Pandoc processes these natively:
markdownInline math: The loss function $\mathcal{L}(\theta)$ is minimized. Display math (numbered): $$ \mathcal{L}(\theta) = -\sum_{i=1}^{N} \log p(y_i | x_i; \theta) {#eq:loss} $$ Multi-line equations: $$ \begin{aligned} \nabla_\theta \mathcal{L} &= \frac{1}{N} \sum_{i=1}^{N} \nabla_\theta \log p(y_i | x_i; \theta) \\ \theta_{t+1} &= \theta_t - \eta \nabla_\theta \mathcal{L} \end{aligned} $$ Reference: As shown in @eq:loss (requires pandoc-crossref).
Reference entries in your BibTeX file using @citekey syntax:
markdownRecent work has shown promising results [@smith2024; @jones2025]. @smith2024 demonstrated that transformers scale efficiently. For a comprehensive review, see [-@wang2023].
markdown{#fig:arch width=80%} As shown in Figure @fig:arch, the architecture consists of... | Method | Accuracy | F1 Score | Params (M) | |--------|----------|----------|------------| | Baseline | 82.3 | 79.1 | 110 | | **Ours** | **87.6** | **84.9** | 95 | : Comparison of methods on the benchmark dataset. {#tbl:results} Results in Table @tbl:results show that...
bashpandoc paper.md \ -o paper.pdf \ --pdf-engine=pdflatex \ --citeproc \ --filter pandoc-crossref \ --number-sections \ --bibliography=references.bib \ --csl=ieee.csl \ --template=eisvogel
Create a Makefile for consistent builds:
makefilePAPER = paper PANDOC_FLAGS = --pdf-engine=pdflatex \ --citeproc \ --filter pandoc-crossref \ --number-sections \ --bibliography=references.bib pdf: $(PAPER).md pandoc $(PAPER).md -o $(PAPER).pdf $(PANDOC_FLAGS) --template=eisvogel docx: $(PAPER).md pandoc $(PAPER).md -o $(PAPER).docx $(PANDOC_FLAGS) html: $(PAPER).md pandoc $(PAPER).md -o $(PAPER).html $(PANDOC_FLAGS) --standalone --mathjax clean: rm -f $(PAPER).pdf $(PAPER).docx $(PAPER).html .PHONY: pdf docx html clean
For specific journal formats, create a custom Pandoc template. Start from the default and modify:
bash# Export default template pandoc -D latex > my-template.tex # Edit my-template.tex to match your journal's requirements # Then use it: pandoc paper.md -o paper.pdf --template=my-template.tex
Key template variables you can set from YAML front matter:
documentclass: article, report, book, or a journal's custom classfontsize: 10pt, 11pt, 12ptgeometry: margins (e.g., margin=1in)linestretch: line spacing (1.0 = single, 1.5 = one-and-a-half, 2.0 = double)tlmgr install <package-name>--pdf-engine=xelatex or lualatex instead of pdflatex.bib filepandoc-crossref; use {#eq:label} syntax after display equations\usepackage{adjustbox} in header-includes and use \adjustbox{max width=\textwidth} in the template| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 13,379 | 9,860 | -26% | 1 | 1 | 0% | 2,119 | 3,672 | +73% | 0 | 0 | — |
case-02 | fail→pass | 8,030 | 3,965 | -51% | 1 | 1 | 0% | 1,639 | 2,719 | +66% | 0 | 0 | — |
case-03 | fail→fail | 7,913 | 9,275 | +17% | 1 | 1 | 0% | 1,526 | 2,912 | +91% | 0 | 0 | — |
case-04 | pass→pass | 6,509 | 4,584 | -30% | 1 | 1 | 0% | 1,204 | 2,773 | +130% | 0 | 0 | — |
case-05 | pass→pass | 7,968 | 5,019 | -37% | 1 | 1 | 0% | 1,243 | 2,866 | +131% | 0 | 0 | — |
case-06 | pass→pass | 8,424 | 4,511 | -46% | 1 | 1 | 0% | 1,218 | 2,662 | +119% | 0 | 0 | — |
case-07 | pass→pass | 2,616 | 2,640 | +1% | 1 | 1 | 0% | 489 | 2,306 | +372% | 0 | 0 | — |
case-08 | pass→pass | 15,324 | 17,666 | +15% | 1 | 1 | 0% | 2,548 | 4,403 | +73% | 0 | 0 | — |
case-09 | pass→pass | 6,318 | 3,647 | -42% | 1 | 1 | 0% | 1,186 | 2,529 | +113% | 0 | 0 | — |
case-10 | pass→pass | 4,790 | 3,835 | -20% | 1 | 1 | 0% | 925 | 2,609 | +182% | 0 | 0 | — |
case-11 | pass→pass | 9,868 | 11,379 | +15% | 1 | 1 | 0% | 1,813 | 3,476 | +92% | 0 | 0 | — |
case-12 | pass→pass | 4,280 | 3,079 | -28% | 1 | 1 | 0% | 747 | 2,450 | +228% | 0 | 0 | — |
case-13 | pass→pass | 8,297 | 5,984 | -28% | 1 | 1 | 0% | 1,516 | 2,927 | +93% | 0 | 0 | — |
case-14 | pass→pass | 4,912 | 2,858 | -42% | 1 | 1 | 0% | 904 | 2,374 | +163% | 0 | 0 | — |
case-15 | pass→pass | 6,702 | 5,025 | -25% | 1 | 1 | 0% | 1,238 | 2,660 | +115% | 0 | 0 | — |
case-16 | pass→pass | 6,172 | 4,684 | -24% | 1 | 1 | 0% | 1,128 | 2,678 | +137% | 0 | 0 | — |
case-17 | pass→pass | 10,260 | 6,957 | -32% | 1 | 1 | 0% | 1,580 | 3,142 | +99% | 0 | 0 | — |
case-18 | pass→pass | 7,543 | 3,162 | -58% | 1 | 1 | 0% | 1,297 | 2,378 | +83% | 0 | 0 | — |
case-19 | pass→pass | 8,814 | 3,479 | -61% | 1 | 1 | 0% | 1,574 | 2,360 | +50% | 0 | 0 | — |
case-20 | pass→pass | 6,032 | 4,173 | -31% | 1 | 1 | 0% | 915 | 2,698 | +195% | 0 | 0 | — |
case-21 | fail→fail | 5,888 | 12,986 | +121% | 1 | 1 | 0% | 1,102 | 4,365 | +296% | 0 | 0 | — |
case-22 | pass→pass | 17,229 | 14,492 | -16% | 1 | 1 | 0% | 2,853 | 4,458 | +56% | 0 | 0 | — |
case-23 | pass→pass | 12,541 | 14,860 | +18% | 1 | 1 | 0% | 2,071 | 4,115 | +99% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.