forked from scanny/python-pptx
-
Notifications
You must be signed in to change notification settings - Fork 0
[Epic] OMML Math + SmartArt [STRATEGIC] #26
Copy link
Copy link
Open
Labels
area:mathFeature area: mathFeature area: matharea:smartartFeature area: smartartFeature area: smartartepicMulti-feature roadmap epicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P2Long-horizon / strategic debtLong-horizon / strategic debtstatus:strategic-debtMulti-quarter scope; phased deliveryMulti-quarter scope; phased delivery
Milestone
Metadata
Metadata
Assignees
Labels
area:mathFeature area: mathFeature area: matharea:smartartFeature area: smartartFeature area: smartartepicMulti-feature roadmap epicMulti-feature roadmap epicprior-art:forkActive community fork has shipped thisActive community fork has shipped thisprior-art:upstream-prOpen PR on scanny/python-pptx is candidate cherry-pickOpen PR on scanny/python-pptx is candidate cherry-pickpriority:P2Long-horizon / strategic debtLong-horizon / strategic debtstatus:strategic-debtMulti-quarter scope; phased deliveryMulti-quarter scope; phased delivery
Problem
Two of the modern hard XML schemas are unmodelled: Office Math Markup Language (OMML) for equations, and DrawingML-Diagram for SmartArt. Both are STRATEGIC DEBT — neither is small, and both have niche-but-loyal user demand.
OMML / Equations. scanny/python-pptx#126 ("maths formula or LaTeX support", 14c) is the canonical issue; equations cannot even be extracted from text frames (scanny/python-pptx#947). The good news: there is a fork (
OscarPellicer/python-pptx) with a working MathML → LaTeX translation (281 symbols mapped, +1241 lines inoxml/text.py), so a translator-style API is available as a starting point.SmartArt / Diagrams. scanny/python-pptx#83 (4c) is the SmartArt anchor. The four-part bundle (
diagram1.xml,diagram1_colors.xml,diagram1_quickStyle.xml,diagram1_layout.xml) round-trips today as a verbatimgraphicFrameblob, but there is no API for create / edit / re-style.Jona210399/python-pptxhas exploratory parsing ("kind of working"), andMartin005/python-pptx-nghas apptx/parts/smartart.pyskeleton that's a viable scaffold. The right scope here is "build the data model, let PowerPoint relayout on open" — full SmartArt layout regeneration in Python is a tar pit.Sub-features
OMML / Equations
<m:oMath>,<m:f>(fraction),<m:rad>(radical),<m:sub>/<m:sup>,<m:nary>(sum/integral),<m:m>(matrix), at minimumEquation.from_latex(latex_string)— convert via existing pylatexenc-style translatorEquation.to_latex()— reverse direction (port OscarPellicer 281-symbol map)Run.equation = Equation(...)— embed an equation inside a text runSmartArt
Slide.shapes.add_smartart(layout_id, data)where layout_id selects from a set of supported layouts (organization chart, bullet list, process flow first)<dgm:dataModel>with the user's hierarchy; let PowerPoint regenerate the visual layout on openPrior art
OscarPellicer/python-pptxMathML→LaTeX translator (cherry-pick basis).Jona210399/python-pptxWIP parsing,Martin005/python-pptx-ngpptx/parts/smartart.py+pptx/oxml/diagrams/data.pyskeleton.<m:oMath>element tree, lives inside text run as<a:r><m:oMath>.... SmartArt §21.4<dgm:dataModel>four-part bundle.src/pptx/equations/subpackage (port OscarPellicer translator), newsrc/pptx/diagrams/subpackage (port python-pptx-ng skeleton).Acceptance criteria
OMML
Run.equation = Equation.from_latex(r"\frac{a+b}{c}")produces a deck where the equation renders correctly in PowerPoint.equation.to_latex()for an existing OMML run returns reconstructable LaTeX.SmartArt
slide.shapes.add_smartart("OrgChart", root)with a 5-level hierarchy renders correctly when opened in PowerPoint.Effort: L (combined)
Strategic debt. Recommend separate sub-epics in execution if either ships independently. OMML phase ~6 weeks (mostly translator porting). SmartArt phase ~10 weeks (data-model writing, layout-regen contract testing).
Labels
status:strategic-debt,priority:P2.