lilypond-user
[Top][All Lists]
Advanced

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

A solution to: Page breaks in 2.4 using \book


From: Walter Hofmeister
Subject: A solution to: Page breaks in 2.4 using \book
Date: Sun, 07 Nov 2004 14:03:15 -0600
User-agent: Microsoft-Entourage/11.0.0.040405

On 11/6/04 1:56 PM, "Joe Neeman" <address@hidden> wrote:

> I should really learn to press "Reply to List". Here's try number 2:
> 
>> Hello,
>>     I'm enjoying version 2.4 on Mac OS X. I am making some variations of an
>> exercise and would like to spread it out over two pages. I am not quite
>> happy with how it comes out and would like to insert a page break. Nothing I
>> seem to do has the desired effect. Reading the manual leads me to believe
>> that I need to place a \pageBreak command in the note data. Does this change
>> when one is using several \score sections within a \book block? If so where
>> should the command go?
> 
> I'm having a similar problem. I want a page break between movements.
> I've organised the file with one movement per \score block. If I put
> \pageBreak after a barline in the middle of the note data, it works. If
> I put it at the end of the note data, it doesn't work. Similarly,
> putting \pageBreak at the beginning of \score doesn't do anything. Is
> there a reason for this? Using lilypond-book just to page break between
> movements seems like a bit of overkill; is there a better way?
> 
> Thanks,
> Joe
> 
For all interested, I have come up with a solution that may be useful to
others. In my example I had a two line exercise and four variations, also
two lines each that I wanted to format over two pages as it would not fit on
one page. The default settings produced two results somewhat consistently
and I am not sure what made the layout come out differently. The initial
exercise and three variations would be on page one and the fourth on page
two. Alternately I sometimes got the first line of variation four on the
first page with the second line on page two.
    The solution seemed to involve spacing things out so that Lilypond chose
to put the third and fourth variations on the second page. This is what my
file ended up looking like:

\version "2.4.0"
\include "english.ly"
#(set-default-paper-size "letter")

\paper {
    betweensystemspace = 3 \cm
    aftertitlespace = 5 \mm
    betweentitlespace = 1 \cm
    beforetitlespace = 2 \cm
}

\book {
\header {
    title = "Variations on an Exercise by Barreiro"
}

%************************* THEME ******************************

\score {
   \header {
   piece = "Theme"
   }
   \new Staff <<
           \context Voice = one {
        \relative c'' {
   \clef treble
   \key c \major
   \time 4/4
   \stemUp

   <c e>4 <c e> <c e> <c e>
   <d f>4 <d f> <d f> <d f>
   <d f>4 <d f> <d f> <d f>
   <c e>4 <c e> <c e> <c e>            \break
   <a c>4 <a c> <a c> <a c>
   <a d>4 <a d> <a d> <a d>
   <g b>4 <g b> <g b> <g b>
   <g c>1
   \bar "|."
}

    }
    
    \context Voice = two {
    \relative c' {
    \key c \major
    \time 4/4
    \stemDown
    
    c4 c c c
    c4 c c c
    b4 b b b
    c4 c c c
    a4 a a a
    f'4 f f f
    g,4 g g g
    c1
    }
}
    >>
   %\layout { }
   %\midi { }
    }


%***************************** VARIATION 1 *********************************

\score {
   \header {
   piece = "Variation 1"
   }
   \new Staff <<
           \context Voice = one {
        \relative c'' {
    \clef treble
   \key c \major
   \time 4/4
   \stemUp
   
   c4 e c e
   d4 f d f
   d4 f d f
   c4 e c e                        \break
   a,4 c a c
   a4 d a d
   g,4 b g b
   <g c>1
   \bar "|."
    }
}
        \context Voice = two {
    \relative c' {
    \key c \major
    \time 4/4
    \stemDown
    
    c4 c c c
    c4 c c c
    b4 b b b
    c4 c c c
    a4 a a a
    f'4 f f f
    g,4 g g g
    c1
    }
}
    >>
   %\layout { }
   %\midi { }
    }


%******************************** VARIATION 2
*********************************

\score {
    \header {
    piece = "Variation 2"
    }
    
    \new Staff <<
        \context Voice = one {
        \relative c'' {
            \key c \major
            \time 4/4
            \stemUp
            
            e4 c e c
            f4 d f d
            f4 d f d
            e4 c e c                        \break
            c4 a c a
            d4 a d a
            b4 g b g
            <g c>1
            \bar "|."
            }
        }
        
        \context Voice = two {
        \relative c' {
            \key c \major
            \time 4/4
            \stemDown
            
            c4 c c c
            c4 c c c
            b4 b b b
            c4 c c c
            a4 a a a
            f'4 f f f
            g,4 g g g
            c1
            \bar "|."
            }
        }
    >>
    }


%******************************* VARIATION 3
**********************************

\score {
    \header {
    piece = "Variation 3"
    }
    
    \new Staff <<
        \context Voice = one {
            \relative c'' {
            \key c \major
            \time 4/4
            \stemUp
            
            c4 e c e
            d4 f d f
            d4 f d f
            c4 e c e                        \break
            a,4 c a c
            a4 d a d
            g,4 b g b
            <g c>1
            \bar "|."
            }
        }
        
        \context Voice = two {
            \relative c' {
            \key c \major
            \time 4/4
            \stemDown
            
            c2 c
            c2 c
            b2 b
            c2 c
            a2 a
            f'2 f
            g,2 g
            c1
            }
        }
    >>
    }

%***************************** VARIATION 4 *********************************

\score {
    \header {
    piece = "Variation 4"
    }
    
    \new Staff <<
        \context Voice = one {
            \relative c'' {
            \key c \major
            \time 4/4
            \stemUp
            
            e4 c e c
            f4 d f d
            f4 d f d
            e4 c e c                    \break
            c4 a c a
            d4 a d a
            b4 g b g
            <g c>1
            \bar "|."
            }
        }
        
        \context Voice = two {
            \relative c' {
            \key c \major
            \time 4/4
            \stemDown
            
            c2 c
            c2 c
            b2 b
            c2 c
            a2 a
            f'2 f
            g,2 g
            c1
            }
        }
    >>
    }
} 

********************** FILE ENDS HERE *********************************

Another interesting point is that the examples in the documentation show the
\paper block appearing at the end of the file. When I tried placing it
there, none of the settings seemed to have any effect. The lesson here is
that sometimes in lilypond it makes a difference where things (ie. Settings)
get placed. Presumably the layout has already been figured out by the time
lily gets to the end of the file where the settings might be.
    Another thing that occurred to me was that I'm not sure what one would
do if you had a piece that spanned more than two pages and you needed to be
able to control the page break for the second and third (or more) pages. I
guess having \pageBreak work would be very useful and necessary.

Walter Hofmeister






reply via email to

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