Table of Contents with different depths


I’ve checked the wiki and this questions page but I couldn’t find an answer to my question. My problem is that I have a large writer document with a lot of sections and subsections. The document also has two annex. In the Table of Contents, I’d like to show the full depth (e.g. for all the main chapters in the document, but only up to depth 2 (e.g. up to A.3) for the annexes. Is that possible?

If it matters, I have defined the Annex headings with a specific list style.


The Insert Index/Table box (menu Insert | Indexes and tables | Indexes and tables), has four tabs or pages. The first one, Index/Table, has a section titled Create index/table with the options For, where you select either the whole document or a chapter, and Evaluate up to level followed by a number box.

Click on the image to open a full-resolution version.

The TOC is created with 10 levels of headings, or the number of levels used in the document, whichever is smaller. To change the default setting, just enter the desired number in the box.

Since you have already created specific heading and subheading styles for the Annexes, from the same Insert Index/Table box, check the option Additional styles under the Create from section.

Next, click on the button with the ellipsis or three dots () to open the Assign styles dialog box.

For simplicity, let’s suppose that your Annex heading styles are named anx1, anx2, anx3, and so on, but you want only the first two to appear on the TOC.

Then you select anx1 and click on the double-arrow button to the right (">>") once (at the bottom of the dialog box), and then select anx2 and click on the double-arrow button twice.

Accept and your TOC will list, in addition to the regular scheme, headings of type anx1 and anx2 correctly.

You can find further information on customizing the tables of contents, bibliographies and other indices in Chapter 12 of the Writer Guide.

Thanks a lot! That works :slight_smile: Just a minor comment, I had to set the outline level of my custom annex styles to “body text” so that they weren’t added twice in the TOC.

The picture of the Style assignment dialogue does not match the one in LO This ends up being useless.