[Solved] Table of Content page number mismatch

Discuss the word processor

[Solved] Table of Content page number mismatch

Postby SiriDeb » Fri Mar 27, 2020 4:00 pm

My TOC accurately includes all the appropriate pages/entries, and is formatted exactly as needed. Only problem is Chapter 1 is actually the 5th page in the book, so TOC shows it as page 5 instead of page 1 as it appears in the chapter footer. How to force the TOC to recognize the numbering imposed in the chapter footer? Thanks
Last edited by Hagar Delest on Tue Mar 31, 2020 11:15 am, edited 1 time in total.
Reason: tagged solved
OpenOffice 4.1.6
Windows 10 64bit
SiriDeb
 
Posts: 3
Joined: Fri Mar 27, 2020 3:39 pm

Re: Table of Content page number mismatch

Postby RoryOF » Fri Mar 27, 2020 4:07 pm

How did you set the Page Number for Chapter 1 first page?
Apache OpenOffice 4.1.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31414
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Table of Content page number mismatch

Postby SiriDeb » Sat Mar 28, 2020 4:21 pm

RoryOF, thanks for responding. I use style sheets, one for frontmatter, one for main content. Inserted page number via Insert ~ Fields ~ Other. On Document tab: Page ~ Page Numbers ~ As Page Style. Offset -4. The main content has multiple chapters, with simple sequential numbering.
OpenOffice 4.1.6
Windows 10 64bit
SiriDeb
 
Posts: 3
Joined: Fri Mar 27, 2020 3:39 pm

Re: Table of Content page number mismatch

Postby RoryOF » Sat Mar 28, 2020 4:51 pm

Don't use Offset - it causes problems. Place cursor in the first body text on page 1 of Chapter 1. /Format /Paragraph, choose Text flow tab. Under "Breaks" check "Insert", Type "Page", position "Before", check "With Page Style" and select the preceding Page Style. Set "Page Number" to 1 (the number you wish displayed). Press OK.

You may have to fiddle with the preceding pages to get an extra page deleted; this shouldn't take long.
Apache OpenOffice 4.1.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31414
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Table of Content page number mismatch

Postby John_Ha » Sat Mar 28, 2020 5:46 pm

You may find this explanation helps your understanding.

It's all about Page Styles where Page Syles can only be changed at a Page Break.

You can get full information on Page Styles, Page Breaks and Page Numbering in Chapter 4 - Formatting Pages of the Writer Manual. Also see the Writer Tutorials where you will find [Example] Document structure and numbering and [Tutorial] Page numbering.

Be sure to download the two files in [Example] Document structure and numbering and format the example file - it will help you immeasurably.

It is very useful to make Page Breaks visible by Tools > Options (Preferences on Mac) > OpenOffice > Appearance > scroll to Text document > tick Section boundaries > choose a colour for Page and column breaks. Page Breaks now show on the screen as a thin coloured line and identify all Page Breaks. This is the default setting on later installations where Page Breaks appear as a thin blue line.

Also be sure to Set View > Non printing characters ..., to ON to see the paragraph breaks.

Page numbers

Page Numbers follow on sequentially from the previous page and there is nothing stored in the document to tell you what a given page number is because, apart from where a change is made, each page number is calculated by how far away from "its start" it is.

If you want to change the Page Number you must insert a Page Break and set the new Page Number. Go Insert > Manual Break > Page Break..., and a small pop-up window allows you to change the Page Number for the first (and hence subsequent) page(s) following the Page Break.

The Page Number you set is stored as an attribute of "the first paragraph on the page following the Page Break where the change in number is made". It can be seen, and changed, by placing the cursor in "the first paragraph on the page following the Page Break" and going Format > Paragraph > Text Flow .... The value " 0 " here means "page number follows on from the previous page number". Any value 17, 23 … etc means that this page starts at 17 or 23 etc.

There is an exception. If you define Page Style Fred to have a "Next Style Bill" then when you insert a Page Style Fred, the next page will automatically become Bill. In this case there is no Page Break between Fred and Bill, and Bill's "start" for numbering is Fred. Format > Paragraph in the first paragraph of Bill has no pagination information.

Page Styles – changing headers, footers and/or page formats

The Page Style following a Page Break can be exactly the same Page Style as the page before the Page Break or it can be a different Page Style.

If you want to change a header, change header text, change a footer, change footer text, change the page number, hide page number etc, you must insert a Page Break and you must select a Page Style which makes the change you want.

If you want to change the Page Style you must insert a Page Break and set the new Page Style. Go Insert > Manual Break > Page Break..., and a small pop-up window allows you to choose the Page Style for the first (and hence subsequent) page(s) following the Page Break.

Page Styles (and hence changed headers and footers); Page Breaks and Page Number are an attribute of "the first paragraph on the page following the Page Break where the change in number is made" even if the paragraph is empty or is a Heading (or is a table at the very top). Note that Heading means a Heading 1 or a Heading 2 etc, and not a Page header as in header/footer.

You can also manually insert or delete a Page Break; manually choose the Page Style (and hence change headers and footers); and manually change the Page Number; by placing the cursor in "the first paragraph on a page following a Page Break" and going Format > Paragraph > Text Flow > Breaks ... (or in the table, and going Table > Properties > Text Flow...) where all these options can be changed.

You can also delete a Page Break by Backspace, or by deleting highlighted text which includes the Page Break.

Debugging problems with page numbers or page styles, headers and footers

Debug Page Style changes / changed page numbering / changed header problems by placing the cursor in "the first paragraph on the page following the Page Break where the change in number is made" and going Format > Paragraph > Text Flow > Breaks .... What is the document telling Writer to do following the Page Break? If you see nothing there to cause the change, the document has become corrupted and (much!) more diagnosis is required. Remember if the Page Number here is " 0 " it means “page number follows on from previous page ...”

Be aware that there is no Page Break between different Page Styles if the second Page Style (Bill) is defined as the Next Style in the first Page Style(Fred). See Fred and Bill above.

Two words of caution

1. You can go Format > Page ..., and edit the format of the page in which the cursor is currently located. However, you are actually editing that page's Page Style, so all other pages which use that same Page Style will also have their formats changed.

2. Do not manually change the page number by editing any paragraph, not even the first paragraph on a page. You must only edit "the first paragraph on the page following the Page Break where the change in number is made". If you edit any other paragraph to change page number your document will go horribly wrong.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
 
Posts: 7794
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Table of Content page number mismatch

Postby Bill » Sat Mar 28, 2020 6:09 pm

The page number field displays the actual page number only when the offset is zero. With a non-zero offset, the page number field displays the page number of a different page. With an offset of -4, the page number field displays the page number of the fourth preceding page. On the other hand, the TOC always displays the actual page number, so you have to change the page number instead of changing the offset for the page number field.
AOO 4.1.7, LO 6.3.6.2 and LO 6.4.3.2 on Kubuntu 20.04
Bill
Volunteer
 
Posts: 7863
Joined: Sat Nov 24, 2007 6:48 am

Re: Table of Content page number mismatch

Postby SiriDeb » Mon Mar 30, 2020 3:58 pm

Thanks, everyone. I came in with a very good understanding of Page Styles and formatting, but had never used the page numbering with a TOC, so this really had me stumped, because except for the TOC numbering being off, everything else was working great. Turns out it was a simple fix. What finally worked is what RoryOF recommended - removing the Offset, and using the steps he outlined on the Format ~ Paragraph settings. The one change from what he recommended: instead of selecting the "Previous" style, what worked was to select the "Current" style and set page number to 1. Using Previous made the footer match the previous/frontmatter section, which is not what I wanted. It's my first time posting in this group; you guys are great! Thanks for the help. :bravo:
OpenOffice 4.1.6
Windows 10 64bit
SiriDeb
 
Posts: 3
Joined: Fri Mar 27, 2020 3:39 pm


Return to Writer

Who is online

Users browsing this forum: No registered users and 18 guests