Sections, numbering & variables
How IDML numbers its pages with sections and fills text with computed values — page-number markers, the section marker, the chapter number and text variables.
Sections decide what each page is called; markers and text variables print those names, and other computed values, inside the text.
In short A finished document rarely numbers its pages 1, 2, 3 from cover to back.
IDML records the rules in Section elements in the design map: where numbering
restarts, in what style, with what prefix and section marker. Stories then refer to the
result in two ways. Page numbers and the section marker are processing instructions in
the text, <?ACE 18?> and <?ACE 19?>. Everything else computed (a running header, the
last page number, the chapter number, the file name, a date) is a TextVariable
defined in the design map and placed in the story as a TextVariableInstance. The file
also stores the values InDesign last computed, so a reader can display them without
recomputing anything.
The pieces
| Piece | Where | What it does |
|---|---|---|
Section | designmap.xml, after the spread references | starts or continues page numbering, with a style, prefix and marker |
Page Name | each Page in a spread | the page's label, as InDesign shows it |
<?ACE 18?> | in a story's Content | the current, next or previous page number |
<?ACE 19?> | in a story's Content | the marker text of the page's section |
ChapterNumberPreference | Resources/Preferences.xml | the document's chapter number |
TextVariable | designmap.xml | a computed value: running header, last page number, file name, date, fixed text |
TextVariableInstance | in a story | one placement of a variable, with the value last computed in ResultText |
What is stored and what is computed
InDesign has laid the document out when it writes IDML, so it records the results along
with the rules. Each page carries its label in Name; each variable instance carries its
value in ResultText. A page-number marker carries no value at all: it is resolved for
whichever page the text lands on.
Those stored values are snapshots. If text moves to another page, a running header's
ResultText can be wrong for its new page. An application that lays the document out
again recomputes them from the rules; one that only reads the file sees the values from
the last save.
Where to go next
- Sections and numbering:
the
Sectionelement, its numbering style, and the rules InDesign applies when reading it. - Text variables: the
TextVariablekinds,TextVariableInstance, and the full page-marker table.
In Paged: sections are read and applied, page-number markers resolve for the page the text lands on, and the variable kinds InDesign writes are recomputed rather than copied from
ResultText. Supported · verified
Frequently asked questions
What is the difference between a section and a text variable?
A section decides how pages are numbered. A text variable is a computed value placed in
the text, such as a running header or the file name. The page number itself is neither:
it is a <?ACE 18?> marker in the text.
Are page numbers stored in IDML?
Each page's label is stored in its Name. The page numbers printed in the text are
markers that are resolved for the page they end up on.
Can stored values go stale?
Yes. ResultText on a variable instance is the value at the last save. Moving text
changes what it should be; an application that lays the document out recomputes it.
Where is the chapter number?
In ChapterNumberPreference in Resources/Preferences.xml. It belongs to the document,
not to a section.
Table of contents
How IDML stores a table of contents — TOCStyle and TOCStyleEntry in Styles.xml, and the generated story that names its TOC style in AppliedTOCStyle.
Sections and numbering
The Section element — where numbering restarts, its PageNumberStyle, prefix and marker — and how pages, page-number markers and the chapter number use it.