[Tutorial] Page numbering
– Page number is a field that must be placed either in the header or in the footer.
– Header/footer are configured in the Page style (each has its own tab in the properties of the page style).So:
– Double-click the page style name in the status bar (bottom of the main window).
– Go to the Header or Footer tab and activate it, click OK.
– Put the cursor in the Header/Footer created and go to Insert>Fields>Page number.More information on the wiki: Page Numbering in OpenOffice.org Writer.There is also a GUI as extension : Pagination extension.Left/Center/Right alignment
Both the Header and Footer paragraph styles (automatically selected in those areas) have customized tabulations; first is left aligned, second is centered and third is right aligned.
Just hit the Tab key to navigate to the 2nd (middle) and 3rd (right) positions.
NB: if those strings are too long, they may push the next to the next tab slot and ruin the layout. In such case, you can use a table (with no borders) to limit the width of each place. Text will be wrapped in each cell without interfering with the others.
Odd and Even pages alignment
In the Header or Footer tab of the page style properties, you can uncheck the Same content left/right option. Then, you’ll be able to have a left aligned page number on even pages (left) and right aligned page number on odd pages (right) without using 2 pages styles.
Numeral and non-numeral formatting
The formatting of the page number is not controlled with its field itself but with the Page style.
See: Changing the number format (wiki).
You see a gray background on your page number? No worry, hit Ctrl+F8 or View>Field Shadings. The shading is not printed (disappears in Print Preview). It is just a reminder that this item is a field, a dynamic placeholder.
You see “Page numbers” instead of the actual number? No worry, hit Ctrl+F9 or View>Field Names. This is the identification of the field (replaced by the actual number in Print Preview).
Showing, hiding or restarting the page number
As said above, the page number is linked to the page style. Therefore, if you want parts with numbering and some without, you need different page styles.
You can have a look at: [Tutorial] Page styles and headers/footers (and the wiki of course).
Never use the Offset feature you can see in the page number field dialog! The ToC is based on the real page numbering and it doesn’t take into account the offset feature. Moreover, your last page won’t have any numbering if the correction is positive.
- Go to the first paragraph of the page to be renumbered, right click and select Paragraph to edit its properties (not Edit Paragraph style).
- Go to the Text Flow tab, in the Breaks section, adjust the page number.
See also: Numbering the first page something other than 1 (wiki).
And for a detailed tutorial with an example: [Example] Document structure and numbering
Total pages number by chapter or section
The target is to have a numbering like p#/S1, p#/S2, p#/S3, … S1, S2 and S3 being the page count for section 1, section 2, section 3, … (instead of having the total pages count of the document).If you have several chapters and want the numbering in each one be like PN/CPN where CPN is the number of pages of the chapter, here is the method:
- First you’ve to restart the first page of the chapter at 1 (see previous tip). Note that this can be automated if you use a heading style for example (or any other paragraph style used for the first paragraph).
- Go to the last page of the chapter, insert a Bookmark ‘chapter # end’ for example.
- To display the last page number, which will be the total number of pages of the chapter in fact, place your cursor in the header or footer and insert a field (CTRL + F2) : in the Reference tab, select the bookmarks category and select your ‘chapter # end’ bookmark, keep the Page format highlighted. Insert and it should be ok.
- The only thing is to keep in mind there is a bookmark at the end of each chapter. Note that you can insert the bookmarks in sections or in frames. The former can be password protected but the latter can be resized to avoid having a whole line dedicated to the section.
NB: there is an enhancement request for this feature, you can vote for it (up to 2 votes per issue): Issue 36205 – Add a separate page number/count for each page-style.
About (automated) page breaks
First these breaks are changed to section breaks in .doc, so that the different headers/footers are correctly exported.
Second, you can have strange results when you change a page style through the Styles & Formatting pane or the status bar (applying a new page style somewhere) : you loose some (or all) of the page styles next to the changed one. You can imagine that page style propagation is stopped by “slots”. Defining the Next Style for a page style doesn’t insert any visual page break. It may be the reason why there are issues linked to that. The “slot” may need a geographical location (i.e. a paragraph to be anchored to), explaining why the Next Style feature cannot insert a manual page break (with a slot) : if you change the layout (margins + font size + …), the Next Style will be applied to the new next page easily whereas with a localized break, you loose the connection with the page start/end.
The odd and even pages rule
I’ve filed a bug report, you can vote for it (up to 2 votes per isue): Issue 88361 – Disable even=left/odd=right page rule to avoid page numbering issues.