paged.IDML Reference
Sections, numbering & variables

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.

Tier: IntermediateIntermediateIIreference

A Section says where page numbering restarts and how its numbers look; each page's label is the result.

In short A Section element in designmap.xml starts at a page (PageStart) and covers Length pages. It either continues the previous section's count or restarts at PageNumberStart, in the style named by a typed <Properties><PageNumberStyle> child (Arabic, LowerRoman, UpperLetters, …). It can add a SectionPrefix to its numbers and defines the text of its section marker in Marker. Every document has at least one section. Page-number markers in stories (<?ACE 18?>) print the number the section gives the page; <?ACE 19?> prints the section's marker.

Two sections: the left page is numbered ii in lowercase Roman, the right page restarts at 1 and prints its section marker.

designmap.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?aid style="50" type="document" readerVersion="6.0" featureSet="257" product="20.0(32)"?>
<Document xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0" Self="d" StoryList="ustoryL ustoryR" Name="section-numbering.indd" CMYKProfile="Coated FOGRA39 (ISO 12647-2:2004)" RGBProfile="sRGB IEC61966-2.1" SolidColorIntent="UseColorSettings" AfterBlendingIntent="UseColorSettings" DefaultImageIntent="UseColorSettings">
  <idPkg:Graphic src="Resources/Graphic.xml"/>
  <idPkg:Fonts src="Resources/Fonts.xml"/>
  <idPkg:Styles src="Resources/Styles.xml"/>
  <idPkg:Preferences src="Resources/Preferences.xml"/>
  <idPkg:Tags src="XML/Tags.xml"/>
  <idPkg:MasterSpread src="MasterSpreads/MasterSpread_umaster.xml"/>
  <idPkg:Spread src="Spreads/Spread_uspread.xml"/>
  <Section Self="usectionA" Length="1" ContinueNumbering="false" PageNumberStart="2" Marker="" PageStart="upageL">
    <Properties>
      <PageNumberStyle type="enumeration">LowerRoman</PageNumberStyle>
    </Properties>
  </Section>
  <Section Self="usectionB" Length="1" ContinueNumbering="false" PageNumberStart="1" Marker="Chapter 1" PageStart="upageR">
    <Properties>
      <PageNumberStyle type="enumeration">Arabic</PageNumberStyle>
    </Properties>
  </Section>
  <idPkg:Story src="Stories/Story_ustoryL.xml"/>
  <idPkg:Story src="Stories/Story_ustoryR.xml"/>
  <idPkg:BackingStory src="XML/BackingStory.xml"/>
</Document>

Where sections go

Sections are direct children of Document in the design map, after the idPkg:Spread references and before the stories. Every InDesign-exported document in the census (271 of them) carries at least one: InDesign writes a section on the first page even when the numbering never restarts. Each section covers its pages up to the start of the next.

The Section element

  • PageStart names the Self of the page where the section begins, and Length is the number of pages it covers. InDesign writes Length on every section.
  • ContinueNumbering="true" carries the count on from the previous section; ContinueNumbering="false" restarts at PageNumberStart.
  • SectionPrefix is text such as "A-" that can be shown with the page numbers; IncludeSectionPrefix decides whether it is.
  • Marker is the section marker: the text a <?ACE 19?> marker prints on the pages of this section, such as a chapter title.
  • Name is the section's name in InDesign's interface, usually empty.
Attribute · SectionValuesPagedpaged.set
PageNumberStyleArabic | UpperRoman | LowerRoman | UpperLetters | LowerLettersread · writtennumberingStyle
PageStartidread · written
Selfid / referenceread · written
ContinueNumberingfalse | trueread · written
IncludeSectionPrefixbooleanread · written
Lengthintegerwritten
Marker—read · written
Name—written
SectionPrefixtextread · writtenprefix
AlternateLayoutbuiltin / enum / textnot read
The 10 attributes real documents use most. All 14 attributes of Section →

These rules were measured in InDesign 20.0.1:

  • Write ContinueNumbering="false" before PageNumberStart. InDesign applies the start number only once it has read the restart; with the attributes the other way round, it keeps the section and its marker but numbers straight through.
  • An absent ContinueNumbering means continue. A restart must say "false".

The numbering style

The style is a typed property, not an attribute: <Properties><PageNumberStyle type="enumeration">LowerRoman</PageNumberStyle></Properties>. It is a property because its value can be either one of the built-in styles or a reference to a custom numbering list. The common built-in values are:

PageNumberStyleNumbers as
Arabic1, 2, 3
UpperRomanI, II, III
LowerRomani, ii, iii
UpperLettersA, B, C
LowerLettersa, b, c

A PageNumberStyle attribute on Section appears only in generated files; InDesign writes the property.

How pages, markers and chapters use it

  • The page's label. Every Page carries a Name, the label InDesign shows for it, with the section's style applied. In the example the two pages are named ii and 1.
  • Page-number markers. <?ACE 18?> inside a story's Content prints the current page's number, or with PageNumberType="NextPageNumber" or "PreviousPageNumber" on its range, the number of the page the story continues on or came from. All of them use the numbering of the page they refer to. See text variables for the full marker table.
  • The section marker. <?ACE 19?> prints the Marker of the section the page belongs to.
  • The chapter number is not part of a section. It is the document's own ChapterNumber, set in ChapterNumberPreference in Resources/Preferences.xml, and the ChapterNumberType text variable prints it.

In Paged: sections are read in both spellings of the numbering style; Arabic, Roman and letter styles are applied, and any other style falls back to Arabic. A page's label comes from its Name; only a page without one is numbered from the sections, and the build reports when that happens. Scripts can add, edit and remove sections, which re-labels the pages, and saving writes InDesign's spelling.

Supported · verified

Frequently asked questions

Where is page numbering defined in IDML? In Section elements in designmap.xml. Each section starts at a page, covers Length pages, and either continues the count or restarts at PageNumberStart.

How is the numbering style written? As a typed property: <Properties><PageNumberStyle type="enumeration">LowerRoman</PageNumberStyle></Properties>. The value can also name a custom numbering list, which is why it is not an attribute.

Why does my section restart not take effect? Check the attribute order: InDesign applies PageNumberStart only when ContinueNumbering="false" comes before it. An absent ContinueNumbering means the numbering continues.

What does <?ACE 19?> print? The Marker text of the section the page belongs to. The page number itself is <?ACE 18?>.

Is the chapter number a section setting? No. It belongs to the document, in ChapterNumberPreference, and defaults to 1.

On this page