lilypond-user
[Top][All Lists]
Advanced

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

Re: suppress page number


From: Mark Polesky
Subject: Re: suppress page number
Date: Sat, 6 Dec 2008 16:58:41 -0800 (PST)

James,

Insert this code at the top of your file:

\version "2.11.65-1"
\include "titling-init.ly"
   
#(define (skip-two-page-numbers layout props arg)
  (if (or (> (chain-assoc-get 'page:page-number props -1) 
             (+ (ly:output-def-lookup layout 'first-page-number) 1))
          (eq? (ly:output-def-lookup layout 'print-first-page-number) #t))
      (create-page-number-stencil layout props arg)
      empty-stencil))

\paper {
  oddHeaderMarkup = \markup
  \fill-line {
    " "
    \on-the-fly #not-first-page \fromproperty #'header:instrument
    \on-the-fly #skip-two-page-numbers \fromproperty #'page:page-number-string
  }
  evenHeaderMarkup = \markup
  \fill-line {
    \on-the-fly #skip-two-page-numbers \fromproperty #'page:page-number-string
    \on-the-fly #not-first-page \fromproperty #'header:instrument
    " "
  }
}

____________________________________________________


Or better yet, save the code in its own file, call it "skip-2-pg-nums.ly"
or whatever, then you can just include it this way:

\version "2.11.65-1"
\include "skip-2-pg-nums.ly"
\repeat unfold 4 { c''1 \pageBreak }

____________________________________________________


If you're already doing fancy stuff with oddHeaderMarkup or evenHeaderMarkup,
you'll need to incorporate that into this code. If you're scheme-curious, 
you can dig around the "titling-init.ly" file in the \ly\ folder. I replaced
the "print-page-number-check-first" function with my own 
"skip-two-page-numbers" function.

Hope this helps.
- Mark


      




reply via email to

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