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.
\version "2.25.32"
\book {
\paper {
print-first-page-number = ##t
}
\bookpart {
\paper {
page-number-type = #'roman-upper
bookpart-level-page-numbering = ##t
}
\label #'one
\markup "roman one"
\pageBreak
\label #'two
\markup "roman two"
}
%}
\bookpart {
\label #'three
\markup "arabic one"
}
\bookpart {
\label #'four
\markup "arabic two"
}
\bookpart {
\markup \left-column {
\with-link #'one \page-ref #'one "X" "?"
\with-link #'two \page-ref #'two "X" "?"
\with-link #'three \page-ref #'three "X" "?"
\with-link #'four \page-ref #'four "X" "?"
}
}
}