I'm trying to force a page break by using the manual page breaking mode in LilyPond. Yet, I cannot make a working example. Consider this snippet (main.ly
)
\version "2.22.2"
\include "lilypond-book-preamble.ly"
RightHand = {
<e g c>4 <e g c> <b d g> <b d g> |
<a c e> <a c e>8 <a c e> <a c e>4 <a c d> |
<e' g c>4 <e g c> <b d g> <b d g> |
<f' a>4 <e g>8 <d f> <c e g>4 <c e g> \bar "|."
}
LeftHand = {
c8 c'4 c16 f,16 g8 g,4 g'8 |
a,8 a'4 <g, g'>8 <f f'>8 f'4 f8 |
c8 c'4 c16 f,16 g8 g,4 g8 |
f8 f'4. c8 c'4 c8 \bar "|."
}
\paper {
page-breaking = #ly:page-turn-breaking
}
\score {
\new PianoStaff
<<
\new Staff {
\relative c' {
\clef G
\RightHand
\pageBreak
\RightHand
}
}
\new Staff {
\relative c, {
\clef F
\LeftHand
\pageBreak
\LeftHand
}
}
>>
}
How would I force a page break between the two lines? I tried replacing the \pageBreak
command with \pageTurn
, and also tried different ways to structure the score. None of them work, by which I mean that the resulting pdf is a one-page document with all the music on the same page.
I compile this example with
lilypond-book --pdf main.lytex
where the content of main.lytex
is
\documentclass[letterpaper,12pt]{article}
\begin{document}
\lilypondfile{main.ly}
\end{document}
and the resulting main.tex
is compiled with LaTeX.
\pageBreak
is the way to go. Could you elaborate on how exactly it doesn't work? I tried your snippet with v2.22.1 and it does work. It's not pretty but the\pageBreak
does what it should do. // By the way, you can get rid of one of those\pageBreak
s — as soon as a\pageBreak
is encountered in any single voice and staff, the whole system is broken off and it continues at the next page.\clearpage
in LaTeX.