How to Create an Automatic Table of Contents in LibreOffice Writer

Autor: Redaktor Kategorie: Free Software office, LibreOffice USA

Your document already contains several dozen pages, the chapters are complete, and only a few final revisions remain. However, adding just one longer paragraph can change the numbering of subsequent pages. If you created the table of contents manually, you will need to check every entry again.

Fortunately, LibreOffice Writer can do this work for you.

An automatic table of contents in LibreOffice Writer uses the document structure, recognizes headings, and assigns the corresponding page numbers. You can also customize its appearance, specify the number of levels, and add clickable links to chapters.

In this guide, I will show you how to prepare a document, generate a table of contents, and update it after making changes.

What Is an Automatic Table of Contents?

An automatic table of contents is a list of chapters and subchapters generated from the document structure.

Writer retrieves heading titles and their corresponding page numbers. This means you do not have to manually enter titles or check their locations.

An automatic table of contents is particularly useful when creating:

  • Academic theses.
  • Technical documentation.
  • User manuals.
  • Business reports.
  • E-books.
  • Training materials.
  • Comprehensive guides.

The greatest advantage of this feature is the ability to regenerate the table of contents after changing the document’s content.

How to Prepare a Document for Creating a Table of Contents

Before inserting a table of contents, you need to properly identify your chapter titles.

Simply making text bold or increasing its font size is not enough. Writer may not recognize such text as a heading.

Therefore, you should use paragraph styles.

The most important ones include:

  • Heading 1 for main chapters.
  • Heading 2 for subchapters.
  • Heading 3 for the next level of subdivision.
  • Heading 4 for more detailed sections.

Each of these styles corresponds to a specific level in the document structure.

This allows the program to recognize relationships between chapters and display them appropriately in the table of contents.

How to Apply Heading Styles in LibreOffice Writer

First, locate the title of the first chapter.

Then follow these steps:

  1. Place the cursor in the paragraph containing the title.
  2. Locate the paragraph style list on the toolbar.
  3. Select the Heading 1 style.
  4. Move to the next main chapter.
  5. Apply the same style.
  6. Assign the Heading 2 style to subchapters.
  7. Assign the Heading 3 style to more detailed sections.

You can also use keyboard shortcuts.

Ctrl + 1 applies the Heading 1 style.

Ctrl + 2 applies the Heading 2 style.

Ctrl + 3 applies the Heading 3 style.

If you do not like the default heading font or color, modify its style. You do not have to abandon the document structure simply because you are not satisfied with its appearance.

How to Create an Automatic Table of Contents in LibreOffice Writer

After applying heading styles, you can generate the table of contents.

Follow these steps:

  1. Place the cursor where you want the table of contents to appear.
  2. From the top menu, select Insert.
  3. Open the Table of Contents and Index submenu.
  4. Select Table of Contents, Index or Bibliography.
  5. Open the Type tab.
  6. From the list of types, select Table of Contents.
  7. Set the title and the number of levels to include.
  8. Click OK.

Writer will analyze the document structure and generate a table of contents.

It will display chapter titles, subchapter titles, and their corresponding page numbers.

Importantly, you do not have to wait until you finish writing. You can create a table of contents at the beginning of your work and update it as the document grows.

What Does an Example Automatic Table of Contents Look Like?

Suppose you are preparing a guide to using LibreOffice Writer.

The main chapters use the Heading 1 style, while subchapters use the Heading 2 style.

An example table of contents might look like this:

Table of Contents

  1. Introduction ………………………………. 3
  2. Getting Started ………………………….. 52.1. Installing the Program ……………. 62.2. User Interface ……………………… 8
  3. Document Formatting ………………….. 123.1. Paragraph Styles …………………. 133.2. Text Formatting …………………… 16
  4. Saving Documents ……………………… 20
  5. Summary ………………………………… 25

In this example, Writer recognizes two heading levels.

Chapter numbers can come from automatic heading numbering, while page numbers are based on the current placement of content.

How to Set the Number of Table of Contents Levels

Not every document requires a detailed table of contents that includes all subchapters.

If you are preparing a short report, one level may be sufficient. However, for an academic thesis, you may need two or three levels.

To change this setting:

  1. Right-click the table of contents.
  2. Select Edit Index or the appropriate table of contents editing command.
  3. Open the Type tab.
  4. Locate the setting that specifies the maximum heading level.
  5. Enter the appropriate value.
  6. Confirm the changes.

Setting one level will display the main chapters.

Two levels will also include subchapters. Three levels will display a more detailed structure.

It is worth adjusting the number of levels to the length and purpose of the document. An overly detailed table of contents can make it difficult to quickly locate the most important information.

How to Add Automatic Chapter Numbering

If you want numbering in the format 1, 1.1, 1.2, and 2, you do not have to enter the numbers manually.

Writer provides a heading numbering feature.

To use it:

  1. Open Tools → Heading Numbering.
  2. Open the Numbering tab.
  3. Select the first level.
  4. Check that the Heading 1 style is assigned.
  5. Select the numbering format.
  6. Configure the subsequent levels.
  7. Confirm the settings.

For the second level, configure the numbering to also display the parent level number to obtain a format such as 1.1.

When you are finished, update the table of contents.

This allows chapter numbering to change along with the document structure.

In older versions of LibreOffice, this feature may be called Chapter Numbering.

How to Update an Automatic Table of Contents

While writing a document, you may add new chapters, remove subchapters, or change their titles.

As a result, the previously generated table of contents may no longer match the current content.

To refresh it:

  1. Right-click the table of contents.
  2. Select Update Index or Update Table of Contents, depending on your version of the program.
  3. Check the displayed entries and page numbers.

Writer will analyze the document structure again.

New chapters will appear in the list, deleted entries will disappear, and page numbers will be recalculated.

If the document contains multiple tables of contents and indexes, you can also use Tools → Update and select the option to update all indexes and tables.

Remember that automatic generation of a table of contents does not necessarily mean it will refresh immediately after every change to the text.

How to Customize the Appearance of a Table of Contents

The default appearance does not always meet the requirements of a university, company, or publisher.

Fortunately, you can customize the formatting of individual levels.

First, right-click the table of contents and select the editing command.

Then open the Styles tab.

Writer allows you to assign paragraph styles to individual table of contents levels.

You can also open the Styles panel by pressing F11 and modify the appropriate table of contents styles.

This allows you to customize:

  • Font family and size.
  • Text color.
  • Indentation of individual levels.
  • Spacing between entries.
  • Paragraph alignment.
  • Line spacing.

For example, main chapters can use bold text, while subchapters can use a smaller font size and additional indentation.

Modifying styles is more convenient than manually formatting each entry. It also allows you to preserve your settings when updating the table of contents.

How to Change the Dots Between a Title and Its Page Number

The familiar dots extending from a chapter title to its page number serve as tab leader characters.

You can change their appearance or remove them entirely.

First, open the table of contents settings.

Then go to the Entries tab.

Select the level you want to modify and locate the tab stop element marked with the letter T in the entry structure.

After selecting it, you can choose the fill character and tab stop position.

If you want to keep page numbers aligned with the right margin, enable right alignment for the tab stop.

This means you do not have to manually enter dots or align page numbers using spaces.

How to Create a Clickable Table of Contents

A clickable table of contents allows readers to jump directly to a selected chapter.

This is particularly useful when reading electronic documents.

In many cases, Writer creates hyperlinks in an automatic table of contents by default.

To test them, hold down the Ctrl key and click a chapter title.

If hyperlinks are missing, open the table of contents settings and go to the Entries tab.

In the entry structure, you can use elements that specify the beginning and end of a hyperlink. Place them before and after the entry text to turn the chapter title into a clickable link.

Then apply the appropriate settings to the remaining levels.

This means readers do not have to scroll through dozens of pages to find the section they are interested in.

How to Add Custom Styles to a Table of Contents

Standard heading styles are not the only way to create a document structure.

You can also create your own paragraph styles and include them in the table of contents.

For example, in a technical manual, you can create a style named Manual Chapter.

To include it in the table of contents, open the table of contents settings and go to the Type tab.

Then enable the additional styles option and open the style assignment window.

Select your custom paragraph style and specify the level at which it should appear in the table of contents.

After confirming the settings, update the document.

This solution is particularly useful when working with corporate templates or custom formatting.

How to Create a Table of Contents on a Separate Page

In academic theses, books, and reports, the table of contents often occupies a separate page.

To properly separate the content, use a page break.

You can insert one using the following shortcut:

Ctrl + Enter

If the document contains a title page, place the cursor after its content and insert a page break.

Then generate the table of contents on the new page.

Before starting the first chapter, insert another page break if required by the document layout.

Do not create empty space by repeatedly pressing the Enter key. Such a layout may change when additional text is inserted.

A page break provides greater control over the placement of content.

How to Check the Document Structure in Navigator

Before creating a table of contents, it is worth checking whether all headings have been properly identified.

You can use Navigator for this purpose.

Press F5, then expand the Headings category.

Writer will display the document structure.

If a chapter is missing, check its assigned paragraph style.

Navigator also helps you move between chapters and manage the hierarchy of subchapters.

This is particularly convenient when working with documents containing many pages.

Why Does the Table of Contents Have a Gray Background?

After generating a table of contents, you may notice a gray highlight.

This does not mean the document has been formatted incorrectly.

Writer uses shading to distinguish automatically generated document elements.

You can toggle its visibility using Ctrl + F8 or the appropriate command in the View menu.

The default shading visible during editing is not a printed background color.

However, if you manually set a background color in the table of contents options, it becomes part of its actual formatting.

Why Can’t I Manually Edit the Table of Contents?

An automatic table of contents may be protected against manual changes by default.

This is an intentional safeguard that helps prevent accidental deletion of entries or changes to page numbers.

If you really need to disable this protection, open the table of contents settings and go to the Type tab.

Then uncheck the option that protects the table of contents against manual changes.

However, remember that manual corrections may be lost during the next update.

Therefore, instead of changing a title directly in the table of contents, correct the heading title in the document and regenerate the list.

Why Doesn’t a Chapter Appear in the Table of Contents?

A missing chapter is one of the most common problems when using this feature.

First, check whether the title has the appropriate heading style assigned.

If you only applied bold formatting and increased the font size, Writer may treat it as ordinary text.

Next, check the maximum level included in the table of contents.

For example, a third-level heading will not appear if the table of contents includes only two levels.

Finally, update the table of contents.

If you use custom styles, also make sure they have been correctly assigned to the appropriate levels.

Why Does the Table of Contents Include Unwanted Text?

Sometimes entire paragraphs, captions, or sections of ordinary text appear in the table of contents.

This usually means that a heading style or a corresponding outline level was accidentally assigned to them.

To resolve the problem, locate the unwanted text in the document.

Then change its style to Body Text or another appropriate paragraph style.

If you use additional table of contents styles, also check their assignments.

After correcting the document, update the table of contents.

The unwanted entries should disappear.

How to Remove an Automatic Table of Contents

If you no longer need the table of contents or want to recreate it, you can remove the entire generated element.

Right-click the table of contents.

Then select the command to delete the index or table of contents.

Writer will remove the generated list but leave the chapters and subchapters in the document.

You will not lose their assigned heading styles either.

This allows you to generate a new table of contents at any time.

Does an Automatic Table of Contents Work in PDF?

Yes. After exporting a document to PDF, the table of contents remains visible.

It is also possible to preserve clickable hyperlinks leading to individual chapters.

Before saving the file, follow these steps:

  1. Update the table of contents.
  2. Check the page numbers.
  3. Test the hyperlinks in the document.
  4. Select File → Export As → Export as PDF.
  5. Check the export settings.
  6. Save and open the finished file.

In the export options, you can also enable document outline export to create bookmarks that make navigation easier in a PDF reader.

However, remember that after exporting, the table of contents will not be recalculated by the PDF reader. If you modify the source document, you must update it and export it again.

Will the Table of Contents Be Preserved in a DOCX File?

LibreOffice Writer allows you to save documents in DOCX format.

An automatic table of contents can be preserved, but differences in formatting and updating may occur between word processors.

Therefore, after saving the document, it is worth reopening it and checking the appearance of the table of contents.

If the recipient uses Microsoft Word, it is best to test the file in that application as well.

For continued work in LibreOffice, it is worth keeping the original version of the document in ODT format.

Most Common Mistakes When Creating a Table of Contents

The biggest mistake is manually entering chapter titles, dots, and page numbers. Such a table of contents requires constant corrections.

Another problem is using bold formatting instead of proper heading styles.

It is also important to avoid skipping structural levels. If a main chapter uses Heading 1, its immediate subchapter should generally use the Heading 2 style.

Do not forget to update the table of contents before printing the document or saving it as a PDF.

Finally, do not manually correct page numbers in a generated table of contents. Let the program recalculate their values.

Following these guidelines will help you avoid most problems related to document structure.

Frequently Asked Questions

Do I Have to Finish Writing the Entire Document First?

No. You can create a table of contents at the beginning of your work and update it after adding more chapters.

Can I Create a Table of Contents Without Chapter Numbering?

Yes. Heading numbering is not mandatory. Writer can display only chapter titles and page numbers.

Can I Create Multiple Tables of Contents in a Single Document?

Yes. You can create a table of contents for the entire document or limit it to the current chapter using the appropriate settings.

Does the Table of Contents Update After Changing a Chapter Title?

After changing a heading title, refresh the table of contents. Writer will retrieve the new title from the document.

Does the Table of Contents Have to Be at the Beginning of the Document?

No. You can place it anywhere, although it is most commonly located between the title page and the first chapter.

An automatic table of contents in LibreOffice Writer helps organize lengthy documents and significantly reduces the number of manual corrections.

It is based on the Heading 1 and Heading 2 styles, along with subsequent levels of the document structure.

After applying these styles, simply use Insert → Table of Contents and Index → Table of Contents, Index or Bibliography.

You can then customize the appearance of the list, the number of levels, chapter numbering, and clickable hyperlinks.

Remember to update the table of contents before printing or exporting the document.

Whether you are preparing an academic thesis, book, report, or user manual, an automatic table of contents will help you keep your document organized and make it easier for readers to find the information they need.

Poznaj LibreOffice

LibreOffice to szybki, darmowy i otwarty pakiet biurowy dla domu, firm i instytucji.

Autor

Redaktor

Zobacz wpisy autora