In file pages03.odt, pages are numbered from 0, with a page-number offset=-1, but the TOC ignores this offset and shows numbers as 2, 3, 4 instead of 1, 2, 3.
Steps to Reproduce:
1.make a multi-page doc, with a Heading2 in each page
2.insert a page number in header.
3.edit (R-click) the field page-number, set its offset=-1
4.insert a TOC, which list all Heading2's and their page-numbers —wrong, without offset.
TOC shows page-numbers without offset
TOC should show page-numbers as they appear in header.
User Profile Reset: No
Created attachment 158459 [details]
file with pages 0, 1, …
I confirm it with
Version: 220.127.116.11.alpha0+ (x64)
Build ID: eeb2d19e77d6dc47c68e8ba0920a02cf64a1247b
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win;
Locale: de-DE (de_DE); UI-Language: en-GB
I think, problem is a little bit broader. If I insert a cross reference and insert reference to page, I recieve the same wrong result.
This is not a bug.
> In file pages03.odt, pages are numbered from 0, with a page-number offset=-1
This implied that pages were numbered by the page number fields that were put to the headers. This is wrong. Pages are numbered not by any fields, but either automatically (from 1), or as a property of a page break (actually, a property of paragraph).
The page offset is used not to change page numbers, but as a means to refer to some other page, like "two pages before", or "next page". It is even documented on the respective help page :
> If you want to change the actual page number and not the displayed number, do
> not use the Offset value. To change page numbers, read the Page Numbers guide.
(In reply to Mike Kaganski from comment #3)
Your theoretical, convoluted and abstruse explanation may satisfy some LibreOffice designer, but it escapes me and, obviously, any reader, who should somehow understand that page 13 in the TOC really means page 12 in the document! The reader does not know or care about an ‘actual page number’ and a ‘displayed number’; he|she just sees a page number in the TOC, another in a header, and they should be equal. This is not ‘wrong’.
The LibreOffice design may use an internal page number (unknown to the author or the reader) that always starts at 1, but numbers displayed in the TOC and the text should be consistent and include the offset, which belongs to the document format chosen by the author.
You asically put a random number into a header (which you defined as 'page number minus one), and declared it "page number"). You also could just type "42" there in the header directly, and expect ToC to show that as the page number.
If you don't see why a field does not define a page number: just copy that page number near the first, and in the second one, replace offset from -1 to +2. Now you have two different arbitrary numbers in the header; which should appear in ToC?
Please acknowledge that if user does not understand something, it's not *always* a bug: sometimes one needs to learn the tool.
*** This bug has been marked as a duplicate of bug 35694 ***
(In reply to Mike Kaganski from comment #5)
> You asically put a random number into a header (which you defined as 'page
> number minus one), and declared it "page number"). You also could just type
> "42" there in the header directly, and expect ToC to show that as the page
Mike, I disagree from a user perspective. We have a field called "page number". And you explain, that it is not the page number, but "a random number into the header"?
But I agree, that problem in docment is caused by using page offset. If you use the way, that is documented in LO help , result is the expected one.
(In reply to Dieter from comment #7)
> We have a field called "page
> number". And you explain, that it is not the page number, but "a random
> number into the header"?
OP considered it to be "set / define page number". It would be better named "*show* page number of a page relative to current". In case when you don't use an offset, it's equivalent to "*show* current page number". But in no case it is "define page number", and is just a label. So no different from any random number inserted into this position.