add_equation
Insert LaTeX equations as native Word math (editable, not images) in block or inline form, with placement by index, anchor, or end, preserving surrounding text.
Instructions
Insert a LaTeX equation as NATIVE Word math (editable in Word's equation editor, not an image). display=True: a block equation in its own paragraph, positioned by exactly one of after_index / after_anchor / at_end. display=False: inline immediately after anchor_text within that paragraph (occurrence picks the match), surrounding text untouched. Supports the standard academic repertoire: fractions, roots, sums/integrals with limits, matrices, cases, align* (aligned is rewritten automatically), Greek, operators, accents, sub/superscripts, \text{}. Unconvertible LaTeX raises a clear error; the document is NOT modified. Equations are invisible to get_text/find_text (search-and-replace is equation-safe); read them with list_equations. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latex | Yes | ||
| at_end | No | ||
| backup | No | ||
| display | No | ||
| file_path | Yes | ||
| occurrence | No | ||
| after_index | No | ||
| anchor_text | No | ||
| after_anchor | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||