Skip to content

shiquda/open-pptd-skill / skills/open-pptd

open-pptd

Flagged

Create, edit, reverse-decompile, and export presentations using the open PPTD format and native pptd compiler. For every PPT task, default deliverables are BOTH (1) a self-contained PPTD project folder (deck.pptd manifest + pages/*.page) and (2) a locally compiled native .pptx with vector shapes, connector arrows, LaTeX math formulas, speaker notes, and native tables. Completely offline — zero dependency on browser automation or cloud logins.

FileKindSize
SKILL.mdskill md16.0 KB
reference/cli.mdmarkdown9.0 KB
reference/design_system/academic/blue-line-courseware/design.mdmarkdown13.9 KB
reference/design_system/academic/deep-blue-atlas/design.mdmarkdown13.5 KB
reference/design_system/academic/paper-white-courseware/design.mdmarkdown14.0 KB
reference/design_system/academic/pastel-derivation/design.mdmarkdown14.6 KB
reference/design_system/academic/teal-green-academic-defense/design.mdmarkdown14.1 KB
reference/design_system/academic/wine-red-data/design.mdmarkdown14.2 KB
reference/design_system/consulting/apricot-white-brief/design.mdmarkdown17.4 KB
reference/design_system/consulting/indigo-due-diligence/design.mdmarkdown11.8 KB
reference/design_system/consulting/marine-blue-research/design.mdmarkdown11.8 KB
reference/design_system/consulting/moss-green-transformation/design.mdmarkdown13.2 KB
reference/design_system/consulting/pine-green-strategy/design.mdmarkdown15.1 KB
reference/design_system/consulting/red-black-growth/design.mdmarkdown12.7 KB
reference/design_system/finance/black-gold-ledger/design.mdmarkdown15.2 KB
reference/design_system/finance/ebony-ledger/design.mdmarkdown14.6 KB
reference/design_system/finance/honey-orange-memo/design.mdmarkdown12.8 KB
reference/design_system/finance/lake-blue-memo/design.mdmarkdown16.0 KB
reference/design_system/finance/prospect-annual/design.mdmarkdown14.6 KB
reference/design_system/finance/rice-paper-annual/design.mdmarkdown11.1 KB
reference/design_system/promotion/aqua-charity-report/design.mdmarkdown15.1 KB
reference/design_system/promotion/cream-collage/design.mdmarkdown12.6 KB
reference/design_system/promotion/pine-soot-pictorial/design.mdmarkdown14.0 KB
reference/design_system/promotion/silk-yellow-magazine/design.mdmarkdown13.3 KB
reference/design_system/promotion/silver-gray-luxury-magazine/design.mdmarkdown13.8 KB
reference/design_system/promotion/travel-green-handbook/design.mdmarkdown15.4 KB
reference/design_system/work/blue-flame-brand/design.mdmarkdown14.6 KB
reference/design_system/work/electric-violet-business/design.mdmarkdown13.0 KB
reference/design_system/work/moon-white-imagery/design.mdmarkdown13.5 KB
reference/design_system/work/sky-blue-wayfinding/design.mdmarkdown15.4 KB
reference/design_system/work/warm-clay-works/design.mdmarkdown13.5 KB
reference/design_system/work/warm-jade-annual-report/design.mdmarkdown15.7 KB
reference/fonts.mdmarkdown6.6 KB
reference/general-poster.mdmarkdown26.8 KB
reference/math.mdmarkdown10.6 KB
reference/pptd.mdmarkdown95.0 KB
reference/shapes.mdmarkdown15.0 KB
reference/slides_categories.mdmarkdown4.6 KB
reference/slides_categories/academic-research.mdmarkdown15.2 KB
reference/slides_categories/analysis-decision.mdmarkdown5.9 KB
reference/slides_categories/brand-creative.mdmarkdown14.7 KB
reference/slides_categories/business-plan.mdmarkdown6.4 KB
reference/slides_categories/education-training.mdmarkdown24.2 KB
reference/slides_categories/management-report.mdmarkdown5.6 KB
reference/slides_categories/tech-engineering.mdmarkdown18.5 KB
reference/tables.mdmarkdown2.2 KB
scripts/convert_pptx.pyexecutablescript2.7 KB
scripts/export_images.pyexecutablescript6.7 KB
scripts/export_pptx.pyexecutablescript4.7 KB
scripts/install_binary.pyexecutablescript17.5 KB
scripts/requirements.txtmanifest228 B
scripts/validate_pptx.pyexecutablescript27.9 KB
tests/fixtures/minimal/minimal.pptdother93 B
tests/fixtures/minimal/pages/01.pageother330 B
tests/test_export_images.pyexecutablescript1.5 KB
tests/test_export_pptx.pyexecutablescript4.2 KB
tests/test_validate_pptx.pyexecutablescript2.8 KB
theme.mdmarkdown16.6 KB
theme_EN.mdmarkdown16.9 KB
theme_previews/academic/blue-line-courseware.jpgbinary51.1 KB
theme_previews/academic/deep-blue-atlas.jpgbinary41.4 KB
theme_previews/academic/paper-white-courseware.jpgbinary52.2 KB
theme_previews/academic/pastel-derivation.jpgbinary50.4 KB
theme_previews/academic/teal-green-academic-defense.jpgbinary55.4 KB
theme_previews/academic/wine-red-data.jpgbinary52.4 KB
theme_previews/consulting/apricot-white-brief.jpgbinary61.1 KB
theme_previews/consulting/indigo-due-diligence.jpgbinary75.5 KB
theme_previews/consulting/marine-blue-research.jpgbinary72.1 KB
theme_previews/consulting/moss-green-transformation.jpgbinary55.9 KB
theme_previews/consulting/pine-green-strategy.jpgbinary74.4 KB
theme_previews/consulting/red-black-growth.jpgbinary63.0 KB
theme_previews/extra/color-stripes-documentary.jpgbinary39.8 KB
theme_previews/extra/dark-themed-data.jpgbinary45.5 KB
theme_previews/extra/dusk-violet-consulting.jpgbinary44.8 KB
theme_previews/extra/fresh-brand.jpgbinary44.7 KB
theme_previews/extra/gold-orange-type-journal.jpgbinary40.5 KB
theme_previews/extra/ink-green-market-trends.jpgbinary47.0 KB
theme_previews/extra/lead-gray-quarterly.jpgbinary43.3 KB
theme_previews/extra/map-strategy.jpgbinary47.0 KB
theme_previews/extra/mist-blue-travelogue.jpgbinary46.3 KB
theme_previews/extra/orange-tech.jpgbinary34.8 KB
theme_previews/extra/pink-purple-diagnosis.jpgbinary30.4 KB
theme_previews/extra/red-black-business.jpgbinary42.6 KB
theme_previews/extra/red-white-business.jpgbinary67.9 KB
theme_previews/extra/xuan-paper-annual.jpgbinary53.3 KB
theme_previews/finance/black-gold-ledger.jpgbinary60.5 KB
theme_previews/finance/ebony-ledger.jpgbinary59.8 KB
theme_previews/finance/honey-orange-memo.jpgbinary69.0 KB
theme_previews/finance/lake-blue-memo.jpgbinary66.7 KB
theme_previews/finance/prospect-annual.jpgbinary64.8 KB
theme_previews/finance/rice-paper-annual.jpgbinary67.5 KB
theme_previews/promotion/aqua-charity-report.jpgbinary60.9 KB
theme_previews/promotion/cream-collage.jpgbinary62.8 KB
theme_previews/promotion/pine-soot-pictorial.jpgbinary82.1 KB
theme_previews/promotion/silk-yellow-magazine.jpgbinary83.0 KB
theme_previews/promotion/silver-gray-luxury-magazine.jpgbinary66.3 KB
theme_previews/promotion/travel-green-handbook.jpgbinary57.1 KB
theme_previews/work/blue-flame-brand.jpgbinary61.9 KB
theme_previews/work/electric-violet-business.jpgbinary54.2 KB
theme_previews/work/moon-white-imagery.jpgbinary52.5 KB
theme_previews/work/sky-blue-wayfinding.jpgbinary57.6 KB
theme_previews/work/warm-clay-works.jpgbinary49.0 KB
theme_previews/work/warm-jade-annual-report.jpgbinary58.5 KB

reference/math.md

View on GitHub
# Native Math & LaTeX Formulas in PPTD

Starting in version 1.4.0, `open-pptd` compiles LaTeX formulas directly into native PowerPoint Office Math (OOXML OMML via `<a14:m>`) with authentic typographical layout (real horizontal fraction bars, scalable radical roots, and properly aligned large operators). Standalone formulas are editable equations in every viewer that understands OOXML math; inline formulas stay editable in PowerPoint/WPS and degrade to correctly typeset text where the viewer does not implement the `a14` math extension (see §2).

---

## 1. Syntax

Formulas can be declared in PPTD rich text using either `<latex>...</latex>` tags or `\( ... \)` delimiters inside `<p>` paragraphs:

```yaml
- elementId: math-card
  elementType: text
  bounds: [60, 140, 840, 120]
  content:
    text: |
      <p>Inline formula in running text: \( h(s_t) \ge 0 \) defines the forward invariant set.</p>
      <p>\( \frac{a+b}{c+d} = \sqrt{x^2 + y^2} \)</p>
```

Both `<latex>\frac{1}{2}</latex>` and `\(\frac{1}{2}\)` are treated identically by the compiler.

---

## 2. Display vs. Inline Formatting Rules

The compiler automatically distinguishes between **display formulas** and **inline formulas** based on paragraph structure:

1. **Display Formulas (Standalone)**:
   - When a formula is the **sole content** of a paragraph (e.g. `<p>\( \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} \)</p>`), it compiles into an Office Math display paragraph (`<m:oMathPara>` with `<m:jc m:val="centerGroup"/>`).
   - The equation is centered horizontally with dedicated vertical spacing.
2. **Inline Formulas (Mixed Text)**:
   - When a formula is mixed with surrounding text or other tags in the same paragraph (e.g. `<p>Given \( x \in \mathbb{R} \), we have ...</p>`), it is emitted as a markup-compatibility pair:
     - `<mc:Choice Requires="a14">` — the native math zone (`<a14:m>` / `<m:oMath>`) placed alongside `<a:r>` text runs. PowerPoint and WPS take this branch and keep the formula editable.
     - `<mc:Fallback>` — ordinary text runs rendering the same formula with Unicode symbols and baseline-shifted scripts (`x^{2}` → `x²`, `\frac{a+b}{c+d}` → `(a+b)/(c+d)`, `\sqrt{x^2+y^2}` → `√(x²+y²)`, `\sum_{i=1}^{n}` → `∑` with lowered/raised limits). Viewers that do not implement the `a14` extension — LibreOffice among them — take this branch.
   - This pairing exists because LibreOffice's PPTX importer drops a math zone that shares a paragraph with text runs; the fallback guarantees the formula is never silently lost.
   - Consequence: an inline formula is an editable equation in PowerPoint/WPS but plain (still correct) text in LibreOffice. If a formula must be an editable equation in every viewer, put it on its own line so it compiles as a display formula.
3. **Display-only environments**:
   - `\begin{align}`, `\begin{gather}` and `\begin{eqnarray}` are display environments in LaTeX and must own their paragraph. Using one inside a line of text fails the build with an explicit error instead of silently producing a broken inline equation.
   - The `…ed` variants (`\begin{aligned}`, `\begin{gathered}`, `\begin{split}`) may be used in either position.

#### Box geometry drives the rendered formula in LibreOffice

A display formula becomes one Office Math object. PowerPoint and WPS lay it out inline and scale it with the run font size, so the text box only needs to be big enough. LibreOffice (and its PDF export) instead sizes that object to the whole text frame, **stretching width and height independently**: the same formula in 400-wide frames 60 / 120 / 240 tall renders 388×52, 388×104, 388×209 slide units. A frame whose aspect ratio differs from the formula's own aspect therefore produces the squashed or stretched look.

Measured on LibreOffice 25 (`soffice --convert-to pdf`, 150 DPI) with a formula box that does not overflow: `<a:autofit>` makes no difference there — `normAutofit`, `noAutofit` and `spAutoFit` render identically; `wrap="none"` does not change it either. It does matter once plain text overflows: LibreOffice honours `normAutofit` and shrinks, so never rely on autofit to hide an oversized box.

What to do:

- **Size the box to the formula.** Keep `bounds[2] / bounds[3]` close to the formula's natural aspect (a long single line is ~4–6:1, a fraction or radical ~3–4:1, a stacked matrix or multi-line `aligned` ~2–3:1). A 400×70 box holding a 2:1 matrix renders the matrix ~3× too flat.
- **Split long formulas** across `aligned` / `split` rows or into two elements instead of stretching one line across the slide.
- **Verify with a render.** `check` cannot measure OMML layout; the PNG from `validate_pptx.py --render-images` is the only reliable proof, and the box that looks right in PowerPoint may still be deformed in LibreOffice.

PowerPoint is the reference renderer, so a box that satisfies the rule above is correct in both.

---

## 3. Supported LaTeX Subset

The compiler includes a built-in LaTeX-to-OMML converter supporting standard mathematical typesetting:

### Fractions and Radicals
- Fractions: `\frac{a}{b}`, `\dfrac{a}{b}`, `\tfrac{a}{b}` (compiled to `<m:f>` with genuine horizontal fraction bar)
- Square roots: `\sqrt{x}`, `\sqrt{x^2 + y^2}` (compiled to `<m:rad>`)
- N-th roots: `\sqrt[n]{x}` (compiled to `<m:rad>` with explicit `<m:deg>`)

### Subscripts and Superscripts
- Subscripts: `x_i`, `x_{t+1}`, `o_{\le t}`
- Superscripts: `x^2`, `A^T`, `e^{-\lambda t}`
- Combined: `A_t^H`, `\sigma_{i,j}^2` (compiled to `<m:sSubSup>`)

### Big Operators and Limits
- Summation, product, and integrals: `\sum`, `\prod`, `\int`, `\oint` (compiled to `<m:nary>`)
- Function names with limits: `\lim` (compiled to `<m:func>` with `<m:limLow>`, because an OMML operator character must be a single character — emitting `lim` as `<m:chr>` produces a replacement glyph in every renderer)
- Upper and lower limits attached via `_` and `^`:
  ```latex
  \sum_{i=1}^{n} x_i, \quad \int_{0}^{\infty} e^{-x} dx, \quad \lim_{x \to 0} \frac{\sin x}{x}
  ```

### Delimiters & Grouping
- Scalable delimiters: `\left( ... \right)`, `\left[ ... \right]`, `\left\{ ... \right\}`, `\left| ... \right|`, `\left\langle ... \right\rangle`, `\left. ... \right|` (compiled to `<m:d>`)

### Matrices and Piecewise Cases
- Matrix environments: `\begin{matrix}`, `\begin{pmatrix}`, `\begin{bmatrix}`, `\begin{vmatrix}` using `&` for column separation and `\\` for rows (compiled to `<m:m>`).
- Piecewise cases: `\begin{cases} ... \end{cases}`.

### Multi-line Equations
- Aligned derivations: `\begin{aligned} ... \end{aligned}`, `\begin{split}`, `\begin{gather}`, `\begin{gathered}`, `\begin{align}`, `\begin{eqnarray}`. Rows are separated by `\\`; `&` marks the alignment point. They compile to an OMML equation array (`<m:eqArr>`) with one line per `<m:e>`, so PowerPoint and WPS keep a single editable multi-line equation:
  ```latex
  \begin{aligned} (a+b)^2 &= a^2 + 2ab + b^2 \\ &= a^2 + 2ab + b^2 \end{aligned}
  ```
- `align`, `align*`, `gather`, `gather*` and `eqnarray` are display environments: they must be the only content of their paragraph, exactly as in LaTeX. The `…ed` variants (`aligned`, `gathered`, `split`) may also appear inside running text.
- The alignment point is written as an `&` run inside each line — the same encoding Word's linear format uses and Microsoft's `MML2OMML.XSL` produces. LibreOffice renders the equation array as a stacked column of lines.

### Macro Definitions
Short aliases can be defined at the top of a formula; they are expanded before parsing, so a macro never leaks onto the slide and never trips the unsupported-command diagnostics:

```latex
\newcommand{\R}{\mathbb{R}}\newcommand{\norm}[1]{\left|#1\right|} \norm{x} \in \R^n
```

- `\newcommand{\name}[n]{body}`, `\newcommand\name[n]{body}`, and the optional-default form `\newcommand{\name}[n][default]{body}` (`\name[…]` may then be omitted).
- `\renewcommand` (the macro must already exist) and `\providecommand` (no-op when it does).
- `\def\name{body}` and `\def\name#1#2{body}`. Delimited parameter texts (`\def\x#1,{…}`) are rejected with a clear error.
- `#1`…`#9` are substituted with the arguments of the call; `##` yields a literal `#`.
- A definition is scoped to one formula: a macro defined in one `<latex>` body is not visible in the next.
- Recursive definitions (`\def\a{\a}`) fail with an expansion-limit error instead of hanging.

### Mathematical Symbols & Greek Letters
- **Greek lowercase**: `\alpha`, `\beta`, `\gamma`, `\delta`, `\epsilon`, `\theta`, `\pi`, `\sigma`, `\tau`, `\omega`, etc.
- **Greek uppercase**: `\Gamma`, `\Delta`, `\Theta`, `\Lambda`, `\Xi`, `\Pi`, `\Sigma`, `\Phi`, `\Psi`, `\Omega`.
- **Relations**: `\le`, `\ge`, `\neq`, `\approx`, `\equiv`, `\sim`, `\propto`, `\mid`, `\perp`, `\parallel`.
- **Set operations**: `\in`, `\notin`, `\subset`, `\subseteq`, `\supset`, `\cup`, `\cap`, `\emptyset`.
- **Logic & arrows**: `\forall`, `\exists`, `\neg`, `\wedge`, `\vee`, `\to`, `\leftarrow`, `\rightarrow`, `\Rightarrow`, `\Leftarrow`, `\mapsto`.
- **Arithmetic & calculus**: `\times`, `\cdot`, `\pm`, `\mp`, `\div`, `\infty`, `\partial`, `\nabla`.

### Font Styles & Functions
- Blackboard bold: `\mathbb{R}`, `\mathbb{N}`, `\mathbb{Z}`, `\mathbb{C}`, `\mathbb{Q}`
- Upright text / math operators: `\mathrm{...}`, `\text{...}`, `\operatorname{...}`
- Standard functions: `\sin`, `\cos`, `\tan`, `\ln`, `\log`, `\exp`, `\min`, `\max`

### Spacing, Accents & Escapes
- Spacing: `\,`, `\;`, `\:`, `\quad`, `\qquad`
- Escapes: `\{`, `\}`, `\_`, `\&`, `\%`, `\#`, `\$`
- Accents: `\bar`, `\overline`, `\hat`, `\vec`, `\tilde`, `\dot`

---

## 4. Hard-Error Policy (No Silent Degradation)

Prior compiler versions attempted to approximate unsupported LaTeX commands as plain text runs (e.g. converting `\frac{x+1}{y}` into text `x+1/y`).

In `open-pptd` v1.4.0+:
- **Strict Validation**: Every LaTeX command is validated against the supported vocabulary.
- **Hard Error on Unsupported Commands**: If an unsupported command (e.g. `\tikz`, `\color`, `\foo`) or malformed syntax is encountered, `pptd build` fails immediately with an explicit error naming the command.
- **No Leaked Raw LaTeX**: Raw backslash commands never leak onto the presentation slide.

---

## 5. Reverse Compilation (`pptd convert`)

When reverse-compiling an existing `.pptx` file via `pptd convert input.pptx output_dir/`:
- Native `<a14:m>` equation structures (`<m:f>`, `<m:rad>`, `<m:sSup>`, `<m:nary>`, `<m:m>`, `<m:eqArr>`, etc.) are automatically parsed and reconstructed into standard `<latex>...</latex>` PPTD rich text tags.
- Equation arrays (`<m:eqArr>`) come back as `\begin{aligned} … \end{aligned}` with `&` alignment points preserved.
- Equations round-trip between `.pptd` and `.pptx` losslessly.

canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall