Unwanted blank page created when inserting page break with a new style

Hello.
I noticed a new behavior in new versions of LibreOffice (I cannot tell exactly what version introduced this, but it is less than 1 year old).
I am using a document created a long time ago, and I had no problem at that time. I am opening it now and it automatically inserts blank pages in some conditions.
I use page styles, and «vis à vis» setting (I don’t know the name in english).
When I insert a page with a new style using a manual break after a right hand page, the new page is also right hand, and a blank page is now inserted.
The «do not print blank page» trick does not work for me because my margins are different inside and outside.
Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: 420(Build:3)
CPU threads: 16; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Debian package version: 4:24.2.0-1~bpo12+1
Calc: threaded
File saved as OpenDocumenFormat (.odt)

… then you create a left page. If your inserted page’s style is right page, so Writer adds an empty page.
.
Better share a short sample file including the problem. Cheers

Either mirrored (when left/right margins are different) or facing pages (more general than previous: different left/right headers, …)

And, as usual, mention OS name, LO version and save format.

The inserted page is style is «vis à vis» neither odd nor even. It used to start as a left hand page. Now it starts as a right hand and insert a pase.

I will try to create a new document to thow the problem. The actual document is pretty big.

Here is a stripped version of the file, showing the problem.
exemple_rapport_enquete.odt (19.5 KB)

I assume you complain about what happens after your TOC when you transition to main topic with a manually inserted page break requesting to switch to Defualt Page Style and simultaneously resetting page number to 1.

This page number is odd. Consequently, Writer will ensure the page will be a right page because in Writer odd-numbered pages are at right and even-numbered pages are at left, even when your document is printed single-sided.

You may consider this as a shortcoming. There is presently absolutely no way to tell Writer your document will be single-sided in order to suppress automatic page insertion. You have to live with it.

PS: this looks like a template. You should consider saving it as an .ott file so that it is never accidentally overwritten by your users.
Also, although your sample is rather small, it already contains a lot of direct formatting. Remember that direct formatting always makes your life a nightmare when you try and tune your formatting. But I suppose your users likely have lower Writer skills than you and will somehow mess your template even more.

1 Like

Thank you for this answer.

This is not a template, but an example for my students, given as PDF file. Except in the very first page (where I will not bother creating styles for just one use), there should not be so much direct formatting in the rest of the document.

So, the problem comes from the page number ? Is this a newly introduced «feature»? I still have the PDF of my old version where the page 1 is an left hand page.

I can’t tell if this is a new feature. It really bothers me for my single-sided documents. I submitted tdf#150913 on this topic but the subject seems to be difficult to handle. You can subscribe to the CC list of the bug report to show that users care for this. This will bump bug scoring abd hopefully attract developers’ attention.

Are you sure your PDF was created with Writer? If so, can you remember the date? This could help to spot the release number and demonstrate it is a regression (which is easier to fix than a new implementation).

I will have a look at that bug later.
The pdf was created by Writer, it is sure. And it was probably in 2013 or 2014.

I have made some progress.

I insert the page and change the number to 2 instead of 1. The new page is now a left hand page.
Then, I modify the page number by -1.
So, no blank page, and page number is ok
But…

  • The page number in table of content is now wrong (does someone know how to modify it ?)
  • I believe that if i insert some text before the page break, and in this text cause a new page to appear, it will break everything.

This is a common misunderstanding about page offsets. An offset does not change the page number. Field "page number* (like many other fields) proceeds in two steps: it first references the page from the current page, adding the offset (consequently, offset 0 references the current page, offset -1 the preceding page), then retrieves the number from the designated page.

TOC building is an independent process, not using fields. It scans the whole document, looking for Heading n paragraphs (let’s make it simple, but there is more than that) and capturing the page number of these paragraphs. No offset involved, which explains why you get a different result.

Don’t use offsets except in contexts like “See previous page [which is numbered] n”.

As you suspect, if you change the page boundaries with your dirty trick active, you’ll be in big trouble with your page numbers all messed up.

According to my knowledge, there is no present solution (though I looked a lot for one). Either you accept the blank page (one out of a few dozens of pages is not a big loss), or the TOC is long enough to overflow on a second page, then using the “blank page” which is no longer blank.

In PDF export dialog, there is an option to not export automatically generated blank pages. Same with Print dialog.

Yes, I know. And I know that I can avoid printing them, but this does not solve the margin on the wrong side problem.

Your explanation was very helpful for me, with this exact situation.

thank you!