fields_update
Recompute TOC, page, page-count, sequence and reference fields in .docx via LibreOffice and write results as tracked changes; or flag Word to update fields on open.
Instructions
Recompute the results of the body's TOC, page, page-count, sequence and reference fields through headless LibreOffice and write only those result runs, as tracked changes (the old result is struck, the new one inserted). Without LibreOffice it refuses with ENGINE_UNAVAILABLE naming the stale fields; set_update_on_open sets w:updateFields instead, so Word updates the fields when it opens the file. Citation fields are never changed. SECTIONPAGES, SECTION and NOTEREF are not recomputed (LibreOffice keeps their cached results) and are listed under skipped. INDEX is never recomputed (LibreOffice ignores its switches and flattens sub-entries): every index is left as it is and listed under skipped; rebuild it in Word (F9). A REF that LibreOffice resolves to an error (a missing bookmark) or to nothing (a number of an unnumbered paragraph) keeps its result and is listed under skipped. Fields it could not pair with LibreOffice's are listed under skipped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Path to the .docx. | |
| tag | No | Appended to the author. | |
| author | No | Revision author. | |
| expect | No | ||
| dry_run | No | Preview only; write nothing. | |
| set_update_on_open | No | Only set w:updateFields in settings.xml (no LibreOffice). |