mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-06 18:51:26 +00:00
Tables of contents, tables of figures (`text:illustration-index`, `text:table-index`), alphabetical indexes and bibliographies open as WordCraft's: Word's `TOC` (levels from the source's `text:outline-level`; `\c` and the caption name for figures), `INDEX` and `BIBLIOGRAPHY` fields over their entries as last generated. With a title the field goes in the title paragraph, as References › Table of Contents inserts one; without, it spans the entries (new flow inlines `FieldStart`/`FieldEnd`, mirroring the document's range fields). Update Table then regenerates them from the headings (engine test `odt_toc.rs`, titled and untitled, through a save and reopen). LibreOffice's Contents 1–10, Contents Heading and Figure Index 1 styles are WordCraft's TOC 1–9, TOC Heading and Table of Figures, both ways, also when a file names them without defining them. WordCraft's tables are written as ODF indexes with their source and entry templates, so LibreOffice updates them, the entries' links in the Index Link style. User and object indexes are read as their paragraphs; index marks are not read yet. Found on the way, both shown by the table of contents' round trip: - a style based on LibreOffice's generic Heading style (as its headings and index headings are) lost that parent on save, and with it its font and spacing; - a paragraph's tab stops were measured from its own indent only, not from an indent its style gives (LibreOffice's `TabsRelativeToIndent`), and a named style's stops not from its indent at all. A LibreOffice document with a table of contents, a table of figures and an alphabetical index round-trips pixel for pixel (it was 29,717 px apart and a page short). The parity doc's ODT fidelity is re-estimated at ~72%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GBVQLyDnrG8Tn1yDQcUabC