Wrong page numbers in table of contents

For weeks I am struggling with what should be 3 one click operations

1.The table of contents gives the wrong page numbers, The page numbers in the list of contents are not a little off, they are around 25 pages too high!
2.Then the alphabetical index puts in Enters that throws the pages off again.
3. The pdf makes the pictures slide over the footnotes, and every time I save the document the pictures slide . So when I put in all page numbers by hand , they are all wrong again.

I have looked up what it could be, and erased the direct formatting. There are no hyperlinks. All quotes are cleared of all macro’s through a text document first. All images are copied into paint first.
Unfortunately, the problem still persists in the 7.5.2. version of Libre Office. I was using 7.4 when it started.

I will now check if the length of the document is the problem. It is 888 pages. So I will see if cutting it up into small parts helps, and if I can identify when the problem shows up.

I will be eternally grateful to anyone who can help!

I’ll be immediately grateful if you help me to help you by editing (= modifying, not using an additional comment) your question to mention OS name, LO version and save format.

TOC page numbers: have you fiddled with the page numbers in your text? Like trying to offset them. Is your TOC automatically generated thanks to using Heading n styles for chapter headings?

Alphabetical Index: what do you mean?

PDF: are you exporting your document to PDF? How have you inserted your pictures? Did you try to cope with text/picture interaction by adding empty paragraphs? Is your page number created by the Page Number field or did you number your pages manually?

888 pages is not a problem nowadays.


**PS:** Your concern is a Writer problem not a database one. So please change tag base to writer.
1 Like

Thank you ajlittoz!

I edited in the Libreoffice Writer version I am using, 7.5, the last update. It started with 7.4, and I corrected the tag.

I didn’t fiddle at all with the page numbers in the text. The first 3 pages are given the correct number in the list of contents. Then, what should be page 20 is given page number 45, and the 25 surplus page deviation continues until the end of the document.

The table of contents is at the beginning and shows all the headings. The alphabetical index is at the end and shows all the words that I inserted in it.

The pictures are put in with a paste action. Will inserting them make them more stable? I’ll try that now and tell you how it worked out! Thanks again!

Check the first paragraph of page 20, the page where the numbering gets wrong. Put the cursor in the first paragraph. Select Format - Paragraph, then the Text flow tab, there is probably a check mark in Page number below Insert with number 45. If so, remove the check mark, click OK to confirm and you will be fine. If there’s no check mark there, please upload the document or part of it for inspection.

2 Likes

Thank you so much Floris! That makes a lot of sense. I’m working with a Dutch version, so I’m guessing the Dutch translation of text flow is tekstomloop?

I examined all the paragraphs on page 20, and also all the lines between page 3 and 20, which is the table of contents itself on text flow, since theoretically I can imagine it can be anywhere between those pages, and there were no check marks in the page number box.

Then I started rebuilding the document from the beginning, inserting one chapter after the other to see where the page deviation started showing up in the table of contents.

Chapter 1 to 4 gave no problems, When I added chapter 5, the 25 page jump came.

So I inserted one section of chapter 5 after the next, and in the section on Vitamin B2 (it’s a health book) the table of contents started to deviate by one added page number, but corrected itself after a few refreshes.

When I came to the section on Calcium, the one page surplus page deviation persisted no matter how many times I refreshed the table of contents.

Then when I removed everything and just left Calcium, there was no page number deviation. So it seems to be a cumulative problem.

Changing the pictures from paste to insert , as Ajlittoz suggested does seem to do something. The more pictures I change from paste to insert, the less the page deviation becomes.

It is now down to 20. I’m hoping changing the pictures from paste to insert will solve the sliding pictures and the added empty entries and enters in the alphabetical index as well.

So you two got me unstuck, thank you so much! I’ll let you know how I get on solving it.

The document was too big to upload here, so you can find the we transfer download link on the landing page for the book. Here it is: Mothahat:Prevent and Heal Covid-19 Naturally and Deliciously – Dandhea

Thanks again for your help!

I downloaded your document in the hope to characterise the problem.

Alas, your book is a sin against intelligence: you have used only Heading 1, Heading 2 and Text Body paragraph styles; a single page style *Default Page Style; Emphasis, Strong Emphasis and a custom character styles.

Globally your formatting is totally unstructured. Structuring your text with styles is mandatory on a 900-page document; otherwise you won’t be able to tune its layout and formatting.

  • You space vertically your text with empty paragraph without caring for the effect. As an example, you pollute your with Heading n empty paragraphs which end up in the TOC for no semantic reason.
    As an example of an erroneous usage, look at the dedication. It is logically a single paragraph you split into 4 independent ones with heavy direct formatting over Text Body. You should have created a Dedication paragraph style, centered, with a specific line spacing.
  • Your outline is based on levels 1 and 3. Where is level 2?

Styling should follow your contents structure, i.e. styles primarily “annotate” text with semantic significance such as Heading n for headings (partially done), Text Body for main topic and other paragraph styles for other meanings like remark, caveat, chemical definition/composition, medical counter indication, prescription advice, … This the way an author communicates the nuances of his discourse to Writer. And vertical spacing is part of this meaning for structuring the text in parallel with your message to readers. Hence vertical spacing is configured inside paragraph styles.

Instead of that you apply everywhere direct formatting without caring for side effects.

You have frequently short numbered lists (numerical or alphabetical) you enter manually instead of relying on automatic numbering thanks to list styles. How do you manage renumbering when you reorder your items?

You have 6 empty frames which are useless and at least for one disturb standard text flow.

You have created hundreds of sections (and even sections within section) for absolutely no reason in your notes. Such a huge number put a big penalty on Writer and may result in instability.

Due to your manual vertical spacing, your tables are no longer synchronised with page boundaries here (I may have a different font configuration which creates a cumulative slight offset page after page). In one occurrence at least, table heading are not repeated on next page. You should use table text flow properties to guard against such mishap.


As is your document, we can’t be really help. You must first rigorously restructure it. and remove all useless components. Remember that the more “objects” you have, the more difficult it is to manage formatting and layout. Read “objects” as paragraphs, direct formatting directives, sections, frames, images, notes, … Writer can handle “monster docs” like yours but make the task easier by trying to make do with as few objects as possible.

You mean I have to write a text with as few paragraphs as possible?

In the mean time, just changing the pictures from paste to insert, as you suggested seems to do the trick.
So I guess I can just start with that? Or how do you suggest I rigorously reformat my text? Where do I start?

Yes. The technical structure must match your thought model (i.e. how the document is Writer written must parallel your argumentation development). The more structured, the easier you can manage and maintain the book. Structuring also allows to automate most of ancillary “services” such as chapter numbering, list numbering, cross-references and other data handled through fields.

Read basic documentation in the Writer Guide or, better, “Designing with LibreOffice” by Bruce Byfield. Both can be downloaded from the documentation page.

1 Like

Here are some “dumbed-down” hints, based on my development. My first word processor was WordPerfect 5, and back then, styles wren’t even an idea. If you wanted your chapter titles to stand out, you could direct-format them with codes like {Big}, and if that wasn’t enough, {Big}{Big}, etc. You had to make notes of how you formatted your text, WordPerfecet didn’t manage that for you. Styles were a godsend. You configure your styles at the start of the project, and you apply them at once. Then your formatting will be consistent. You want to change the formatting later on? No problem, you just modify the styles involved, and the text will adjust itself. The more formatting you put in styles, the better.
Don’t paste pictures into a document; Writer will then convert them to an internal format and blow up the size of your document. The best thing is to insert them as link. The picture will then sit in the same folder as your document, but not inside it. If you have lots of graphics in the document, are proofreading and don’t need the picture to be visible, you can turn off display of graphics, and then you can work much faster with a smaller document.
Opening your document now …

2 Likes

You have some terrible “vertical formatting”, using blank paragraphs formatted as Heading 1 or Heading 3 - they will pop up in the TOC, something that you probably don’t want. You also have the Preface start at the bottom of a page, at least on my screen. The best way to force your chapter titles to be at the top of a page is to force a page break before that heading. You also manage that in the Tekstdoorloop tab of the already mentioned dialog box. Force a page break before, set a special page style if you want one for the first page of a chapter (for instance to suppress a header). Also don’t use blank paragraphs to make space between paragraphs. Instead, use the Indents and Spacing (Inspringingen en afstanden) tab to set a space below and above a paragraph.

EDIT I don’t see the page numbering gap.

[quote=“floris_v, post:10, topic:90469, full:true”]
“You have some terrible “vertical formatting”, using blank paragraphs formatted as Heading 1 or Heading 3 - they will pop up in the TOC, something that you probably don’t want.”

That’s not me, those are thrown in every time I refresh the alphabetical index.

" You also have the Preface start at the bottom of a page, at least on my screen.:"
I see that now. That went very wrong. I’ll upload a new version.

"The best way to force your chapter titles to be at the top of a page is to force a page break before that heading. "

Can I use the enter command for that?

“You also manage that in the Tekstdoorloop tab of the already mentioned dialog box. Force a page break before, set a special page style if you want one for the first page of a chapter (for instance to suppress a header).”

“Also don’t use blank paragraphs to make space between paragraphs. Instead, use the Indents and Spacing tab to set a space below and above a paragraph.”

I do use “enter” between paragraphs. The empty paragraphs show up every time I refresh the alphabetical index.

"EDIT I don’t see the page numbering gap.
[/quote]"
Interesting. How can that be? So with you the TOC gives the correct page number all through the document?

Reading this now

AnnaElize: A few more pointers.

  • Keep in mind how you are going to get this published. If you send the manuscript to a regular publisher, they’ll redo the entire formatting, so you’d be wasting your time over that.
  • If you do it yourself, remember that you should get your content or text right before you spend time on the lay-out. Because every time you add a few words or lines somewhere in a chapter, that may affect the rest of the text flow in that chapter, and then you can start all over.
1 Like