[Solved] Preface heading does not appear in Table of Contents

I didn’t want my Preface page to appear with the words “Chapter 1” in the Table of Contents and the footer. So I did these steps:

  1. F11 to open the Styles editor
  2. Right-click on “Heading 1” then click “New”
  3. On the Organizer tab, give it a name such as “Preface”
  4. In “Next style” select “Text Body”
  5. Leave “Inherit from” set at “Heading 1”
  6. On the “Outline & List” tab, for “Outline level” select “Level 1” and click Apply
  7. Go to the heading of your preface, click it, then click “Preface” in the Styles editor to apply as the new style
  8. Right-click Table of Contents and “Update index”

(process description edited by ajlittoz for better readability)

After updating the TOC index, the words “Preface” no longer appear in the Table of Contents.
How can I get Preface to appear in the TOC?

LibreOffice 7.2.2.2 (x64); Windows 10

Edit:

Thank you to keme1 for the suggestions. I wasn’t sure what your last italicized paragraph meant. I guess you meant the following, because that is what worked:

  1. F11, go to Styles > Paragraph Styles
  2. Right-click “Preface” style and modify
  3. Outline & List tab: Change Outline level from “Text Body” to “Level 1”
  4. OK
    Preface now appears in the Table of Contents after updating the index.

With the default settings, the content of your Preface styled paragraph should appear in the ToC together with Heading 1 styled paragraphs (and also with other content set to outline level 1).

Right click in your ToC to edit it. In the first tab, check

  • that ToC is set to be created for entire document (not Chapter only)
  • that you have ticked to create ToC from outline.

If you want ToC created from specified styles instead of outline levels, you need to raise the ToC level of your Preface style. Click the button to the right of those tick boxes to edit levels manually.

Then that is Ajlittoz’ solution, not mine. The part I put in italic is about a different (and more specialized) ToC solution, which I generally would not recommend unless you inherit a document from someone else or from a different platform (or of course if you have “special requirements” to create an out-of-the-ordinary ToC).

From step 6 in your originally posted procedure, I assumed that you had already done that.

[...]
6. On the "Outline & List" tab, for "Outline level" select "Level 1" and click Apply
[...]

@keme1: the “outline” property is not reserved to Heading n family (which would eventually be forwarded to derived styles) but results from the Outline level in the Outline & List tab. Thus, your recipe won’t work unless the derived style is effectively attached to some outline level. The outline level was reset to Text Body in older releases to avoid cluttering the TOC but I’m no longer sure for 7.2.5.2.0+ because the outline level appears to be randomly kept (not able to determine in which context it is kept).

@keme1

From step 6 in your originally posted procedure, I assumed that you had already done that.

I must have missed that step in my own directions. Because when I went back in there to that setting, it was not set to Level 1.

If you want ToC created from specified styles instead of outline levels, you need to raise the ToC level of your Preface style. Click the button to the right of those tick boxes to edit levels manually.

Could you please explain this further, with step by step instructions? I can’t seem to find a button to the right of the check-mark (tick) boxes.

Thanks also @ajlittoz for your replies.

I know. I thought that this assignment was already performed. Cf. #6 in the original posting, and my other comment regarding this.

Also, based on the OP response, your answer is the correct one, not mine. That is also part of my other comment.

Just to put confusion where it belongs…

When you create a derived style as you did (right-click on name + New), you don’t inherit the outline level (from Outline & List tab, formerly Outline & Numbering).

You have to restore the outline level manually to Level 1 for the so-styled paragraphs to be collected in the TOC

But you have a much simpler way since there are generally only one (or very few) unnumbered headings in a book. Put your cursor at the very beginning of your heading and press Backspace. This removes the numbering in this paragraph only.

It is direct-formatting but it is acceptable because you do it only once in a very specific context.

1 Like