Bookmarks
Configure heading numbers and separators in PDF bookmarks.
Bookmarks controls heading numbers and separators in PDF bookmarks. Add a Bookmarks element directly inside the Document when you need to change the defaults. Its settings apply to all bookmarks, independently of page headings, tables of contents, and running heads.
Fields
numbersType booleanInclude heading numbers added by Numbering. Defaults to true. Set to false to omit those numbers and their separators. Digits in heading text and Counter values are preserved.separatorType stringText between each generated number and the heading title. Defaults to a space (" "). Use an empty string to join them without a separator.Example
Separate heading numbers from bookmark titles with a period and a space.
<template data-type="document" data-title="Student handbook" data-lang="en">
<template data-type="numbering"></template>
<template data-type="bookmarks" data-separator=". "></template>
<template data-type="layout" data-id="page" data-width="793.71px" data-height="1122.52px">
<template data-type="flow">
<h1>Admissions</h1>
<h2>Entry requirements</h2>
<p>Who can apply, and when.</p>
</template>
</template>
</template>Usage
Place at most one <Bookmarks> directly inside <Document>. Omit it to use the default numbers and spacing. Invalid placement or duplicate elements return INVALID_BOOKMARKS.
For heading selection, custom titles, and viewing bookmarks, see the Bookmarks guide.
For a heading numbered 3 with the title "Fees":
| Setting | Bookmark |
|---|---|
| Default | 3 Fees |
separator=". " | 3. Fees |
separator=" – " | 3 – Fees |
separator="" | 3Fees |
numbers={false} | Fees |
Remove heading numbers
Set numbers to false to omit numbers added by <Numbering> and their separators. This applies to numbers inserted before or after the title. Digits in heading text and <Counter> values are preserved.
Numbers hidden with CSS remain in bookmarks unless numbers is false.
Change the separator
The separator replaces each gap added by <Numbering>, preserving the number's position. For a number inserted after the title, separator=". " produces "Fees. 3".
Number formats are preserved. If a rule uses format="{h1}.", adding separator=". " produces "3.. Fees".
The separator has no effect when a heading has no inserted number or numbers is false.