lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pageNumber


From: Michael Werner
Subject: Re: pageNumber
Date: Sun, 12 Nov 2023 08:09:05 -0500

Hi David,

On Sun, Nov 12, 2023 at 7:18 AM bobroff@centrum.is <bobroff@centrum.is> wrote:
I have the following in my \paper block.  I want to eliminate the page number on page 1.  I have 'print-first-page-number = ##f' but the oddHeaderMarkup is overriding it.  Is there a way around this? Some sort of conditional? 

Turns out you just need to swap two lines. The \if conditional will apply to the next item ... and just the next item. It prints the next item if true, and leaves it blank if false. But the next item is the empty quotes, so something that's already empty. So just swap the \if conditional line down one to put it right before the page number line and all should be well.

  oddHeaderMarkup = \markup {
    \fill-line {
      "" \larger\bold "SCORE"
      \if \should-print-page-number
      \fromproperty #'page:page-number-string
    }
  }
 
There's also an alternative you can use, that kind of does this from the opposite viewpoint. This will print the page number unless it's the first page. Either should work, just going at things in two different ways. In some circumstances (special cases? tricky layouts?) one might be preferable over the other. But there are options to explore.

  oddHeaderMarkup = \markup {
    \fill-line {
      "" \larger\bold "SCORE"
      \unless \on-first-page
      \fromproperty #'page:page-number-string
    }
  }

For more details on these, have a look at:
http://lilypond.org/doc/v2.25/Documentation/notation/custom-layout-for-headers-and-footers
and
http://lilypond.org/doc/v2.25/Documentation/notation/conditional-markup
--
Michael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]