10 Feb 2012

How to make page numbering start on a certain page in OpenOffice.org or LibreOffice Writer

About a year ago I published a blog post and then a video showing you how to insert page numbers into an OpenOffice.org document.
The video became very popular, and I got some additional questions about the functionality. The question I got recently persuaded me to write this post.
So, what is the question?
Say you write a novel. This is a lengthy document which has a title page, table of contents and some chapters. You want to make page numbering start from a certain page and not include first pages like front page and table of contents. How to achieve this?

There are at least two methods to do so.
As an example, I will use the text from my own e-book, which you can find at http://www.sapexpert.co.uk/free-ebook.php. Let's say that our starting point is the document without any page numbers, but with title page and table of contents. I exported that document into PDF, which you can find here.

Method 1

First method is an easy one, but it does not offer you many options.
Go to menu Format – Title Page
You should get a new window where you specify the parameters of your title page. You may be surprised, but “title page” can contain... several pages! Let's use this to convert the three first pages of the document into the “Title Page”.

There are two important points at this screen
  1. You can reset page numbering after the title page. I reset page numbers to 1 after the Title page.
    At the same time, you can give title pages their own numbering. I don't need this for my example.
  2. You can assign style “First Page” to the Title Page. Please remember this now, we'll use this information in few seconds.
Now let's insert headers and page numbers into the document. While doing it, please pay attention to the type (style) of the page where you add your headers.

I added header to the style Default, but not to the First Page, the style which was assigned to our Title Page.

When you do this, your cursor will be automatically placed in the header you've just inserted. It also means that document will be scrolled to the page with the relevant style, if it is not already being displayed.

Now add page number and format it, as was previously described. As a result, I see page number “1” at the fourth page of my document. Page numbers start at this point and are not shown on earlier pages.

You can see the PDF version of the document here.

Method 2

This method gives you more flexibility. Let's see how it works.
Before doing this, you need to check the style of the pages you want to number differently (or not number at all). You can do this in from the menu Format – Page and then check the value in the field called Name on the “Organizer” tab . All pages of my document, apart from the table of contents, have the style “Default”.

The next thing to check is that you have two different page styles defined in your document. To do so, call up Styles and Formatting windows via the menu Format – Styles and Formatting, or by pressing F11 on your keyboard. The tab Page Styles lists available styles. If you don't have separate page style for your sections, you can create one, for example by copying from an existing one: use the button New Style from Selection. I created style Default1 based on the Default one.

Now the preparations are over.

Let's start with inserting of the page break between the pages which should have different styles. In my scenario I go to the end of the text on page 3 (Table of contents) and then select menu item Insert – Manual Break.

The next window allows you to insert the page break.
I add Page break in my document and apply the style Default1 to the following page. At the same time, I reset page numbering to “1”.

Now let's add header to the pages with style Default1. This is similar to Method 1 described above.
The final step is to add page number and format it in the header, like we did previously.
The result? It is similar to what we got in Method 1. You can see the file here. (link)
Why is this method more flexible than Method 1? Because it allows you to have as many separate numberings in a single document as you like. Create different page styles, apply them to areas of your document, and apply separate page numbering there. For example, no page numbers on the first title and technical pages, then 1-2-3 on the main text, and finally i-ii-iii on the Appendix pages.

How to use non-Arabic page numbers in OpenOffice.org Writer? I have written about this already. It is easy!

11 comments:

  1. Thanks DarkDuck! Very helpful - especially the Title page info - I was not aware of that function.

    Andy Prough, CFE
    Kyle, Texas, USA

    ReplyDelete
  2. HAIL TO THE DARKDUCK. and thanks for the post, it took me a while, but i finally got it done. without this post, it couldn't have happened.

    ReplyDelete
  3. Dear DarkDuck,
    what key do i press to take the grey out of a field? for instance, the page numbers, i want the grey out of that. i k now it wont be there in the printing, but it is atrocious in the file. thanks.

    ReplyDelete
    Replies
    1. I don't know. I am not sure it can be done at all. :-?

      I think this is done intentionally, so one can tell the usual text from automatically adjusted/calculated fields.

      Delete
  4. Excellent info and well explained. Help me a lot. Thanks!

    ReplyDelete
  5. If I do what you suggest, then the first page of the main text starts with page number 1. So far, so good.

    But the number of pages shows the total number of pages including the section with roman numbers, not the number of pages in the main text.

    How can I get the correct number of pages, counting from 1 after having reset it to 1?

    ReplyDelete
    Replies
    1. Holger, you probably used a wrong variable in your headings.
      If you want, please email me the document, I will try to look into your problem.
      darkduck at darkduck dot com

      Delete