X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Ffootnote-auto-numbering.ly;h=6de6c843e13c81e42a011a952f0c84d9926cb96f;hb=ece789bf5f661cb8f16b50f87a248dedd6e1d8d5;hp=fe4babe1a013ee17d0703a8648cc0cc05e1c19aa;hpb=54b02666750062788185bd3f99e644d621e348c2;p=lilypond.git diff --git a/input/regression/footnote-auto-numbering.ly b/input/regression/footnote-auto-numbering.ly index fe4babe1a0..6de6c843e1 100644 --- a/input/regression/footnote-auto-numbering.ly +++ b/input/regression/footnote-auto-numbering.ly @@ -1,8 +1,27 @@ -\version "2.15.7" +\version "2.19.21" \header { - texidoc = "Lilypond does footnotes." + texidoc = "This is an example of automatic footnote numbering +where the number is not reset on each page. It uses the default +numbering function, which assigns numbers starting at 1 to successive +footnotes. +" } +#(define (make-footnote-numbering-assertion-function n) + (lambda (x) + (if (not (= n x)) + (ly:error (_ "Expecting number ~a, got ~a") n x)))) + +#(define (simultaneous-footnote-numbering-assertion-function x y) + (lambda (grob) + (let ((n (if (grob::has-interface (ly:grob-parent grob Y) + 'beam-interface) + x + y))) + (lambda (x) + (if (not (= n x)) + (ly:error (_ "Expecting number ~a, got ~a") n x)))))) + \paper { reset-footnotes-on-new-page = ##f } @@ -11,29 +30,35 @@ \book { \markup { - a \footnote b c - \footnote d e - \footnote f g + a \auto-footnote b c + \auto-footnote d e + \auto-footnote f g } \markup { h i } \relative c' { -\autoFootnoteGrob #'NoteHead #'(1 . -1) \markup { j } -a b c d } + \once \override FootnoteItem.numbering-assertion-function = + #(lambda (grob) (make-footnote-numbering-assertion-function 3)) + \footnote #'(1 . -1) \markup { j } NoteHead + a b c d +} \pageBreak -\markup { k \footnote l m } +\markup { k \auto-footnote l m } -\relative c' { a1 } +\relative { a1 } -\relative c' { - d4 e - < f a-\autoFootnote #'(1 . -1) \markup { n } c > - \autoFootnoteGrob #'Beam #'(1 . 1) \markup { o } - \autoFootnoteGrob #'Hairpin #'(1 . 1) \markup { p } - a8\< [ b c d ] a4 b c | +\relative { + d'4 e + \once \override FootnoteItem.numbering-assertion-function = + #(lambda (grob) (make-footnote-numbering-assertion-function 5)) + < f \footnote #'(1 . -1) \markup { n } a c > + \once \override FootnoteSpanner.numbering-assertion-function = + #(simultaneous-footnote-numbering-assertion-function 6 7) + a8-\footnote #'(1 . 1) \markup { p } \< + -\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c | d a b c | d a b c | d a b c\f |