lilypond-user
[Top][All Lists]
Advanced

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

Re: Accessing page number in markup for custom title


From: Han-Wen Nienhuys
Subject: Re: Accessing page number in markup for custom title
Date: Tue, 28 Jun 2005 22:46:18 +0200
User-agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513)

Rob Vlasaty wrote:
After looking at the titling-init.ly file, I copied and pasted a markup 
definition and tried to modify it to check for even or odd pages.  It seems to 
be only accessing the default value, instead of the page number.  Any ideas on 
what I'm doing wrong?

Rob



\version "2.5.31"

\paper {
  linewidth = 9.0\cm
  vsize = 10.0\cm

#(define (even-page layout props arg)
  (if (even? (chain-assoc-get 'page:page-number props -1) )
   (interpret-markup layout props arg)
   empty-stencil))
        
#(define (odd-page layout props arg)
  (if (odd? (chain-assoc-get 'page:page-number props -1) )
   (interpret-markup layout props arg)
   empty-stencil))
        

        scoreTitleMarkup = \markup {
                \fill-line {
                        \on-the-fly #even-page  "444"
                        \fromproperty #'header:piece
                        \on-the-fly #odd-page  "333"
        }

You cannot use the page number in the title. This is due to circularity: you would need the page number to determine the title, but the page number is determined by the page breaks, which are determined by (the height of) the title.


--
 Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

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