Page numbering problem with formatted document

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.

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.

It would be helpful if you add an example of the desired layout. Check my other, updated answer.
And please, comment on answers instead of posting a new one.

I’ll try to add a link to a screenshot of a sample page - without the top, centered page number. Not sure how this works though. Clicking the “link” icon doesn’t work though. How is it supposed to work ? I have a jpg of just over 100kbs to send.
Robert.

Here’s a link to a sample page, again without the desired top, centered page number.
https//sites.google.com/site/heronviewers/home/file/pagesample.jpg
All formatted and displays correctly as an ebook.

Robert.