/pptx-math:pptx-mathfrom pptx-math
Insert LaTeX equations into PowerPoint (.pptx) as native, editable OMML equations rather than images or Unicode text. Companion to the pptx skill, which builds decks but cannot emit equations. Use whenever math reaches a slide — (1) any python-pptx work where an equation, math variable or Greek letter appears, even a single italic variable inside a sentence; (2) building slides from a paper, PDF, Markdown or notes, since research decks almost always carry math; (3) upgrading a deck whose equations were typed as plain text, e.g. "Pr(y = 1) = σ(α + βj zj)", "rA, rB", "τ". Triggers — pptx equation, PowerPoint equation, LaTeX in PPT, python-pptx math, 파워포인트 수식, PPT 수식 넣어줘, 수식 표기로 바꿔줘, 논문 발표자료 만들어줘, PDF로 PPT 만들어줘.
Ships in pptx-math. 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; scripts run unread.
python-pptx has no equation API. This skill converts LaTeX to OMML (Office Math ML)
and injects it into the slide XML, producing a native PowerPoint equation: double-click
opens the equation editor, it is vector, and it follows the theme colour.
No pandoc, no LaTeX distribution, no MathType. Standard library + python-pptx.
pptx skillCompanion, not replacement. The pptx skill builds the deck — layouts, text, tables,
images, charts. It has no way to produce a native equation. This skill covers that one gap.
pptx skill / python-pptx → build the deck, place text boxes
pptx-math → every place where math appears
Use it whenever math reaches a slide, down to a single italic variable in prose.
Never settle for Unicode text (σ(α + βj zj)) or a rendered image.
x, r_A, β_j), Greek letters, sub/superscripts,
fractions, ∑, ∫, matrices.p, r_A, r_B, y).Do not convert acronyms, labels or plain numbers — AUC, Elo, Δwin-rate, −31%p
read worse in math italic.
import sys; sys.path.insert(0, "<skill dir>/scripts")
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx_math import add_native_equation, set_paragraph_segments, shape_census
box = slide.shapes.add_textbox(Inches(1), Inches(2), Inches(11), Inches(1.2))
# Standalone equation
add_native_equation(box.text_frame,
r"\Pr(y=1) = \sigma(\alpha + \beta_j \cdot z_j + \gamma \cdot \mathbf{x})",
size=Pt(32), align="center", color="1F3864")
# Several equations — each call makes a new paragraph
for eq in [r"\sigma(z) = \frac{1}{1+e^{-z}}", r"\hat{y} = \mathbf{w}^\top\mathbf{x} + b"]:
add_native_equation(box.text_frame, eq, size=Pt(24), align="center")
The most common real case. set_paragraph_segments() reuses the existing run's font, size,
colour and indentation, so the layout does not shift.
para = body_shape.text_frame.paragraphs[3]
set_paragraph_segments(para, [
("text", "The paper writes "), ("math", "p"), ("text", ", "), ("math", "r_A"),
("text", ", "), ("math", "r_B"), ("text", ", where "), ("math", "p"),
("text", " is the prompt."),
])
| Function | Purpose |
|---|---|
add_native_equation(tf, latex, size, align, paragraph, color, display) | Add a native equation. paragraph= appends inline to an existing paragraph without touching its properties |
set_paragraph_segments(para, segments) | Rebuild a paragraph from [("text", …), ("math", …)], preserving formatting |
add_text_run(para, text, template_run=) | Append a plain run, cloning formatting |
math_node(latex, size, color) | Build the <a14:m> element alone |
add_equation_image(slide, latex, left, top, …) | matplotlib mathtext PNG fallback |
latex_to_unicode(latex) | Unicode approximation — simple one-liners only |
shape_census(path) | Per-slide shape inventory — diff around every save |
latex2omml.latex_to_omml(latex) uses the converter standalone.
Sub/superscripts · \frac \dfrac · \sqrt[n]{} · \left( \right) · all Greek letters ·
\sum \prod \int \oint with limits · \mathbf \mathrm \mathbb \mathcal \text \operatorname ·
\hat \bar \vec \tilde \dot \overline · function names (\log \sin \max \Pr, thin space
added automatically and suppressed before ( or a subscript) · \begin{pmatrix} family ·
operators (\cdot \times \leq \approx \to \infty \top …) · spacing (\quad \,).
Unknown commands are printed by name rather than silently swallowed, so mistakes are visible.
before = shape_census(DECK); prs.save(DECK)
assert before == shape_census(DECK)
a:p child order: pPr, (r|br|fld|a14:m)*, endParaRPra:pPr child order: lnSpc, spcBef, spcAft, bu*, tabLst, defRPr, extLstsz is in hundredths of a point. Pt(36) writes EMU 457200 and renders wrong.
_sz() handles it — do not hand-write the XML.align defaults to
"leave as-is", and inline insertion never touches pPr / endParaRPr..text or text search. Check
whether speaker notes or post-processing depend on those strings, and tell the user.See references/verification.md. In short: diff shape_census (mandatory) → open a copy
in real PowerPoint, export PDF, render the page. LibreOffice ignores OMML font size, so
never use it to check sizing.
pptx skill, python-pptx, or an existing template).add_native_equation() / set_paragraph_segments() —
never flatten to Unicode and move on.shape_census assertion → render a copy in PowerPoint to confirm.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub maenjh/pptx-math --plugin pptx-math