[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Protecting against page breaks in markup
From: |
Richard Shann |
Subject: |
Re: Protecting against page breaks in markup |
Date: |
Wed, 28 Nov 2018 09:19:37 +0000 |
On Tue, 2018-11-27 at 21:48 +0100, Thomas Morley wrote:
> Am Di., 27. Nov. 2018 um 16:22 Uhr schrieb Richard Shann
> <address@hidden>:
> >
> > I'm creating an index to my scores, in the form of a sequence of
> > LilyPond markups (for title, composer, first few bars etc).
>
> What exactly are you doing? An example would be nice.
Well, I have my printed scores of trio sonatas filed under composer but
I needed to find just those scores with a Tenor as the second part - I
have perhaps half-a-dozen of these, lost amongst just over a thousand
scores. So I thought I would write a script in Scheme that would
traverse the file system opening scores, extracting an incipit, title,
composer, instrumentation etc and then creating a new score that just
comprised top level markups, one for each entry. Each entry looks like
this:
\markup {\column {\draw-hline}}\markup "Fesch: Sonatina IV"
\markup {instrumentation:Treble, Tenor, Basso}
DenemoGlobalTranspose = #(define-music-function (parser location
arg)(ly:music?) #{\transpose c' c'#arg #})
incipit =
\markup \score {\DenemoGlobalTranspose
{ \clef treble
{ \time 3/4 }
{ \key f \major}
%{/home/rshann/musicScores/Fesch/IMSLP270267-PMLP437812-fesch_op7_1.pdf:202:7724:9%}
d'' 4 g' 4. ees'' 8 d'' 4 g' 4. bes'' 8
}
\layout {indent = 0.0\cm }
}
\incipit
This all works nicely, and I even managed to allow the user to supply a
custom Scheme expression to act as a filter, but I was left with the
problem that LilyPond would page break in mid-entry.
>
> > It is working well apart from page breaking which can occur mid-
> > entry.
> > Is there a way of turning page breaks off and back on around each
> > entry?
>
> Well, of course you know about \noPageBreak and \pageBreak.
>
> Probably you can wrap a \column around all the single markups. At
> least page-break can then only happen before or after the whole
> thingy.
Ah, thank you - that works. I just looked back at the docs and I see it
says
"The default page breaking may be overridden by inserting \pageBreak or
\noPageBreak commands.
[...]
The \pageBreak and \noPageBreak commands may also be inserted at top-
level, between scores and top-level markups."
but I didn't spot where it said what the default page breaking is
(besides allowing breaks at bar lines), I think the last bit is the
clue - page breaks are allowed between top level markups, but nowhere
inside them.
I just hoped there might be a \pageBreaksOff and \pageBreaksOn command
lurking somewhere, hence my question. But now I look at it with a clear
understanding of where LilyPond might break it seems obvious where to
put in sufficient \noPageBreak commands to keep each entry un-split.
Richard
- Protecting against page breaks in markup, Richard Shann, 2018/11/27
- Re: Protecting against page breaks in markup, Flaming Hakama by Elaine, 2018/11/27
- Re: Protecting against page breaks in markup, Richard Shann, 2018/11/28
- Re: Protecting against page breaks in markup, Lukas-Fabian Moser, 2018/11/28
- Re: Protecting against page breaks in markup, Richard Shann, 2018/11/29
- Re: Protecting against page breaks in markup, Thomas Morley, 2018/11/29
- Re: Protecting against page breaks in markup, Richard Shann, 2018/11/29
- Re: Protecting against page breaks in markup, Thomas Morley, 2018/11/29
- Re: Protecting against page breaks in markup, David Kastrup, 2018/11/29
- Re: Protecting against page breaks in markup, Thomas Morley, 2018/11/29
- Re: Protecting against page breaks in markup, David Kastrup, 2018/11/30