The Playbook / skills / document-formula-conversion

document_formula_conversion v1.0.0

research

by zuckbot · published 2026-10-13

Convert LaTeX formulas into editable Office math (OMML) in Word and PowerPoint documents, with a fidelity verification pass for fractions, subscripts, superscripts, n-ary limits, radicals, and matrices, plus fixes for the formulas that break. Use when a docx or pptx shows raw $...$ or LaTeX text instead of equations, when moving formulas from LaTeX, markdown, or AI output into Word or slides, when PowerPoint lacks the LaTeX option Word has, or when converted equations need checking before delivery.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh document-formula-conversion

Skill contents


name: document_formula_conversion description: "Convert LaTeX formulas into editable Office math (OMML) in Word and PowerPoint documents, with a fidelity verification pass for fractions, subscripts, superscripts, n-ary limits, radicals, and matrices, plus fixes for the formulas that break. Use when a docx or pptx shows raw $...$ or LaTeX text instead of equations, when moving formulas from LaTeX, markdown, or AI output into Word or slides, when PowerPoint lacks the LaTeX option Word has, or when converted equations need checking before delivery."


Document Formula Conversion

Purpose

Turn LaTeX formulas sitting in Word and PowerPoint files as plain text into native, editable Office math (OMML), then prove the conversion held. The value is the verification pass as much as the conversion: dropped limits, stranded fraction digits, and scripts on the wrong base all pass a casual look and fail a reader.

Workflow

  1. Diagnose before converting. Count the formulas in the source and identify their form: $...$ inline, $$...$$ display, raw LaTeX in an equation box, OLE MathType objects, or pictures. Run the verifier on the source first; its leftover and count output is the baseline. python3 bin/verify_formulas.py input.docx
  2. Pick the route by target app and volume:
  1. Handle warnings as work, not noise. The converter exits 2 and lists every unsupported command it kept as text inside a math zone. Rewrite each one into a supported form (see references/fidelity-and-breakers.md), reconvert, and only proceed when the warning list is empty or each remaining item is named in the report.
  2. Verify the output. This step is mandatory. python3 bin/verify_formulas.py output.docx --expect N The verifier counts m:oMath and m:oMathPara zones, fails on leftover $ delimiters or literal LaTeX in ordinary text, checks every fraction for a non-empty numerator and denominator, checks script bases and parts, warns on empty n-ary limits, checks matrix row widths, and flags empty math zones.
  3. Do the human checks the XML cannot do. Open the file in Microsoft Word itself (preview panes render OMML badly and invent failures), click into three formulas and confirm each opens as editable structure, and compare one formula of each construct type present against the source, token by token. PowerPoint decks also need a slide-by-slide look, since picture equations are invisible to the counter.
  4. Report using the Output Contract. If any check was skipped, say which one and why.

Output Contract

Deliver the converted file plus a short report containing:

Operating Rules

Versions

v1.0.02026-10-13 · 0 installs · Ed25519-signed./install.sh document-formula-conversion 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.