Files
aiongg 649e80ea6f feat: write footnotes, endnotes and their options
- Footnotes: text owned by a footnote (class 0x24F) is read into the
  footnote and written as a Footnote element in place of its U+0004;
  hyperlink sources inside footnotes are placed like the others.
- FootnoteOption from preferences chunk 0x2820 (styles, numbering,
  marker, spacing, strings, splitting, straddling, both rules); without
  the chunk, the text style and straddling every IDML has. The value
  file reader decodes numeric character references, which fixes the
  SeparatorText tab.
- EndnoteOption from chunk 0x2261E; default marker and text styles
  without it. IsEndnoteStory from DOM 13 instead of 15.
- Endnotes: the endnote story (class 0x2801) is converted, references
  (class 0x2805) become Endnote elements, ranges (class 0x2804, in the
  range tree) EndnoteRange, and its frames EndnoteTextFrame, as InDesign
  writes them.
- compare.py accepts the schema errors of that endnote markup when the
  reference IDML of the pair has the same errors (docs/measurement.md).

Trustworthy pairs: reproduced 10,579,111 -> 10,650,374 (91.92 % ->
92.54 %); stories with identical text 18,565 -> 18,574 (0 missing);
documents >= 99 % 20 -> 21; TextRange +62,059, FootnoteOption and
IsEndnoteStory complete, EndnoteOption +1,356, hyperlinks in footnotes
+271. Extra values 26,179 -> 26,107. No key reproduces fewer values.
Schema validation: 0 failures; 1 pair accepted by the endnote rule; 11
files without a reference fail only on endnote markup.
2026-10-08 02:56:03 +00:00

2.4 KiB

Cross-reference formats

Cross-reference formats are objects of class 0x1355E. IDML writes each as a CrossReferenceFormat element in designmap.xml with Self the UID, holding one BuildingBlock element per block, whose Self is the format's Self, BuildingBlock and the block's index (from 0). The schema puts them after the sections and before idPkg:BackingStory. Implemented in src/model/xref.rs.

Evidence

All corpus pairs, including those whose IDML is from an older version: 1,215 IDML CrossReferenceFormat elements, of which 1,170 have an INDD object with the same UID. The other 45 are in pairs whose IDML was exported from another save. All 2,250 class 0x1355E objects in the 251 distinct little-endian files parse with the layout below.

Format (chunk 0x13593)

Field Contents IDML
u8, string Name Name (1,170 of 1,170)
u32 0 in every sample AppliedCharacterStyle="n" in every sample
u16 0 or 1, not identified
u32 Block count number of BuildingBlock elements (1,170 of 1,170)
blocks below BuildingBlock, in order

Building block:

Field Contents IDML
u32 Block type (below) BlockType
10 bytes 0 in every sample AppliedCharacterStyle="n", AppliedDelimiter="$ID/", IncludeDelimiter="false" in every sample
u8, string Custom text; the flag byte is 1 for a built-in key, written with $ID/ CustomText (3,510 of 3,510)
Code BlockType Blocks in the pairs
0 CustomStringBuildingBlock 1,820
3 PageNumberBuildingBlock 650
4 FullParagraphBuildingBlock 260
5 ParagraphNumberBuildingBlock 260
6 ParagraphTextBuildingBlock 260
7 BookmarkNameBuildingBlock 260

Custom texts in the pairs include ", " on page , on page and page ; the other block types have $ID/.

Every corpus file has the same nine formats, so the fields that are 0 everywhere cannot be located. The converter writes the character style, delimiter and include-delimiter values above only where those fields are 0, and leaves them out otherwise. It leaves out blocks with other type codes (none occur in the corpus); the other blocks keep their index.

Sources in text

Cross-reference sources in text are text sources with chunk 0x135A0; hyperlinks.md describes them. Cross-reference sources inside tracked changes are not converted, because their text is not.