Displaying "page x of y" in header / footer
Dear all, I can't find how to display the total number of pages in a score as part of the page header / footer. I tried adding a "theLastPage" label at the end of my score but it sometimes is off by one. I sadly cannot create a small snippet that reproduces the off-by one ("page 4 of 3") problem. Placing a label outside the last score block yields an unresolved label and page reference. For what it's worth, here's the stencil I'm currently using: \paper { oddHeaderMarkup = \markup \fill-line { \hspace #1 \concat { "page " \fromproperty #'page:page-number-string " of " \page-ref #'theLastPage "0" "?" } \hspace #1 } } evenHeaderMarkup = \oddHeaderMarkup } Any help is welcome. Best regards, Olivier ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Displaying "page x of y" in header / footer
Dear all, Replying to myself all I managed to do is the following "hack": add the following sneppet after the last \score {} block: \label #'theLastPage \markup \rounded-box { \tiny "" } Thios empty block displays nothing in the score and seems to solve the problem, although in a rather "hackish" way. Is there a "proper" way for reaching this? Best regards, Olivier On Fri, Dec 28, 2012 at 5:04 PM, Olivier Biot wrote: > Dear all, > > I can't find how to display the total number of pages in a score as part > of the page header / footer. > > I tried adding a "theLastPage" label at the end of my score but it > sometimes is off by one. I sadly cannot create a small snippet that > reproduces the off-by one ("page 4 of 3") problem. > > Placing a label outside the last score block yields an unresolved label > and page reference. > > For what it's worth, here's the stencil I'm currently using: > > \paper { > > oddHeaderMarkup = \markup \fill-line { \hspace #1 \concat { "page " > \fromproperty #'page:page-number-string " of " \page-ref #'theLastPage "0" > "?" } \hspace #1 } > > } > > evenHeaderMarkup = \oddHeaderMarkup > } > > Any help is welcome. > > Best regards, > > Olivier > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Displaying "page x of y" in header / footer
Dear all, Here's a trick that works better than the trick I posted earlier. Add the following at the end of the music expression (e.g. after the last note), or in a separate context having the same number of measures as the music you want to engrave: \label #'theLastPage Best regards, Olivier On Fri, Dec 28, 2012 at 5:34 PM, Olivier Biot wrote: > Dear all, > > Replying to myself all I managed to do is the following "hack": add the > following sneppet after the last \score {} block: > > \label #'theLastPage > > \markup \rounded-box { \tiny "" } > > > Thios empty block displays nothing in the score and seems to solve the > problem, although in a rather "hackish" way. > > > Is there a "proper" way for reaching this? > > > Best regards, > > > Olivier > > > > On Fri, Dec 28, 2012 at 5:04 PM, Olivier Biot wrote: > >> Dear all, >> >> I can't find how to display the total number of pages in a score as part >> of the page header / footer. >> >> I tried adding a "theLastPage" label at the end of my score but it >> sometimes is off by one. I sadly cannot create a small snippet that >> reproduces the off-by one ("page 4 of 3") problem. >> >> Placing a label outside the last score block yields an unresolved label >> and page reference. >> >> For what it's worth, here's the stencil I'm currently using: >> >> \paper { >> >> oddHeaderMarkup = \markup \fill-line { \hspace #1 \concat { "page " >> \fromproperty #'page:page-number-string " of " \page-ref #'theLastPage "0" >> "?" } \hspace #1 } >> >> } >> >> evenHeaderMarkup = \oddHeaderMarkup >> } >> >> Any help is welcome. >> >> Best regards, >> >> Olivier >> > > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user