lilypond-devel
[Top][All Lists]
Advanced

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

Re: Pagebreak in lilypond-book


From: Mats Bengtsson
Subject: Re: Pagebreak in lilypond-book
Date: Mon, 09 May 2005 15:12:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414



Graham Percival wrote:

On 4-May-05, at 3:53 PM, Han-Wen Nienhuys wrote:

Graham Percival wrote:

Different circumstances -- I've got a four-page piece with only one rest that's near the midway point. I'd like to force a pagebreak at that rest to allow for page turning.


I still don't understand. Why are you using lilypond-book?


I've got a few collections of pieces created in the 2.2 days, well before \book. I spent many hours on the LaTeX formatting and macros, so I'd rather keep it as
lilypond-book.

An alternative would be to use \book for each piece individually, keeping the headers in LaTeX. Currently \book forces a newpage, so I'd need to turn that
off somehow.


??? When I try it here, I get a separate output PDF file for each
\book{...}. Bug or feature?
How can I use it to get all the resulting scores in the same file as
you describe it?

If you force a page-break, Latex (depending on page size settings) could put that system on a single page or commit other atrocities.


True, but LilyPond can commit similar atrocities. That's what proofreading is for. :) I know that manual breaks are often a bad idea, but this piece only has two rests
to turn pages, so I need to force a pagebreak at one of those rests.

You should have better results if you use \book; inside a lilypond-book document, \book will output each page as a single .eps , so \pageBreak will probably work.

I have only partial success here. When trying the example attached at
the end of this email, I only get the first score line of the first
page, the second one is lost. On the second page, I get the desired
two score lines. Please debug and fix before version 2.6!

What if I use an embedded LaTeX \newpage?

lilypond-book produces a .tex file that includes a "whole piece" .tex file. That
"whole piece" .tex file includes many .eps files.  If there's a
\markup{ \\newpage }
halfway through the .ly file, wouldn't it end up halfway through the .eps files ?
or would it end up at the beginning or end of the .eps files?


Alternatively I could try to redefine \betweenLilyPondSystem so that it acts like normal for most of the time, but does a \newpage when it gets to number 7.
That seems like a much worse solution than figuring out how to make
\pageBreak (or even defining a new \lpbookPageBreak macro) work
in lilypond-book.
With the default treatment in lilypond-book, where each score line
is typeset in its own .eps file, it would be extremely tricky to
implement a \lpbookPageBreak, since then lilypond would have to
report information back to lilypond-book on where it should insert
the page break.
However, if you use the completely undocumented feature that you only
get one .eps file per page if you enclose your \score in a \book,
then you could use normal \pageBreak, as soon as the bugs have been
fixed.

Example:
\documentclass[a4paper]{article}

\usepackage{graphicx}
\begin{document}

Hello!

\begin{lilypond}
  \book {
    \markup {
        \fill-line { "High up above" }
    }
    \score {
        <<
            \relative {
                \clef bass
                d,2 d c4 bes a2 \break
                c2 c d4 f g2 \pageBreak
                d2 d c4 bes a2 \break
                c2 c d4 f g2
            }
            \addlyrics {
                My first Li -- ly song,
                Not much can go wrong!
                Next page will be here
                or may -- be else -- where
            }
        >>
    }
    \markup {
        %%TODO: make \verse markup.
        \fill-line {
            \line {
                "2. "
                \column {
                    \line { My next Li-ly verse }
                    \line { Now it's getting worse! }
                }
            }
        }
    }
    \markup {
        \fill-line {
            \line {
                "3. "
                \column {
                    \line { My last Li-ly text }
                    \line { See what will be next! }
                }
            }
        }
    }
}
\end{lilypond}

\end{document}

   /Mats




reply via email to

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