/mathtype-for-word:mathtype-for-wordfrom mathtype-for-word
Creates, numbers, cross-references, and validates MathType equations in DOCX and PPTX files using genuine Equation.DSMT4 OLE objects. Handles TeX-to-MathType conversion, IEEE-style typography, and equation numbering workflows.
Ships in mathtype-for-word. 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.
Create real MathType equations in DOCX and PPTX, preserving MathType-native Word numbering and references. Treat source Office files as user data: write a new output unless the user explicitly authorizes in-place replacement.
Equation.DSMT4 inline OLE objects created by MathType Toggle TeX.MACROBUTTON MTPlaceRef and SEQ MTEqn fields.MTCommand_InsertEqnRef, its MTReference placeholder, and the target number's MTPlaceRef action. A resolved reference is a GOTOBUTTON containing a nested REF to a ZEqnNum... bookmark.(1), (2), (3), with chapter and section components disabled.SEQ Equation, OMath, Unicode-only text, images, or manually typed numbers. Use those only as an explicitly accepted, clearly labeled fallback when MathType is unavailable.Equation.DSMT4 OLE objects. PowerPoint has no MathType-native equivalent of Word's equation-number/reference fields, so do not imitate them with typed numbers or links.AppActivate, or SendKeys. If a step cannot run silently, stop and report the limitation.pwsh.exe 7 or later.pwsh.exe bridge commands. From WSL Bash, invoke Windows pwsh.exe; Linux pwsh cannot automate Windows Office COM.pwsh.exe there.pwsh.exe is missing, the MCP server installs PowerShell 7.6.6 (LTS) for the current user on the first tool call that needs it (official GitHub ZIP into %USERPROFILE%\.mathtype-for-word\PowerShell\<version>, pinned SHA-256 and Microsoft signature checked, no administrator rights, PATH unchanged). While it installs, the call fails with powershell.status: installing; tell the user and call the tool again a minute later. The call after it finishes fails with powershell.status: installed and a notice; relay the notice and call the tool again. Without MCP, run powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/ensure-pwsh.ps1 from any terminal, with a shell timeout of several minutes (it downloads about 106 MB); it prints one JSON line whose path replaces pwsh.exe in the commands below, and installed: true means it installed PowerShell 7 now. python scripts\mathtype_batch.py render installs it the same way and returns the notice.notice, or installed: true), tell the user which version was installed, the folder, and the source, in the user's language.powershell.status: failed, or ok: false), stop and ask the user to install PowerShell 7, for example with the MSI installer winget install --id Microsoft.PowerShell --source winget --installer-type wix (administrator rights), or using https://learn.microsoft.com/zh-tw/powershell/scripting/install/microsoft-update-faq?view=powershell-7.6. Do not silently downgrade the workflow.endnote-for-word merely to complete MathType work.mathtype-for-word-manifest.json or mathtype-for-word-validation.json.-mathtype when this skill runs alone. Use -mathtype-endnote, for example <source-stem>-mathtype-endnote.docx, only when endnote-for-word is available and the task requires both skills.endnote-for-word is available before planning a joint workflow. If it is unavailable, complete only the MathType scope, keep the standalone suffix, report the unperformed EndNote scope, and never claim combined completion.endnote-for-word is available and required, plan one shared final DOCX. Do not create separate MathType and EndNote document trees or keep one document per skill. Preserve the original source, let the first skill publish the shared working copy, let the second skill continue on that same copy with explicit overwrite authorization, then validate the final shared document with both skills.probe_mathtype_word once per task, not before every render. Stop on a failed prerequisite; report the exact failed check.inline, display, or display_numbered, and each prose occurrence as reference, using academic-equation-style.md. Decide every identifier, unique marker, TeX, layout, numbered state, reference marker, and target. When the draft holds plain-text mathematics or placeholders instead of {{MATH:…}} markers, call scan_mathtype_candidates first: it lists Word's paragraph numbers, the exact paragraph text, and math signals, including sub/superscripts that plain text loses. Then write a marks file and call mark_mathtype_document to save a marked copy, and render that copy. For a reference, mark only the number, such as (1); Eq. or 式 stays in the prose. A display equation's marker must end up alone in its paragraph: mark the whole paragraph text only when the paragraph holds nothing but the formula. When a display formula shares its paragraph with prose (lines joined by Shift+Enter included), ask the user to put it in its own paragraph, or keep it inline if the user agrees, and scan again before marking.render_mathtype_word_document. Do not edit the same DOCX concurrently in Word. Manifests whose equations plus references exceed batch_size (default 40) render in fresh Word sessions with checkpoints; a foreground render runs all of them in one tool call, which can outlast the client's time limit (Codex: 1200 s with the plugin), so for such manifests pass background: true and poll get_mathtype_render_status while its status is queued or running, and stop on any other status. On interrupted, call render again with the same paths (and background: true again) to resume from the last checkpoint. On failed, read error first: a bad marker, TeX, or validation result needs a corrected manifest or document, which starts the job over.validation (for a background job, result.validation from get_mathtype_render_status once it is completed). The bridge validates the saved file against the whole manifest before it publishes the output, so a successful render already carries the ok: true report; do not call validate_mathtype_word_document again for it. A render is incomplete until that report is ok: true. Call the validate tool only to re-check a document changed later, with the same manifest and the render's existing_number_fields and existing_references.probe_mathtype_powerpoint once per task. Stop and report the exact failed check when powerpoint_ready is false.{{MATH:id}} marker alone in a top-level text box. PowerPoint does not support inline external objects.render_mathtype_powerpoint_presentation. Its result carries the validation of the saved presentation, which must be ok: true; call validate_mathtype_powerpoint_presentation only to re-check a presentation changed later.Use the bundled local MCP server when available:
probe_mathtype_word: read-only prerequisite check.configure_mathtype_word_defaults: persist the packaged default profile and MathType warning preferences. Invoke only when the user asks to configure defaults or during an explicitly requested installation.scan_mathtype_candidates: read-only scan of a draft for plain-text mathematics; writes a candidates JSON.mark_mathtype_document: replace exact text spans with markers in a new DOCX; all marks apply or nothing is saved.render_mathtype_word_document: marker-driven conversion and reference placement; batched, resumable, and optionally in the background.get_mathtype_render_status: progress, log tail, and final result of a render job, keyed by its output path.validate_mathtype_word_document: read-only structural validation.update_mathtype_word_fields: update number/reference fields after moving, adding, or deleting equations.probe_mathtype_powerpoint: verify the desktop PowerPoint and MathType 7 integration.render_mathtype_powerpoint_presentation: replace marker-only text boxes with centered, editable MathType OLE objects.validate_mathtype_powerpoint_presentation: verify expected named OLE objects, centering, and resolved markers.If MCP is unavailable, run the same bridge and job runner directly from the plugin root. Render through the job runner, which batches, checkpoints, and resumes exactly like render_mathtype_word_document; run the same render command again to resume:
# Resolve these variables from the user's attached or repository files; never reuse a sample path literally.
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\mathtype-word.ps1 -Action probe
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\mathtype-word.ps1 -Action scan -InputPath $draftDocx -OutputPath $candidatesJson
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\mathtype-word.ps1 -Action mark -InputPath $draftDocx -OutputPath $inputDocx -MarksPath $marksJson
python scripts\mathtype_batch.py render --input $inputDocx --output $outputDocx --manifest $manifestJson --batch-size 40
python scripts\mathtype_batch.py status --output $outputDocx
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\mathtype-word.ps1 -Action validate -InputPath $outputDocx -ManifestPath $manifestJson
Without Python, -Action render on the bridge renders in one Word session; use it only for manifests of at most 40 equations plus references. Every command prints one ASCII JSON line.
energy_balance or eq_motion_x.{{MATH:eq_motion_x}} and {{EQREF:eq_motion_x}}.inline to layout: "inline", numbered: false.display to layout: "display", numbered: false.display_numbered to layout: "display", numbered: true.reference occurrence to its own unique references[].marker; multiple markers may target the same numbered equation.display_numbered when the full-document scan finds a specific later reference to it.numbered: true. Never create a reference to an unnumbered equation.\bm, \widetilde, \lvert, \iff, \Longrightarrow, \lceil, and aligned. Put an accent inside a bold command (\boldsymbol{\tilde{M}}, \mathbf{\hat{x}}), not around it: Word's PDF export drops an accent drawn around a bold symbol. Do not depend on document preambles, user macros, packages, \label, or \ref.\frac{a}{b} is JSON string "\\frac{a}{b}".numbered defaults to false and references may be omitted. A paragraph with exact line spacing, or a table row with an exact height, lower than a new equation switches to an at-least value of the same size; set exact_line_spacing: "keep" only when the user requires exact spacing, and report the clipped-equation warning.The bundled default mirrors the requested Format Equation Numbers configuration:
1,2,3,....The bridge temporarily suppresses blocking dialogs during headless automation, restores the user's warning preferences afterward, and normalizes MathType's native field structure to (n). Read numbering-and-references.md before diagnosing or manually repairing a field.
existing_number_fields and existing_references in the render result).update_mathtype_word_fields, then validate again.The screenshot-level workflow also includes symbol palettes, equation browsing, preferences, whole-document formatting, conversion, export, MathPage, and help. Read advanced-ribbon-operations.md before using any of them. The MCP surface intentionally automates only the deterministic subset; interactive or whole-document commands require explicit scope, a preserved source, and visual review.
AppActivate, or SendKeys.render_mathtype_powerpoint_presentation launches one hidden Word conversion instance owned by the bridge; after the job, the set of WINWORD process IDs must return to its pre-job baseline.Equation.DSMT4 and opens in desktop MathType when edited.Treat any of these as a failed deliverable:
Equation.DSMT4 objects.OMath object when the requested equations must all be MathType.MACROBUTTON MTPlaceRef, hidden/current SEQ MTEqn, or parentheses.MTSec or MTChap component in a number.GOTOBUTTON, nested REF, or a live ZEqnNum... bookmark.{{MATH:...}}, {{EQREF:...}}, or equation reference goes here text.Error! Reference source not found.Equation.DSMT4 object, preserve the input, stop, and report the equation ID and TeX.MTReference, preserve the failed output only for diagnosis and do not present it as complete.bridge_office_pids, isolated_office_processes_terminated, new_office_pids_left_running, and the cleanup result, verify the warning preferences were restored (%APPDATA%\MathTypeForWordAgent\warning-preferences.json absent means the user's values are back; present means the next render, render-pptx, or configure-defaults call restores them when it takes the bridge lock), then retry only the smallest fixture once before escalating. For render_mathtype_word_document, these keys are in the timeouts list of the render result, successful or failed, or of get_mathtype_render_status; other tools report them at the top level. The watchdog terminates only Office processes the bridge logged as its own; it never terminates other new Word or PowerPoint windows.pid in its status) skips its own cleanup. The next render, render-pptx, or configure-defaults call ends the hidden Word or PowerPoint that the killed run launched (unless it now shows a document window or a slide show) and restores the warning preferences when it takes the bridge lock.render_mathtype_powerpoint_presentation and configure_mathtype_word_defaults are refused while a Word render job is active. A direct mathtype-word.ps1 -Action render-pptx or -Action configure-defaults call is not checked: do not start one while python scripts\mathtype_batch.py status --output <docx> reports queued or running.LICENSE.txt (opens in a new tab)agents/openai.yaml (opens in a new tab)references/academic-equation-style.md (opens in a new tab)references/advanced-ribbon-operations.md (opens in a new tab)references/installation-matrix.md (opens in a new tab)references/numbering-and-references.md (opens in a new tab)references/powerpoint-workflow.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/workflow-and-schema.md (opens in a new tab)scripts/invoke-bridge.ps1 (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mathtype, word-equations, powerpoint-equations, docx, pptx, equation-numbering
npx claudepluginhub felimet/mathtype-for-word --plugin mathtype-for-wordOther plugins' skills for the same job