Writer page numbering is wrong: one number up

I’m creating a template for my projects, but I’m having an issue with the page numbering: I have a 3 pages document (first page + two normal pages). Instead of having page 0 (hidden), page 1/2, page 2/2, I’m getting page 0 (hidden), page 1/4 and page 2/4 for some reason. I’m seeking page 0 (hidden), page 1/2, page 2/2.

I’m using Manjaro Linux, LibreOffice 7.3.5.2 30(Build:2) and here’s the template:
Plantilla proyecto.odt (502.0 KB)

That will happen when your first page is a left page. A LibreOffice document always starts on a right page, so if you have your first page start on a left page, LibreOffice Writer will insert a hidden right first page.
So your second page gets hidden because you (correctly done) force a page break before the Table of Contents. But your page nr. 1 is a right page. You will see that when you select multiple page view (side by side, right-hand side of the status bar, zoom out to make it show). You can enable inserting blank sheets when printing a document with blank, normally non-printing pages (invented to save paper, I presume).

But this page isn’t shown when viewing on printing mode. Also, how can I fix it so it’s a right page?

Please see my edited first comment.

You may have bumped into a bug I didn’t suspect! Anyway, something is definitely broken in your document because it crashes my 7.3.5.2 Writer whenever I try to edit your page break. EDIT: this crash is tdf#150629 and will be fixed in 7.4.1.

Your document is made of:

  • a title page under First Page page style,
  • a manual page break forcing page style Default Page Style with page number restarted from one
  • several pages under Default Page Style

Spurious page break

Both page styles are “ordinary” page styles for right and left pages.

First Page is configured to switch automatically to Default Page Style when end of page is reached. This condition may be enabled with a manual page break. However, if you specify a page number in the page break (this is necessary to be able to force a page number after the break), it looks like this causes a second page break:

  • the first page break is the consequence of the page style switch after the manual break
  • the second page break results from the consideration for the requested page style, Writer not seeing that it is the same as the one currently active

I tried to circumvent the mishap by encoding the page break in Text Flow tab of Contents Heading paragraph style but I get the same behaviour.

I experimented in a blank document to make sure page styles were configured “as usual”, with controlled page breaks and the same phenomenon occurs. So this is a bug, unless developers explain the behaviour.

EDIT
This was already reported in tdf#137035. The behaviour is considered “normal” to preserve page parity: right pages have always odd numbers and left pages even numbers. However, since I consider there are cases where we print single-sided, I filed tdf#150913 to challenge the dismissal of the previous bug report.
END_EDIT

Page count

Field page count returns the total number of pages. Consequently, you can’t ignore the cover page and any automatically added blank pages to keep only the number of “internal contents” pages. Your document has either 3 pages (without the spurious page break) or 4 pages (including the added blank pages. It never has 2. You can’t print x/2 in the footer.

Didn’t happen to me in LO 7.3.5.2.
Your second idea is nice. I changed the Next page for the First Page page style to Left page, and inserted a manual break with Default Page for the next page, and that didn’t bring up the blank page. So far, so good. But - you want the TOC and subsequent pages to start on a right page, anyway.

It crashes for me too if I try to edit the page break. Thanks for your comments, both you and ajilittoz (also, thanks for reporting the bug).

How can I disable the blank pages? because I tried with Ctrl+P (printing the document) but I found no option for that

File - Print. On the dialog box, select the LibreOffice Writer tab. At the bottom is an option to Print automatically inserted blank pages. Leave it unticked if you don’t want that blank page.

Oh, it’s already unchecked, I thought that was the setting that enabled the blank pages. How can I turn this off?

My mistake. You can’t disable inserted blank pages. You can disable printing them.

what a pity, is there any way to exclude blank pages from total amount of pages of the document or to subtract a number from the total?

The only way is to avoid creating blank pages. Unfortunately, when forcing page number after the break, Writer wants to enforce “parity location”, i.e. odd-numbered pages at right and even-numbered at left, even when you’re not printing duplex.

There is absolutely no way to interfere with total page count. The field returns the total number of sheets making up the document, full stop. However, there is a trick to retrieve the number of pages in each chapter. Thus you could have <page number>/<pages in this chapter>, resetting page number to 1 at start of each chapter. Combined with the option not to print blank pages, this could approximate what you’re looking for.