/documents:polished-docs-and-decksfrom Documents
Builds polished PowerPoint slide decks via python-pptx and matplotlib, and typeset PDFs from Markdown via pandoc + xelatex. Verifies output by rendering to images with headless LibreOffice.
Ships in Documents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create either output type, then use the same verification step.
Assets live next to this file in ${CLAUDE_SKILL_DIR}/assets/:
pdf_header.tex: the xelatex preamble for the Markdown→PDF pipeline.pptx_helpers.py: python-pptx palette + slide helpers + the overlap pre-check.figures.py: matplotlib patterns for equations (mathtext) and node/arrow diagrams.Copy the assets into a working folder and work there, because the plugin's own folder is replaced on each update:
mkdir -p /tmp/<job> && cp "${CLAUDE_SKILL_DIR}"/assets/* /tmp/<job>/
import pptx_helpers needs the file on sys.path, so run your build script from that folder.
figures.py writes its images to fig/ in the folder it is run from.
Requirements: Python 3 with python-pptx and matplotlib (Pipeline B); pandoc and a XeLaTeX
distribution (Pipeline A); LibreOffice and pdftoppm from poppler (Pipeline C). A full MacTeX
or TeX Live install has every package pdf_header.tex loads. BasicTeX lacks some of them; add
them with sudo tlmgr install sectsty mdframed enumitem newunicodechar zref needspace soul.
Not this skill (hand off): an animated HTML slide deck opened in a browser → an HTML slides skill, if you have one; a self-contained / interactive HTML document or dashboard → single-html-document. Reading or editing an existing .pptx/.docx as raw OOXML (extract text, tweak one file) → a pptx / docx skill, if you have them. Manipulating an existing PDF (merge/split/forms) → a pdf skill, if you have one. Use this skill to author and render new themed decks or typeset PDFs.
The one non-obvious thing: do NOT run pandoc file.md -o out.pdf or pandoc -s … -o out.tex.
Pandoc's standalone xelatex template loads fontspec, which silently breaks newunicodechar
maps; your ∑ ∫ 𝓘 etc. then error with Missing $ inserted. Instead emit a body
fragment and wrap it in our own preamble:
# 1. clean the markdown: move the H1 title to YAML metadata or set it via \title in main.tex.
# 2. body fragment only (NO -s, NO template). If step 1 took the title from an H1 and the
# sections are ## headings, promote them one level, or they number 0.1, 0.2:
pandoc cleaned.md --shift-heading-level-by=-1 -t latex -o body.tex
# (sections already # headings: leave out --shift-heading-level-by)
# 3. build main.tex around it:
cat > main.tex <<'EOF'
\documentclass[11pt]{article}
\input{pdf_header.tex}
\title{\textbf{My Title}\\[0.3em]\large My subtitle}
\author{Author}\date{June 2026}
\begin{document}\maketitle\tableofcontents\clearpage
\input{body.tex}
\end{document}
EOF
# 4. compile twice (TOC needs two passes):
xelatex -interaction=nonstopmode main.tex >/dev/null && xelatex -interaction=nonstopmode main.tex
grep -cE '^! ' main.log # error lines: expect 0
grep 'Missing character' main.log # a glyph the font or header cannot draw: expect no output
pdf_header.tex already handles the things that otherwise fail:
\newunicodechar (Greek letters, ∂ ∇ ∑ ∏ ∫ ≤ ≥ ≠ ≈ ± × ∞ →, ⟨⟩ 𝓘, sub/superscripts …).
If a new glyph appears in a document, add one \newunicodechar{X}{\ensuremath{...}} line.
Find all non-ASCII characters with: python3 -c "import sys;[print(hex(ord(c)),c) for c in set(open('f.md').read()) if ord(c)>127]".amsmath: pandoc passes real math ($…$, \[ \]) through verbatim, so \text{} and
\operatorname{} need amsmath or you get Undefined control sequence.calc + \providecommand{\real}[1]{#1}: pandoc width-tables emit
p{(\linewidth-…)*\real{0.33}}; without these you get Missing number / Illegal unit / \real undefined.graphicx with pandoc's \pandocbounded (large images are
scaled to the page), soul for ~~strikethrough~~, and pandoc's syntax-highlighting
definitions, so fenced code keeps its colours.>) are restyled as shaded callout boxes; headings are coloured (sectsty).
So: put displayed formulas / key statements in > blockquotes to box them.Render the result to confirm (it's a PDF, so just Read its pages as images).
Author a build script that imports pptx_helpers (import pptx_helpers as D) and lays out
slides; render the figures with figures.py first. See the docstrings in both assets for the
full API. The shape of a good deck:
D.title_slide), section D.dividers, content slides
(D.header + D.body + D.pic), a summary, a closing.D.notes(s, "[~2 min · ~16:30] …").
The notes are what turn slides into a talk and let it actually hit a target length.figures.py (matplotlib mathtext for
formulas; boxes/arrows for diagrams). Do NOT type ∑ ∫ 𝓘 or fancy subscripts (𝓘ₘₐₓ,
dᵥ) into slide text; Calibri lacks them and they render as tofu. Use plain words
("mutual information", "d_V") in text, and the rendered symbol in the figure.D.add_footers(label="…") then D.save(path) at the end.Overlap pre-check (do this; it is the #1 silent bug). python-pptx text boxes don't clip,
and a figure placed by width= takes a height set by the image's TRUE (tight-cropped) aspect,
which is rarely what you guessed from figsize. So a figure routinely overruns the bullets
below it. After placing, verify with the helper:
assert D.overlaps_ok("fig/loop.png", top_in=1.55, width_in=8.4, next_text_top_in=5.3)
Use PNG files for figures. overlaps_ok reads their sizes from the PNG header.
Fix by shrinking width_in, lowering the figure, or pushing the text t= down, then re-check.
Then always render and eyeball (Pipeline C) before delivering; the math gets you close, the
render confirms it.
This is the only way to truly see a generated Office file. Always do it before delivering a deck, and use it whenever the user asks to preview/proof/check one.
SOFFICE="$(command -v soffice || echo "$HOME/Applications/LibreOffice.app/Contents/MacOS/soffice")"
"$SOFFICE" --headless --convert-to pdf --outdir /tmp/render "/path/to/Deck.pptx"
# then Read /tmp/render/Deck.pdf pages as images (the Read tool renders PDF pages)
LibreOffice can lag if an instance is open; add -env:UserInstallation=file:///tmp/lo_profile
if a convert hangs. For per-slide PNGs, convert to PDF then rasterise (pdftoppm -png), or read
PDF pages directly. Reading the pages catches font substitution, text overflow, and odd figure
placement that layout math cannot.
One-time install (no admin password):
brew install --cask --appdir="$HOME/Applications" libreoffice
-s/PDF path + fontspec breaks newunicodechar → body-fragment + own preamble.\real.overlaps_ok().What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/course-to-pdfBind a static HTML course or documentation site into one textbook-typeset PDF, retypesetting the screen CSS for print. Use whenever someone wants a course, handbook, lesson notes, or docs site as a single printable PDF or book, or asks why an HTML-to-PDF export came out enormous. Triggers include: 'turn the course into a PDF', 'make a single PDF of the lessons', 'can I get this as a book', 'print the whole site', 'the PDF is 300 pages', 'export the docs as PDF'./explainer-videoMake a short narrated explainer video (3Blue1Brown style) on the user's Mac: Manim animates, the tts command (Kokoro, local) narrates, and two checks catch dropped sound and labels sitting on lines before anyone sees it. Use whenever the user wants an idea, derivation, algorithm or result explained as a video or animation: for a course, a talk, a student, or to understand something themselves. Triggers: 'make an explainer video', '3b1b style', 'animate this derivation', 'Manim', 'a video explaining X', 'narrated animation', 'show this as a video', 'explainer on'. No API key needed. Boundaries: a static figure is matplotlib; slides are polished-docs-and-decks; audio alone is text-to-audio; a paper read aloud is paper-to-audio./single-html-documentBuild polished, self-contained single-file HTML documents: one browser-openable .html with all content, CSS, JavaScript, media, and export contracts inlined. Use whenever the user wants a rich, visual, or interactive document delivered as a standalone HTML file. Triggers: 'make a single-file HTML document', 'self-contained / standalone HTML', 'package this website into one .html', 'build an interactive briefing / explainer / dashboard / research synthesis as a webpage', 'a review or annotation workbook', 'an editable draft with edit-diff', 'a designed document I can open in a browser and email', or any request to collapse a multi-file site into one shareable HTML file. Authored as a Vite + React + TypeScript site (Markdown + YAML front matter compiled to JSON), then packaged with vite-plugin-singlefile. Boundaries: an animated HTML slide deck is a different job; a .pptx or typeset PDF is polished-docs-and-decks; this skill owns documents, dashboards, and workbooks.npx claudepluginhub shocklab/co-scientist-toolkit --plugin documentsOther plugins' skills for the same job