page-break-permission = ##f doesn't work for the final manual \pageBreak

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

page-break-permission = ##f doesn't work for the final manual \pageBreak

Paul Morris
When using

  \override NonMusicalPaperColumn.page-break-permission = ##f

if the music doesn't easily fit on the last page (i.e. it needs to be vertically compressed to fit), then the final manual \pageBreak is ignored and an automatic page break occurs that causes the music to spill over onto an additional page.  See the three examples below.

The docs say: "When page-break-permission is overridden to false, Lily will insert page breaks at explicit \pageBreak commands and nowhere else."  
http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks
 
-Paul


%% EXAMPLE 1
\version "2.18.0"

\layout {
  \override NonMusicalPaperColumn.page-break-permission = ##f
}

music = \relative f' {
  e1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c f
}

\score { \music }
\score { \music }
\score { \music }
\score { \music }
\pageBreak

\score { \music }
\score { \music }
\score { \music }
\score { \music }
\pageBreak



%% EXAMPLE 2
\version "2.18.0"

\layout {
  \override NonMusicalPaperColumn.page-break-permission = ##f
}

music = \relative f' {
  e1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c f
}

\score { \music }
\pageBreak
\score { \music }
\pageBreak



%% EXAMPLE 3
\version "2.18.0"

\layout {
  \override NonMusicalPaperColumn.page-break-permission = ##f
}

music = \relative f' {
  e1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c f
  \pageBreak
  e1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c c
  c1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c f
  \pageBreak
}

\score { \music }

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

fedelogy
2014-02-23 20:46 GMT+01:00 Paul Morris <[hidden email]>:

> When using
>
>   \override NonMusicalPaperColumn.page-break-permission = ##f
>
> if the music doesn't easily fit on the last page (i.e. it needs to be
> vertically compressed to fit), then the final manual \pageBreak is ignored
> and an automatic page break occurs that causes the music to spill over onto
> an additional page.  See the three examples below.
>
> The docs say: "When page-break-permission is overridden to false, Lily
> will insert page breaks at explicit \pageBreak commands and nowhere else."
> http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks
>
> -Paul
>
>
> %% EXAMPLE 1
> \version "2.18.0"
>
> \layout {
>   \override NonMusicalPaperColumn.page-break-permission = ##f
> }
>
> music = \relative f' {
>   e1 c c c c c c c c c c c c c c c c c c c c c
>   c c c c c c c c c c c c c c c c c c c c c c f
> }
>
> \score { \music }
> \score { \music }
> \score { \music }
> \score { \music }
> \pageBreak
>
> \score { \music }
> \score { \music }
> \score { \music }
> \score { \music }
> \pageBreak
>

I'm not sure if it's really a bug. On 2.16.2 the same happens.
I guess that pageBreaks needs an object afterwards, otherwise it doesn't
make sense. You can use an empty \markup to work around the problem:

\version "2.18.0"

\layout {
  \override NonMusicalPaperColumn #'page-break-permission = ##f
}

music = \relative f' {
  e1 c c c c c c c c c c c c c c c c c c c c c
  c c c c c c c c c c c c c c c c c c c c c c f
}

\score { \music }
\score { \music }
\score { \music }
\score { \music }
\pageBreak

\score { \music }
\score { \music }
\score { \music }
\score { \music }
\pageBreak

\markup \null
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

Paul Morris
Federico Bruni-5 wrote
I'm not sure if it's really a bug. On 2.16.2 the same happens.
I guess that pageBreaks needs an object afterwards, otherwise it doesn't
make sense. You can use an empty \markup to work around the problem:
That's a helpful workaround (thanks!), although you end up with an extra blank page that you don't really want. So I'd say the need for such a workaround indicates an area for improvement (if not a bug).  

If the point of setting page-break-permission = ##f is to "insert page breaks at explicit \pageBreak commands and nowhere else" as the docs say...  and yet there is an easily reproducible case where breaks are always inserted where there is no explicit \pageBreak, despite the presence of an explicit \pageBreak where the break should go, and would go if there were more music after it...  I'd call that a bug.  

I assume that fixing this would entail improving \pageBreak so it works even when there is no object following it? (i.e. when it is the last command in the input)

If this is a "won't fix" then I'd suggest that that part of the docs should be edited to be more accurate, maybe to indicate this is a "known issue" or something like that.


Speaking of the docs for this, the example given here:
http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks

is not so good since the output is actually the same when you comment out the commands that it is intended to illustrate:

% \override NonMusicalPaperColumn.line-break-permission = ##f
% \override NonMusicalPaperColumn.page-break-permission = ##f

(It is a good demonstration of ragged-bottom and ragged-right, however.)  To improve it the number of measures on some of the lines and the number of lines per page would need to be increased so that they are large enough to trigger an automatic line break or page break if these commands were not present.  

Thanks for considering,
-Paul
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

Paul Morris
Here's a revision of that example[1] that does a better job of illustrating the effects of those two commands.  
-Paul

[1] http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks


\paper {
  indent = #0
  ragged-right = ##t
  ragged-bottom = ##t
}

music = \relative c'' { c8 c c c }

\score {
  \new Staff {
    \repeat unfold 2 { \music } \break
    \repeat unfold 2 { \music } \break
    \repeat unfold 4 { \music } \break
    \repeat unfold 6 { \music } \break
    \repeat unfold 8 { \music } \break
    \repeat unfold 10 { \music } \break
    \repeat unfold 12 { \music } \break
    \repeat unfold 14 { \music } \break
    \repeat unfold 12 { \music } \break
    \repeat unfold 10 { \music } \break
    \repeat unfold 8 { \music } \break
    \repeat unfold 6 { \music } \break
    \repeat unfold 4 { \music } \break
    \repeat unfold 2 { \music } \break
    \repeat unfold 2 { \music } \pageBreak
    \repeat unfold 2 { \music }
  }
  \layout {
    \context {
      \Score
      \override NonMusicalPaperColumn.line-break-permission = ##f
      \override NonMusicalPaperColumn.page-break-permission = ##f
    }
  }
}
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

fedelogy
In reply to this post by Paul Morris
2014-02-24 14:18 GMT+01:00 Paul Morris <[hidden email]>:

> Federico Bruni-5 wrote
> > I'm not sure if it's really a bug. On 2.16.2 the same happens.
> > I guess that pageBreaks needs an object afterwards, otherwise it doesn't
> > make sense. You can use an empty \markup to work around the problem:
>
> That's a helpful workaround (thanks!), although you end up with an extra
> blank page that you don't really want. So I'd say the need for such a
> workaround indicates an area for improvement (if not a bug).
>
>
No, my fault: you should change the value of ragged-last-bottom:

\paper {
  ragged-last-bottom = ##f
}


> If the point of setting page-break-permission = ##f is to "insert page
> breaks at explicit \pageBreak commands and nowhere else" as the docs say...
> and yet there is an easily reproducible case where breaks are always
> inserted where there is no explicit \pageBreak, despite the presence of an
> explicit \pageBreak where the break should go, and would go if there were
> more music after it...  I'd call that a bug.
>
> I assume that fixing this would entail improving \pageBreak so it works
> even
> when there is no object following it? (i.e. when it is the last command in
> the input)
>
>
You should ask a comment from a developer, but I don't think that this
request makes sense. Also because of ragged-last-bottom, which already
fixes this case.


> If this is a "won't fix" then I'd suggest that that part of the docs should
> be edited to be more accurate, maybe to indicate this is a "known issue" or
> something like that.
>
>
> Speaking of the docs for this, the example given here:
> http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks
>
> is not so good since the output is actually the same when you comment out
> the commands that it is intended to illustrate:
>
> % \override NonMusicalPaperColumn.line-break-permission = ##f
> % \override NonMusicalPaperColumn.page-break-permission = ##f
>
> (It is a good demonstration of ragged-bottom and ragged-right, however.)
>  To
> improve it the number of measures on some of the lines and the number of
> lines per page would need to be increased so that they are large enough to
> trigger an automatic line break or page break if these commands were not
> present.
>

Could you open a new thread  for this subject? I don't have time to look at
it now..
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

Paul Morris
On Feb 24, 2014, at 3:38 PM, Federico Bruni <[hidden email]> wrote:

> No, my fault: you should change the value of ragged-last-bottom:
>
> \paper {
>   ragged-last-bottom = ##f
> }

Ah, ok, thanks.  Glad to know there's already a way to achieve this.


> If the point of setting page-break-permission = ##f is to "insert page
> breaks at explicit \pageBreak commands and nowhere else" as the docs say...
> and yet there is an easily reproducible case where breaks are always
> inserted where there is no explicit \pageBreak, despite the presence of an
> explicit \pageBreak where the break should go, and would go if there were
> more music after it...  I'd call that a bug.
>
> I assume that fixing this would entail improving \pageBreak so it works even
> when there is no object following it? (i.e. when it is the last command in
> the input)
>
>
> You should ask a comment from a developer, but I don't think that this request makes sense. Also because of ragged-last-bottom, which already fixes this case.

Hmmm...  one way to look at this is that the docs here:
http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks

give the impression that LilyPond has a mode that will _only_ insert breaks where there are explicit break commands (***and nowhere else***).  But is that actually the case?  The following leads you to think there is such a "manual break only" mode:

"When line-break-permission is overridden to false, Lily will insert line breaks at explicit \break commands ***and nowhere else***. When page-break-permission is overridden to false, Lily will insert page breaks at explicit \pageBreak commands ***and nowhere else***."


But what it says at the top of that page is a little different:

"Lily sometimes rejects explicit \break and \pageBreak commands. There are two commands to override this behavior:"

If that is the more accurate account of what these commands do, then they don't really prevent automatic breaks from being inserted.  They just prevent explicit breaks from being ignored/rejected.  If that's the case then I think the next part should be revised like this:

"When line-break-permission is overridden to false, Lily will _always_ insert line breaks at explicit \break commands. When page-break-permission is overridden to false, Lily will _always_ insert page breaks at explicit \pageBreak commands."


Thanks for your help and for considering this.  I've started another thread about the example.

Cheers,
-Paul

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

Paul Morris
Paul Morris wrote
Hmmm...  one way to look at this is that the docs here:
http://lilypond.org/doc/v2.18/Documentation/notation/explicit-breaks

give the impression that LilyPond has a mode that will _only_ insert breaks where there are explicit break commands (***and nowhere else***).  But is that actually the case?  The following leads you to think there is such a "manual break only" mode:

"When line-break-permission is overridden to false, Lily will insert line breaks at explicit \break commands ***and nowhere else***. When page-break-permission is overridden to false, Lily will insert page breaks at explicit \pageBreak commands ***and nowhere else***."


But what it says at the top of that page is a little different:

"Lily sometimes rejects explicit \break and \pageBreak commands. There are two commands to override this behavior:"

If that is the more accurate account of what these commands do, then they don't really prevent automatic breaks from being inserted.  They just prevent explicit breaks from being ignored/rejected.  If that's the case then I think the next part should be revised like this:

"When line-break-permission is overridden to false, Lily will _always_ insert line breaks at explicit \break commands. When page-break-permission is overridden to false, Lily will _always_ insert page breaks at explicit \pageBreak commands."
I withdraw this suggestion, given the evidence in the other thread (that I started about the example on this page).

But that evidence further confirms to me that what I'm seeing here is indeed a bug, since it looks like no automatic page breaks should be inserted at all when page-break-permission is ##f (regardless of ragged-bottom or ragged-last-bottom settings).

As David Kastrup suggested on the user list this issue is probably related:
https://code.google.com/p/lilypond/issues/detail?id=3281

-Paul
Reply | Threaded
Open this post in threaded view
|

Re: page-break-permission = ##f doesn't work for the final manual \pageBreak

Eluze
Paul Morris wrote
But what it says at the top of that page is a little different:

"Lily sometimes rejects explicit \break and \pageBreak commands. There are two commands to override this behavior:"

If that is the more accurate account of what these commands do, then they don't really prevent automatic breaks from being inserted.  They just prevent explicit breaks from being ignored/rejected.  If that's the case then I think the next part should be revised like this:

"When line-break-permission is overridden to false, Lily will _always_ insert line breaks at explicit \break commands. When page-break-permission is overridden to false, Lily will _always_ insert page breaks at explicit \pageBreak commands."
I think there are 2 contexts where page breaks occur or don't:

in this example LilyPond does not allow a page break and compresses the first page like wild (but warns).

the following 3 \score's should be placed on 1 page but LilyPond silently goes to a new page when the page is full.

\layout{
  \context{
    \Score
    \override NonMusicalPaperColumn.page-break-permission = ##f
  }
}
\score{{\repeat unfold 105 {c'1 \break }}}
\pageBreak
\score{{ \repeat unfold 7 {c'1 \break }}}
\score{{ \repeat unfold 7 {c'1 \break }}}
\score{{ \repeat unfold 7 {c'1 \break }}}

Eluze