how to make page numbers in separate files continue

We are making a file that is too large for Libreoffice, and so broke the file into smaller files. I have not found a way to change the starting page number of subsequent files - e.g. first file pages 1-59, the start the second file at page 60, etc. The plan is to print to PDF and combine the separate PDFs. Help appreciated.

(later) Let me clarify. I have multiple documents that are camera-ready EXCEPT for the page numbers. I can’t do anything dramatic that will upset the formatting and many pictures and create hours of work. I just want to start each file with a later page number. The help entry “To Start With a Defined Page Number” almost works, but involves inserting a break that messes up the file badly, and seems to only put the new number on the second page. I feel like this ought to be easy but I haven’t found it. Thanks again.

You can group all those small files into a master document, and all the numbering will flow without problems. Basically, a master document is a document that call other documents as its content: you can get a general index, continuous page/figure/table/whatever numbering, etc. You can check the help files on the topic for more information or, if you’re brave enough, chapter 17 on my free book about Writer. Of course, you can check all the other chapters, too :wink:


EDIT: As you found, using master documents may modify some aspects of the general layout. In order to manually change the page number of each individual file without introducing more formatting problems, proceed as follows: go to the very first paragraph of each document → right click → Paragraph → Paragraph → Text Flow tab → check Insert under Breaks → for type select Page → for position Before → check “with page style” (you don’t need to change the style used) → check the “page number” box → change the page number. No additional page should be added before and everything should work without problems.

Thank you, I will give your suggestion of a master document a try, as well as looking at your book! I will report back my results.

(later) So far I haven’t figured out how to create a master document without causing massive formatting changes and hours of work. See revision of the original question. Also, looks like a great book, thanks!

@twegner Yes, if your document is too sensitive to the layout master documents may need more work. Check my edited answer to know how to change the page number of each file without disrupting the formatting.

The procedure you propose I tried using “To Start With a Defined Page Number” in the documentation. I tried again following your instructions exactly, and the result was that the text on the page disappeared but the images (anchored to page) remained. The top page was still numbered “1”, and the second page is numbered 60 (the number I asked for). But the relationship between pictures and text for the entire file is messed up. I will try testing on a shortened version of the file with the anchoring changed to paragraph or character. I saw you warned against anchoring to page in chapter 17 of your book.

I really appreciate your help! Thanks!

(later) I am experimenting with the “To Start With a Defined Page Number” (same as your suggestion) procedure with no luck. A break does appear to be inserted, pushing the text to the next page. If I place the cursor just before the text and backspace, everything is restored properly, but the page numbers also revert.

Adding a break to the first paragraph is the only way you could use to do what you need (unless you use proper way of master documents suggested by @RGB-es initially); but - as you’ve discovered, the “No additional page should be added before and everything should work without problems” claim isn’t entirely true in this case, because when you want to start your sequence from even number (e.g., from number 60, as in your example), one additional leading empty page is inserted before your first page. It is because in Writer, it is assumed that pages start from an odd number (see: page number 1 is odd number).

You may disable printing automatically inserted blanks in Print dialog (LibreOffice Writer tab), or in Options dialog (LibreOffice Writer->Print section); PDF export also has that setting on General tab. AFAIK, it is even disabled by default now, so probably you won’t have problems with that when printing anyway.

Thanks Mike. I thought maybe you had solved the my problem by making the requested page number odd. But no luck, if I specify 61 when following RGB’s instructions, I get pages 1, 2, 61, 62 . … whereas before I got 1, 60, 61, 62 … I actually need to have an even number of pages in each file anyway for the alternating margins to work right.

I appreciated the tip about automatically printing blank pages. But that’s not my problem, since I see the page numbers prior to printing. I am leaning more and more to buying a PDF editor to fix the page numbers in the PDF output. I’m finishing up a fairly complex picture+text book my wife wrote of a trip. We will print it, but it’s only for extended family. I’m the geek husband who is trying to finish off the book production. I now see many things she can do differently next time (e.g. not embed photos), but this time around I would really like to avoid massive editing. Thanks to both of you, I have learned a lot. Haven’t given up yet!

But no luck, if I specify 61 when following RGB’s instructions, I get pages 1, 2, 61, 62 . … whereas before I got 1, 60, 61, 62

Oh, that’s really strange - it shouldn’t happen that way. I could only think of something like that if you have something anchored to page on the first page, so that when you set your first page to 61, that something still requires existing page 1, forcing LO to create it (and then an interleaving second empty page)? (And I couldn’t repro this even following my own guess - so possibly you could provide a sample file with shortened and anonimized content to see what’s going on - I suppose only the first page would be needed, which you wanted to make 60/61).

Or another guess: are you sure that you set the break in the first paragraph of the document? Can’t it be that there’s some (empty? small-font?) paragraph(s) before this one? (A hint: enabling formatting marks may help see such things.)

Yes, there are images in the first page anchored to page. I will try fixing that tomorrow and will report back. Thanks.

I re-anchored all the images in the top two pages from page to character. Then I followed the instructions in the edited answer above to change the page number to 61. The result was the first page was still 1, and the second and subsequent pages were numbered from 61. The first page became blank except for a header. Below that, page 61 looked ok but pages below were messed up. There are many more images in later anchored to page. Changing all the anchoring is too large a job.

After expressing enormous thanks to RGB and Mike, I am officially giving up. When my wife creates the next travelogue book, I will have her insert all images as links in order to have a smaller document she can keep in one file, and avoid anchoring images to page. This time I will create a single PDF and edit the page numbers. Thanks to all, I don’t feel my time was wasted because I learned a lot. Lesson learned is to get things set up properly when starting, and not try to retrofit fixes after the fact. Thanks!