wrong handling of page references

Christoph Wagner <[email protected]> Sun, 25 Jan 2026 21:19:28 +0100
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------nSEGaW7cs8UO9BNcjTxh8PRF
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I think I've found some problems with the page referencing using labels in LilyPond.

I've made a small example to illustrate the problem.

My real world use case is a roman numbered first bookpart followed by
some other arabic numbered bookparts.
The roman numbered bookpart should have its own page numbers
so I used

bookpart-level-page-numbering = ##t

for it.
That way the arabic default numbering for the other bookparts
starts from 1 as I want.
It looks good, but the problem are references to these pages.

Trying to use \with-link or \page-ref does not work
for the arabic numbered pages, cause the internal page numbering
is restartet.

If tried to debug that stuff a little.

There is a scheme variable called "label-page-table" to remember all labels and the pages where they appear.
For my attached example the content of the variable is:

((four . 2) (three . 1) (two . 2) (one . 1))

I think we have a conceptual problem here.
In my oppinion we have to separate real pdf page numbers and their appearance.

I would expect "label-page-table" to contain references to the real pdf pages like that:

((four . 4) (three . 3) (two . 2) (one . 1))

There should be another table associate the label to the page number that really appears:

((four . "2") (three . "1") (two . "II") (one . "I"))

or at least there should be a function to calculate these by the real pdf page numbers.

Maybe we could have a look at the page:page-number-string property of the pages.

The second thing is, that I want to see the appearance of the page using the
\page-ref command and not the pdf page number.

The expected output of the last page of my example should be
I
II
1
2

and every number should be linked to the correct page.

Can anyone confirm, that the current behaviour is a bug?

If so, maybe I can help to fix it.



--------------nSEGaW7cs8UO9BNcjTxh8PRF
Content-Type: text/x-lilypond; charset=UTF-8; name="with-link-test.ly"
Content-Disposition: attachment; filename="with-link-test.ly"
Content-Transfer-Encoding: base64

XHZlcnNpb24gIjIuMjUuMzIiCgpcYm9vayB7CgogIFxwYXBlciB7CiAgICBwcmludC1maXJz
dC1wYWdlLW51bWJlciA9ICMjdAogIH0KCiAgXGJvb2twYXJ0IHsKICAgIFxwYXBlciB7CiAg
ICAgIHBhZ2UtbnVtYmVyLXR5cGUgPSAjJ3JvbWFuLXVwcGVyCiAgICAgIGJvb2twYXJ0LWxl
dmVsLXBhZ2UtbnVtYmVyaW5nID0gIyN0CiAgICB9CgogICAgXGxhYmVsICMnb25lCiAgICBc
bWFya3VwICJyb21hbiBvbmUiCgogICAgXHBhZ2VCcmVhawoKICAgIFxsYWJlbCAjJ3R3bwog
ICAgXG1hcmt1cCAicm9tYW4gdHdvIgogIH0KICAlfQogIFxib29rcGFydCB7CiAgICBcbGFi
ZWwgIyd0aHJlZQogICAgXG1hcmt1cCAiYXJhYmljIG9uZSIKICB9CgogIFxib29rcGFydCB7
CiAgICBcbGFiZWwgIydmb3VyCiAgICBcbWFya3VwICJhcmFiaWMgdHdvIgogIH0KCiAgXGJv
b2twYXJ0IHsKICAgIFxtYXJrdXAgXGxlZnQtY29sdW1uIHsKICAgICAgXHdpdGgtbGluayAj
J29uZSBccGFnZS1yZWYgIydvbmUgIlgiICI/IgogICAgICBcd2l0aC1saW5rICMndHdvIFxw
YWdlLXJlZiAjJ3R3byAiWCIgIj8iCiAgICAgIFx3aXRoLWxpbmsgIyd0aHJlZSBccGFnZS1y
ZWYgIyd0aHJlZSAiWCIgIj8iCiAgICAgIFx3aXRoLWxpbmsgIydmb3VyIFxwYWdlLXJlZiAj
J2ZvdXIgIlgiICI/IgogICAgfQogIH0KfQo=

--------------nSEGaW7cs8UO9BNcjTxh8PRF--