LibreOffice Writer: Headings, Auto TOC and PDF Bookmarks
Tag your headings once and LibreOffice Writer builds the table of contents, the page numbers and the PDF bookmarks for you.
Forty pages of thesis, a deadline on Friday and a table of contents you typed by hand. Then your supervisor asks for one more chapter, every page number shifts, and the manual list is wrong in eleven places. Sound familiar? LibreOffice Writer can do all of that bookkeeping for you, as long as you give it one thing: headings that are real headings. Bold text in a bigger font doesn't count.
This guide walks through the full chain in LibreOffice 26.8: paragraph styles for your headings, a table of contents that rebuilds itself, page numbers in the footer and a PDF export where every chapter shows up as a clickable bookmark. The steps also work in the 26.2 and 25.x releases.
Step 1: Turn your headings into Heading 1, 2 and 3
Writer only recognizes a line as a chapter title when it carries a heading paragraph style. Manual formatting looks the same on screen, but the program can't see it. So the first job is to tag every title properly.
- Click anywhere inside a chapter title. You don't need to select the text.
- Press Ctrl+1 for Heading 1. Use Ctrl+2 for sections and Ctrl+3 for subsections.
- Press Ctrl+0 on normal paragraphs to apply Body Text.
Prefer the mouse? Right-click the paragraph and choose Paragraph > Heading 1 (or 2, 3) from the context menu. You can also pick a style from the Styles menu or from the Set Paragraph Style box on the left of the Formatting toolbar.
Want your headings to look different? Don't format them one by one. Open the Styles deck with F11, right-click Heading 1 and choose Edit Style. Change the font, size or spacing once and every Heading 1 in the document follows.
The one rule that matters: from now on, all formatting decisions for titles go into the style. Bold plus 16 pt typed by hand gives you a line that the table of contents simply ignores.
Step 2: Insert the automatic table of contents
With your headings tagged, the table of contents takes about ten seconds.
- Click where the table of contents should go, usually on a blank page after the title page.
- Choose Insert > Table of Contents and Index > Table of Contents, Index or Bibliography.
- On the Type tab, make sure Type says Table of Contents.
- Under Create From, keep Headings ticked. Include up to level controls how deep the list goes: 3 is a good value if you only use Heading 1 to 3.
- Change the Title if you want, for example to "Contents", and click OK.
The Type tab: Table of Contents as the type, Headings as the source.
Writer generates the entries as hyperlinks, so Ctrl+click on a line jumps straight to that chapter. The gray background you see behind the list is just a screen marker for fields and won't be printed or exported.
Keep it fresh: the table doesn't update itself while you type. After edits, right-click inside it and choose Update Index, or go to Tools > Update > All Indexes and Tables to refresh everything at once. Make that the last click before any export.
If something looks off: a missing chapter almost always means its title is not in a heading style. Click the title, check the style name in the toolbar box, fix it and update. Empty heading paragraphs are skipped on purpose. And if you work with Edit > Track Changes > Show enabled, turn it off before updating, or deleted headings may sneak into the list with wrong page numbers.
Step 3: Add page numbers in the footer
A table of contents without page numbers on the pages is half a feature. Writer has a small wizard that adds the footer and the number field in one go.
- Choose Insert > Page Number.
- Set Position to Bottom of page (Footer) and Alignment to Center, Left or Right.
- Tick Include page total if you want "Page 3 of 40" style numbering.
- Pick the numbering scheme under Page numbers, for example 1, 2, 3 or i, ii, iii, and click OK.
The Page Number Wizard puts the field into the footer of the current page style.
The wizard works on the current page style. That matters if your title page uses a different style, such as First Page: click into a normal body page before you run it. To show the field in a single spot instead, Insert > Field > Page Number drops it at the cursor position. If you ever see the words "Page number" instead of a digit, press Ctrl+F9 to switch field names off again.
Need the count to start at 1 on the first real chapter? Click into that chapter's first paragraph, open Format > Paragraph, go to the Text Flow tab, enable Insert under Breaks, tick With Page Style and set the new page number.
Step 4: Export a PDF with clickable bookmarks
Here is where the heading styles pay off a second time. Writer can turn them into the PDF outline, the sidebar of bookmarks that readers use to jump between chapters.
- Refresh the table of contents (right-click it, Update Index).
- Choose File > Export As > Export as PDF. The PDF Options dialog opens on the General tab.
- Under Structure, make sure Export outlines is ticked.
- Leave Tagged PDF (add document structure) on if accessibility matters to you, for example for university submissions.
- Click Export, pick a file name and save.
Export outlines turns every heading into a PDF bookmark.
Older LibreOffice versions (7.0 and earlier) called this option "bookmarks", so don't be confused by old forum advice. Writer exports every paragraph with an outline level from 1 to 10. The style name doesn't count, only the outline level. That is why a paragraph in the Title style usually stays out of the bookmarks: its outline level is None. You can check or change the level of any style under Format > Paragraph > Outline & Numbering.
The quick Export Directly as PDF toolbar button skips the dialog and reuses your last settings. Run the full dialog once to set things up, then the button is fine for later drafts.
Bonus: move whole chapters around
Once your headings are real headings, the Navigator becomes your outline view. Press F5, expand Headings, and drag a chapter to a new position. Its text moves with it. Update the table of contents afterwards and the order and page numbers are right again.
Our verdict
Anyone who writes long documents in LibreOffice Writer benefits from this: students, people writing manuals, self-publishers and anyone who's ever renumbered a contents list by hand. The whole system stands or falls with heading styles, so that's your task for today: open your current document, put the cursor into each title and press Ctrl+1, Ctrl+2 or Ctrl+3. Everything else in this guide takes only a few minutes after that.


