Changes page numbers without introducing a new page

***** Edit: Apologies, but I might have stumbled across my own answer. Please read my second comment below too *****

I am trying to produce a PDF/A and I am forced to revisit this issue:

How the heck do you change page numbers without introducing a blank page?

When printing this is not so much a problem as I just remove the page. But when producing an archival PDF you want to avoid editing it, so removing the page is counterproductive.

First, this is the version I am working with:

Version: 7.6.5.2 (X86_64) / LibreOffice Community
Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b
CPU threads: 4; OS: Mac OS X 10.15.7; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Second, these formatting details:

The book is constructed as a master document, and most importantly, there is no direct formatting at all. Everything is handled with styles. I learned that lesson the hard way! :grinning:

This is a book with Roman numeral numbered front matter and Arabic numeral numbered pages. The front matter is ordered as follows:

  1. Title Page
  2. Copyright
  3. Dedication
  4. ToC
  5. Acknowledgements
  6. Author Notes
  7. Prologue
  8. Epigraph

The Book itself follows this pattern

  • Part
  • Chapter
  • Chapter
  • Chapter…
  • Next Part
  • Chapter…

and so on.

Now, this what I am trying to achieve:

Front matter page numbering should start with i (one) at Acknowledgements. Notice that Acknowledgements is page five above. Indeed, left alone the ToC will list Acknowledgements as v (five). This is correct in terms of physical pages. However, wrong in terms of style.

So, as each part is a subordinate file, I edited Acknowledgements so that it has a manual break. Now here is the rub: you can only reset page numbers with page styles. So, you have to introduce a page style. So far so good. However, introducing a page style introduces a page!

Now, by setting page styles, I can get the new page to have no page number, and the second page to have the correct page number. This makes a truly blank page and is useful the way I have left/right printing set up. But PDFs are another matter.

The same exact issue happens with Chapter One.

The end result is blank page before the Acknowledgements and Chapter One.

I don’t what those blank pages! :laughing:

Now, I suspect I am obviously doing something wrong here. So, simply, how do you restart page numbering without a manual page break?

  • OR -

How do you insert a manual page break without inserting a page? That sounds odd to say, I know.

  • OR -

How do you restart page number without mucking with pages at all? Or at least without introducing page breaks?

I hope all this makes sense! If someone could point out what I am missing, I would greatly appreciate it!

TIA;

Ken

OMG: I think I found my own answer. Can someone confirm that is the correct procedure, because it worked! It is from [Apache OpenOffice Community Forum - [Tutorial] Page numbering - (View topic)] and is good many years old.

Restarting a page number
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.

OMG! You used page offset! Page offset does not change the page number. A page offset is a relative reference to another pager where you extract the information you need. Consequently a page offset of zero references the current page (and gets its page number). An offset of 5 references the 5th next page. You get the page number or “void” if the page does not exist (this offset is beyond the end of the document). Similarly for a negative offset.

That wasn’t the way I originally set it up. Indeed, I was using manual breaks. I just Google-stumbled across those instructions and lo and behold it worked.

It also surprised me (thus the OMG) because everything fell into place. I expected the ToC to go sideways.

For what I am trying to achieve, it suffices.

So, all that remains is this question: In order to restart page numbers without introducing a blank page, is this the correct method, or at least a safe one? It seems to work.

Thank you for your patience here, but I am learning :wink:

TIA

Ken

Which method? Page offset will apparently work to number pages (except for the last or first pages depending on the value of the offset) but not on TOC. TOC captures the pages with a systematic offset of zero. Therefore, you won’t see your fake number, only the real number.

This only way to intrinsically change a page number is to use a “special” page break where you force-restart the numbering.

But, as I explain in my answer, Writer wants all odd pages at right and vice versa. Consequently, you can’t have two odd pages following each other. I already complained about this in bug report tdf#150913 because there are circumstances where the odd-even concept is irrelevant, e.g. simplex printing. This raises many fundamental questions. So, don’t expect a solution in the near future.

I’m going to try to reply from email, so forgive me if the formatting goes awry.

The method I am referring to is the one I quoted above, that is resetting page numbers by editing the paragraph properties.

But, that said, I understand (and agree) with the statement: This only way to intrinsically change a page number is to use a “special” page break where you force-restart the numbering.

Which why I was surprised, if not confused. You see, editing the paragraph properties does indeed reset the page number. However, it ALSO is reflected in the TOC. Further, the first and last pages are correct as well. Which doesn’t jive with what you (or literally everyone else) is saying on the matter.

The fact remains the TOC is correct after the paragraph properties on the Acknowledgements page were edited. I will toss in the caveat that I have not yet tired Chapter One, but so far so good.

So, since it is working, I’ll go with it with the understanding that it is a bit of hack.

However, if you have the ear of the programmers, adding a way to change a page number without introducing a page would be nice and perhaps a lot less confusing. :slight_smile:

Thanks!

Ken

Could you tell me which paragraph property you modified to get the effect? Text Flow?

Sure… I am work now, but I will send it your way this evening.

ajlittoz;

Here is what I did:

I opened Acknowledgement.odt and clicked on the first paragraph which happened to be the chapter heading. Then I right/ctrl clicked selecting Paragraph » Paragraph as shown below:

Screen Shot 2024-04-23 at 8.23.40 PM

This gives me the Paragraph dialog:

The part I set was was indeed under Text Flow, then breaks. As you can see I selected page, before, right front matter, and set the page to 1

This worked! And the TOC picked it up too, in spite of the all caveats it wouldn’t.

The same trick worked for Chapter 1. The only different is the page style in play. It’s text flow was page, before, right page, and page number 1.

The only different between the two page styles is the page number style: Roman for front matter, and Arabic for the main book.

Now, in the ODM you see this blue line between the TOC and Acknowledgements, as well as Part I and Chapter 1:

Now, as a side note, you are seeing screen caps of the print ODM. The PDF ODM uses the same page styles, but they are edited on the ODM level so that the differences between left/right pages are flattened. This just made it easy make a PDF out of a document meant to be printed. I only mention it because I spoke of both versions. However, the point is moot. The text flow change works on both variants. Indeed, the print variant has all chapters and sections starting on the right page and a blank left page where needed. Even that survived and numbered correctly.

I hope all this makes sense. I’m happy with it, and it seems to work in my case. The TOC understands it and the blank pages are gone.

Thank for your input. As always it is helpful!

Ken

This is the way to do it.
However, it is direct formatting. You’d be better inspired to include this into your styles configuration.
Also, I skipped too hastily upon the fact you work master+sub-documents. To avoid subtle inconsistencies (unless the are intentional), I recommend you base all your documents, including master, on the same template. Your styles are defined in the template and any change is then automatically forwarded to the documents. But you must then be very strict on direct formatting and avoid it otherwise it blocks style configuration (and its visual update).

Your screenshot contradicts your statement. Your page break config is done with direct formatting instead of paragraph style modification.

You are correct, sort of:

"Your screenshot contradicts your statement. Your page break config is done with direct formatting instead of paragraph style modification."

At the time I wrote that sentence it was correct. Then I found the paragraph formatting information ten minutes later. After that the file did have direct formatting in it.

That said, at first blush, clearing direct formatting does NOT seem to remove the direct paragraph text flow. But take that with a grain of salt. I’m still testing it.

The template is in the works. When you are actually writing a book, you don’t know for certain what all the styles will be until you finish said book :wink:

Thx!

That’s where semantic styling comes into play. Consider styles are “only” mark up in your discourse. Name the styles for their meaning (significance). Body Text is for main topic. You can also have Footnote (with the obvious intent), Quotation, Comment, Explanation, Dialogue, … – that’s for paragraphs --, Emphasis, Strong Emphasis, Foreign Word, Trademark, … – for characters --, First Page (cover), Front Matter, TOC, Chapter, … – for pages --.

At initial writing stage, don’t worry for exact formatting. Just make them distinctive enough so that you have a visual feedback about a change in the discourse.

When you come to formatting tuning, modify your styles until you are satisfied with the look. If your document has absolutely no direct formatting (or only the inevitable d. f., mainly related to “accidental” and exceptional text flow), adjusting the styles is all you have to do. You need not scan and review your text.

Note that Emphasis and Foreign Word are indeed different semantic values but this does not prevent them to look the same (usually italics). But if you styled both as Italics, you can no longer operate separately on them. So refrain from designating your styles by their visual effects; prefer a name related to significance.

1 Like

I’ll assume that you restarted your page numbers to 1 (any kind: 1, i, a, …). You mention left/right pages and I suppose, again, you have odd/even page syles.

Writer considers odd pages are always at right and even pages at left. Therefore, if your Acknowledgments are only 1 page long on an i-page, next page will be ii, i.e. even. But if you force this page number to be 1, Writer will insert a blank page to compy with its internal hard-wired rule, no matter what you do.