%% http://lsr.di.unimi.it/LSR/Item?id=838 %LSR completed by P.P.Schneider on Feb. 2014 for v2.18 % These two lines are needed to force LilyPond to break only when % YOU tell it to, via \break and \page Break. You may not need the page-break one. %\layout { % \override Score.NonMusicalPaperColumn.line-break-permission = ##f % \override Score.NonMusicalPaperColumn.page-break-permission = ##f %} #(define ((bars-per-line-engraver bar-list) context) (let* ((working-copy bar-list) (total (1+ (car working-copy)))) `((acknowledgers (paper-column-interface . ,(lambda (engraver grob source-engraver) (let ((internal-bar (ly:context-property context 'internalBarNumber))) (if (and (pair? working-copy) (= (remainder internal-bar total) 0) (eq? #t (ly:grob-property grob 'non-musical))) (begin (set! (ly:grob-property grob 'line-break-permission) 'force) (if (null? (cdr working-copy)) (set! working-copy bar-list) (begin (set! working-copy (cdr working-copy)))) (set! total (+ total (car working-copy)))))))))))) % place inside a layout context like so: %\score { % \layout { % \context { % \Score % %use the line below to insist on your layout % %\override NonMusicalPaperColumn.line-break-permission = ##f % \consists #(bars-per-line-engraver '(4)) % } % } %}