# Lilypond staffs extend past end of music

I'm writing a piece in Lilypond in verse/refrain form, in which the verses are only a singer ("Cantor") and a cello, and the refrain has SATB parts as well. I'm trying to use an explicit line break to cleanly end the SATB staffs at the end of the refrain. However, when I do, this is what I get:

when, of course, what I'd like from Lilypond is

I've seen this from Lilypond before, but it seems to happen with no great consistency, and remarkably never seems to affect the end of anything I write (it doesn't only happen if a staff ends in the middle of the piece, but always seems to go away before I'm finished), but I can't get this instance to go away.

So, StackExchange, what do I do? Bonus points if your solution allows me to put the linebreak at the 2/3 point in the bar so the pickup to the next measure is on the next line (I know how to do that by itself, but not without the staffs being messed up). Also, please focus your comments on the Lilypond issue and not the music on the page. I know it's not great.

• The usual advice for this is \layout { \context { \Staff \RemoveEmptyStaves }}. Is that not what you want? And for breaks at non-bar-line point the usual trick is to insert an invisible bar line via \bar"". – Kilian Foth Feb 17 '15 at 7:34
• Yep. I posted to the Lilypond mailing list and got the same answer, and it works like a charm. The breaks at non-bar-line points I had already done, but I removed them in hopes of solving this problem. I'm using \bar "||" \break to be sure there's a break, and add the barline to show the separation between verse and refrain as well. – Stankinator Feb 18 '15 at 13:56

The usual advice for this is \layout { \context { \Staff \RemoveEmptyStaves }}. Does that do what you want?
For breaks at non-bar-line point the usual trick is to insert an invisible bar line via \bar"".