Page numbering problem with formatted document

I’m using Libre Office version 3.6.4.3.

I have an .odt file of a novel which has been formatted using the tools in Libre Office writer, but had not at that stage had the headers applied to the chapters.
I’ve copied and pasted it into a smaller sized document to turn into a pdf file for publishing as a paperback.

As the original was in 14pt Times New Roman, which is too big for a paperback, I’ve altered the font size to 12 pt and everything looks OK, and the text flows from one page to the next

The original document was not page numbered as it was for use as an ebook (and has been successfully published) and now I want to number the pages, omitting the introductory first few pages and the page beginning each chapter.

I’ve started to number the pages I want numbered by putting the cursor at the beginning of the text and used INSERT->FIELD->PAGE NUMBER.
I want the page number centered, so I’ve used FORMAT->ALIGNMENT->CENTERED and that works – but the text is still to the right of the number and when I try to get it down a line either using my Enter key or INSERT->MANUAL BREAK->LINE BREAK it messes up the formatting of the paragraph.

Can anyone advise on my problem please ?

Robert.

OP: @rob29

You need to add the number either to the header or the footer. Never directly to the text.
Here is a nice answer from @oweng about how to do it.

Thanks. I’ve printed the answer out and studied it. That would be the way to go if I was making a new document, but at the moment I have a document which, when turned into a pdf, is 286 pages long but is missing the page numbers. I could go the path of starting with a new document but I would have a problem copying and pasting exactly the right amount of text for each of the new pages ? Certainly be quite a tedious business. I was hoping that I could just somehow insert the page numbers without messing up the formatting that is already there - and as I said, was fine fot use as an ePub.

Thanks. I’ve printed the answer out and studied it. That would be the way to go if I was making a new document, but at the moment I have a document which, when turned into a pdf, is 286 pages long but is missing the page numbers. I could go the path of starting with a new document but I would have a problem copying and pasting exactly the right amount of text for each of the new pages ? Certainly be quite a tedious business. I was hoping that I could just somehow insert the page numbers without messing up the formatting that is already there - and as I said, was fine fot use as an ePub.

I think you missed something important. First add a header to the page.

This is can either be done by clicking blue “+ Header” button when you place your mouse over the place where header goes or enabling header from Format → Page → Header. Then place the cursor inside the header and pick Insert → Fields → Page number. Voila!

Thanks. I’ve just tried that but there is no space above the text and when I put the header in it appears at the right of the top line of text and moves the text around. Here’s a link to what has happened compare to link above. link text.
Robert.

@rob29, you are going to have to calculate the amount of page area allocated to the text block and subtract any header / footer area from this to determine the space left for the text. The header / footer area lies inside (takes space away from) the text block in LO. It is convenient to use fixed line spacing (i.e., 16pt line height) to simplify the calculating of number of lines per page, including header / footer and the number of blank lines between the header / footer and text area.

@rob29, please pay attention to the example file I have added and updated yesterday. As far as I have understood it, this is what you want . Feel free to paste your text in there (pages 2 and 3)

It looks a huge work to do the calculation road - presumably for each page and then copy and paste the correct amout of text ? I’m not sure that I understand how I could convert a 300 page document that way.
I’ll look at Lactea’s example file and see what I could do with that first.
I had hoped there would be an easy and quick way to get the numbers in place and then turn it into a pdf file for printing. Sounds a much bigger task than I had thought when I started on it.

Robert.

Copy-Paste your entire text in my file page number 2, delete the first and the last two pages. Done.

@rob29, as both @mahfiaz and @lactea have indicated, the issue relates to turning on the header / footer area and inserting the page number there. The text block will automatically resize accordingly. There is no need to recalculate the space requirements for each page, as each page is using the same page layout (style). There is not much more that we can offer by way of assistance.

As far as I have understood it, your page style is not changing. I would suggest that you insert a second style for your first pages an the beginning pages of a chapter. Those are formatted without page numbers. Be careful to set correct margins.

Text pages, on the other hand, have the headers activated. Change styles when using page breaks, too.

Maybe a glance at a similar answer of mine might help you out: How do I use Roman numbers for first pages and Arabic numbers for the rest?

edit: Check my updated file.
[deleted]

edit2: Once more, even clearer. [deleted]

edit3: Full solution now. Description in file. page numbering.odt

Having looked at the updated file, I found I could get all the pages numbered without loosing the formatting, so that’s progress. However, when I do that, all the pages are numbered. I don’t want the first page of each chapter numbered, nor do I want the first 7 pages numbered. When I try to delete the “1” on the first page, all the numbers are deleted. Similarly, deleting any number deletes the lot. How do I delete a single page number ? If I could do that, all will be well !
Robert.

Have a look at my first example. You need to have the page style of the first 7+1 pages without numbering, then you change to text with numbering. Last page of a chapter you insert a page break with a new style, being without numbering. End of first page, insert with page break with page numbering. Reset page number if needed.

Alternatively, you can make a third style for the first 7 pages only. The first_chapter_page style has the with_page_numbering set as next style.

I’ve taken the headers out, using insert - headers, untick, OK.
Inserted page break at the foot of 1st chapter of text, no style in insert break. Clicked cursor at top of next page, into format-styles and formatting-page styles-default. right click, modify, turn header on, format 1,2,3 - apply - OK - double click.
1st 3 lines OK, rest have shifted down to next page. Click in header area - header default appears on all page - insert-field-page number - all pages numbered
What am I doing wrong ?

I guess you have tried to change styles in text window instead of “styles and formatting”.

For a complete solution, view my updated answer. I have done everything as desired and have put a detailed description in there, too. I really hope this explains everything now.

Open “styles and formatting” (F11) in 4th tab (Page styles) while scrolling through the text to see the differences.

Thank you very much - you have done a lot of work explaining it to me. Hopefully, I should be able to fix the problems now.
Robert.

Glad I could help.

If this matter is done, please mark it as solved and vote.

Thank you.
No, I don’t want to set a different page style except to get a page number, centered, at the top of most pages. The margins are all set as required for a paperback.
Since posting my question, I’ve tried using style->styles and formatting->page number and then insert->field->page number and then line break and that seemed to work for some pages - but on others, the formatting of the following paragraph was all messed up again. I tried it again after using format->clear direct formatting on the offending paragraph but that didn’t work either.

Presumably other people have done this before, so I must be missing something - but what ?

Robert.