Writer Guide 25.2 - page cross-referencing texts gone astray

After having switched to the WG 25.2, I have regrettably come to realize that I haven’t come across one single page cross-referencing that is correct textwise. Clicking the incorrect page numbers in the pdf-version, does, however, move focus to the correct page. Some examples:

P. 245 last para: Refers to page 261, should be 246.
P. 279 first para refers to page 306, should be 291
P. 285 second para -"- , -"-
P. 279 fourth para refers to page 296, should be 281
P. 298 para beneath bullets refers to page 334, should be 317
P. 301 first para under figure refers to page 329, should be 312

As one can see, there is no consistent type of error, so I have myself no clue what’s happened here.
EDIT But the error seems to be about 15 pages, which happens to be about the number of pages before Chapter 1 starts. Can this have something to do with that the consolidated (master) document treats the sub-documents differently from 24.8, as is visible if one look at how the Sections structure displays?

No, looking even more closely, it appears that the spread of deviation between the now rendered cross-referenced text page numbers, (by the way, the hover-on pop-up states correct number) and the true page number, is much larger than ca. 15 pages as I pointed to in OP. It starts at the beginning of the document with 1 page deviation, and ends up in 23 pages. There’s a steady increase through the document, but I cannot immediately see the system behind the error.

Thank you. I will look into this and correct the x-refs. I’ve seen similar problems before, due to a bug that had been fixed.

Hi @jeanweber

The original PDF published was broken so I had to jump in and fix it.

The files in the Published folder were modified and several formatting issues were fixed (e.g. images frames not anchored as characters in a “figure” para style, replaced style caption by “figure”, all flagged by the sanity check extension)

I also refactored the sections according to the template.

Not a single word or comma was edited.

Cheers

Olivier

Hi @espen

PLease can you check again since I refactored the PDF file recently?

I can’t follow your examples in the PDF of WG252 currently

Cheers

Olivier

This seems a bug whit page counter of hidden sections in cross-references

Regrettably, the error seems to persist in the document you linked to. Checked with a couple of the first page x-references that still deviated with one page, and with a couple of the last ones, where the deviation was about 20 pages (the latter somewhat reduced from OP…)

I have observed something possibly related by comparing the published consolidated WG 24.8 (WG248-WriterGuide.odt) and WG 25.2 (WG252-WriterGuide.odt):

Looking at Headings in the Document structure in Navigator In the WG 25.2, one can see the Copyright heading listed in all Chapters, which was not the case in the WG 24.2.

But then I see the whole section structure differs also with a chapter file named section encompassing both the SEC_LOGO and SEC_DISPLAYAREA sections (or the subsequent numbered corresponding sections) – with and intermediate, greyed-out section in between – in WG 25.2. WG 24.8 only displayed the logo and main sections for each chapter.

The situation of the sections in the chapters has changed slightly to make the online guides (now the copyright section is a Subsection of Displayarea).

Each guide chapter has a copyright section with the name of collaborators of that chapter and the corresponding index.

When creating the full guide with a master document,
The copyright sections of each chapter are hidden because the guide already has a section with all the collaborators and the complete index.

When the sections are hidden the number of pages in the footer is fine (The Pages of the Hidden Sections are not counted). But in cross-references the pages of the hidden sections are also counted,

The situation of the reference to the page (in different chapters) makes that the difference in the referenced page number and the page number in the footer is not constant. Each chapter adds 2 or 3 pages from its hidden section.

I think it is a bug.The pages of the hidden sections should not be taken into account for the document page numbers or in the cross references to pages

Hi
Let me explain the issue after @bantoniof insight.

Each chapter in the book has a section named SEC_COPYRIGHT.

The section SEC_COPYRIGHT holds the copyright bla-bla-bla and the chapter’s table of contents.

The section SEC_COPYRIGHT visibility is controlled by a variable named “book”. It is the “1” just after the first paragraph of the book just after the cover.

When “book eq 1” the chapter section SEC_COPYRIGHT is hidden.
When “book” is something else or undefined, the section SEC_COPYRIGHT is shown.

This allows us to compile the book by hidding the chapter’s copyright and ToC section.

Clearly we have a bug here, the page references are misplaced because of the hidden sections.

To verify, pick the guide ODT file in the and change the variable book to “0”.

The book will show all the sections SEC_COPYRIGHT, the main ToC will show the new entries, and the number of pages will increase to ~550 pages.

But now you can click on the reference “on page NNN” and you will land in the right page.

The bug reported is 165472 – Hidden sections breaks page cross-references in text.

A temporary fix is to manually remove the offending section SEC_COPYRIGHT in the compiled book (NOT in the chapters !!!) and rebuild the PDF.

Cheers
Olivier