Ask Your Question

TOC - no chapters/page numbering

asked 2020-05-04 23:23:13 +0200

mcdon47 gravatar image

updated 2020-05-09 18:17:06 +0200

I’m writing a book and I already have 90 subdocuments (on average 3 to 4 pages each document) with styles assigned by using the template for all 90 chapters.

The chapter is in the header (Heading 1) and the page number in the footer.

Once Master document was created and sub-documents inserted, inserting ‘Table of Contents/index>Table of Contents, Index or Bibliography>okay, the TOC only show ‘Table of Contents against a grey box but no chapters nor their corresponding page numbers.

When I checked the subdocuments, I was surprised to see the size of the font for the page Header as ‘130%’. I originally assigned 28 pt to the font in 'Heading 1' so I do not know what changed or if that is the reason why TOC didn’t work?

I’ve searched through LibreOffice Writer Guide and I am unable to find where I went wrong.

LO 6.5.2 x64 Home Windows 10

C:\fakepath\Lectionary MASTER DOCUMENT (green).odm

C:\fakepath\Lectionary FRONT MATTER (green).odt

C:\fakepath\01 1st Sunday of Advent B.odt

C:\fakepath\02 2nd Sunday of Advent B.odt

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-05-05 08:52:36 +0200

ajlittoz gravatar image

updated 2020-05-09 20:37:36 +0200

Remark: as of the date of writing, 6.5.2 does not exist. Do you mean

There are some subtleties with master and sub-documents.

Formatting occurs in the master document. The master imports the text from the sub-documents and uses its style definitions to lay out the paragraphs in the page(s). Only if the style does not exist in the master will the style definition be imported from the sub-doc. This means that master styles with same name override those in the sub-doc.

Unless you changed explicitly the font size in the sub-docs, all (master+subs) should have the same font size because you claim all are based on the same template. When you have a template, you don't fancy yourself to add patches in some documents, which would ruin the interest of template.

Don't worry about the 120% size instead of 28pt. %-sizes are just another way of specifying them. It guarantees to keep the same general relative ratios when you change a key style. All Heading n styles are relative to Heading style. When you changed the font style in the latter, all sizes in Heading n adjust accordingly.

Now to the main issue.

If you did not make vocabulary mistake, you tell us that you put your chapter heading (title) in the header, likely in the intention of repeating it on every page. This heading was styled Heading 1 as usual and I supposed you got the numbering too (1 because there is only one chapter per sub-document).

The header is an attribute of the page style.

As I explained above, the master uses its own styles when formatting the global document. Consequently, it does not reference the sub-document page style and does not import the header. You end up with no Heading 1 in your master and the TOC engine rightfully reports an empty table.

How to fix it?

It is very unusual to put the Heading 1 paragraph in the header. First reason, what will be its page number? It is duplicated on every page. Then it has multiple pages associated with it. The header is internally managed in a special way, it then probable that Writer will give it a single page number (first, last, other?) but this is not what you want to control.

Put your Heading 1 where it belongs, i.e. in the text area, not in header, not footer. This will fix the TOC issue.

If you want to repeat the chapter heading in the header, use field insertion.

In the master, modify the header to contain only Insert>Field>More Fields. Go to Document tab. In Type select Chapter and in Format Chapter name or Chapter number and name.

EDIT 2020-05-09

Your problem is quite simple. You have not understood the basic principle behind the styles concept.

Styles (whether paragraph or character) are used to mark up the structure of your text in semantic terms: some paragraphs are headings, others ... (more)

edit flag offensive delete link more



Good answer. Supplemental background ; the one thing which makes the "heading in header" strategy a bad idea:

In Writer, header is tied to page style. With the OP strategy, you need one page style for each chapter.

This is different from what you may be used to from MS Word. Word does not have any concept of page style. Page formatting/layout (including header) is linked to a sequence of pages until you decide to "break the chain". This makes it slightly easier to change page formatting midway (or "mid-document"), and also makes your "heading in header" strategy workable. Maintaining consistent appearance will be harder in Word if you have a document where you go back and forth between different page layouts.

When you get used to it, and if you create several large documents, you will learn to appreciate Writer's enforcement of a rigid document structure.

keme gravatar imagekeme ( 2020-05-05 11:55:19 +0200 )edit

Thank you for your comments.

First of all, you are correct: LO version is

I understand I need to put Heading 1 in the text area. The problem is I’m writing a church book and the normal custom is to put the chapter heading at the very top – the Header.

I have tried to modify the header in the master: Insert>Field>More fields…. as you suggested. This did not work. But may I ask: how to modify the master since the Sidebar doesn’t exist in master document?

To clarify: three main bodies in my book (front matter, body, and back matter)

• one column preface (12 pages including front cover, title page, introduction... and TOC) using Roman numerals i to xii;

• main body: two column starting on page 13 but I noticed in the master document it shows ‘13’ (Arabic) and not ‘1’ as I wanted ...(more)

mcdon47 gravatar imagemcdon47 ( 2020-05-06 00:00:37 +0200 )edit

Since you are able to change from Roman to Arabic page numbers, you are using page styles. Edit the page break before the main body to force page numbering to restart at one.

The "sidebar" exists also in the master (same F11 command to display it) but it has 2 modes: the traditional one and the structure for the master. You toggle between both with a click on the first icon in the pane toolbar.

With Heading 1 in the text area, is your TOC as expected? This is the first step before getting the header correct.

ajlittoz gravatar imageajlittoz ( 2020-05-06 08:09:42 +0200 )edit

Thank you for the comments.

I'm pleased to say I've been able to sort out the page number and the Arabic number now starts as '1' on the thirteen page. And you are correct that TOC does work well when I insert it in the text area.

So.... I still want to try 'Header 1' in the Header but since as you say it's not recommended, I'm wondering if I just dispense the Header altogether and instead add a frame (one column) at the top and use it as 'Header 1' and below it add another frame (two columns for the main text body). Would that work?

mcdon47 gravatar imagemcdon47 ( 2020-05-07 18:12:53 +0200 )edit

No. The solution is very simple. Erase everything in your header (to start with, you can add decorations later when you're familiar with the concept).

Put the cursor in the header. Insert>Field>More Fields. Go toà the Document tab. In Type, select Chapter. In Format select Chapter name. Insert, then Close.

This puts the content of the Heading 1 in effect at the top of the page. This remark is very important. In your case, you must put your Heading 1 as the first paragraph of your chapter, otherwise it will take effect only on next page. If you change Heading 1 mid-page, the one known at the top is used; the new one on next page.

Finally, if you don't want both the chapter title in the header and as the first paragraph of the chapter (non aesthetic duplication), modify Heading 1 to give ...(more)

ajlittoz gravatar imageajlittoz ( 2020-05-07 18:27:03 +0200 )edit

PS: I tried Insert>Field>More Fields as you suggested but it didn't work. I only get 'Table of Contents' and nothing else.

mcdon47 gravatar imagemcdon47 ( 2020-05-07 19:14:14 +0200 )edit

Ah... I didn't see the last comment you recently replied. I will try it... thanks again.

mcdon47 gravatar imagemcdon47 ( 2020-05-07 19:15:18 +0200 )edit

When I did as you suggested, I get the correct title for the first chapter but then the same title appears for all the following chapters!

mcdon47 gravatar imagemcdon47 ( 2020-05-07 23:15:05 +0200 )edit

Also when I tried to insert TOC, 'Table of Contents' is greyed out.

mcdon47 gravatar imagemcdon47 ( 2020-05-07 23:16:38 +0200 )edit

Warning! The Insert>Field>More Fields opens in the Cross-references tab. If you select a heading here, you get this specific one. You must activate the Document tab to get a "tracking" chapter name.

TOC: which command do you use?

ajlittoz gravatar imageajlittoz ( 2020-05-08 07:51:27 +0200 )edit

Thanks. I am clearly in the wrong place?

Within the Master document, at the end of ‘preface’ in the text area I clicked Insert>Table of Contents…. The dialog box shows several tabs: type; entries; styles; columns; background.

I see nothing there for me to ‘activate the document’ as you suggested.

mcdon47 gravatar imagemcdon47 ( 2020-05-08 17:12:49 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-04 23:23:13 +0200

Seen: 66 times

Last updated: May 09