1\version "2.19.21"
2\header {
3  texidoc = "This regtest makes sure that footnote numbers are laid out
4in the correct vertical order.
5"
6}
7
8#(define (make-footnote-numbering-assertion-function n)
9  (lambda (x)
10    (if (not (= n x))
11      (ly:error (_ "Expecting number ~a, got ~a") n x))))
12
13#(define (simultaneous-footnote-numbering-assertion-function x y)
14  (lambda (grob)
15    (let ((n (if (grob::has-interface (ly:grob-parent grob Y)
16                                      'beam-interface)
17                 x
18                 y)))
19      (lambda (x)
20        (if (not (= n x))
21          (ly:error (_ "Expecting number ~a, got ~a") n x))))))
22
23\paper {
24  reset-footnotes-on-new-page = ##f
25}
26
27#(set-default-paper-size "a6")
28\book {
29  \score {
30    <<
31      \new Staff \relative {
32        d'4 e
33        \once \override FootnoteItem.numbering-assertion-function =
34          #(lambda (grob) (make-footnote-numbering-assertion-function 0))
35        < f \footnote #'(1 . -1) \markup { n } a c >
36        \once \override FootnoteSpanner.numbering-assertion-function =
37          #(simultaneous-footnote-numbering-assertion-function 2 4)
38        a8-\footnote #'(1 . 1) \markup { p } \<
39	-\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c\f |
40        d a b c |\break
41        d,4 e
42        \once \override FootnoteItem.numbering-assertion-function =
43          #(lambda (grob) (make-footnote-numbering-assertion-function 6))
44        < f \footnote #'(1 . -1) \markup { n } a c >
45        \once \override FootnoteSpanner.numbering-assertion-function =
46          #(simultaneous-footnote-numbering-assertion-function 8 10)
47        a8-\footnote #'(1 . 1) \markup { p } \<
48	-\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c |
49        d a b c\f |\pageBreak
50        d,4 e
51        \once \override FootnoteItem.numbering-assertion-function =
52          #(lambda (grob) (make-footnote-numbering-assertion-function 12))
53        < f  \footnote #'(1 . -1) \markup { n } a c >
54        \once \override FootnoteSpanner.numbering-assertion-function =
55          #(simultaneous-footnote-numbering-assertion-function 14 16)
56        a8-\footnote #'(1 . 1) \markup { p } \<
57	-\single\footnote #'(1 . 1) \markup { o } Beam [ b c d ] a4 b c |
58        d a b c\! |\break
59      }
60      \new Staff \relative {
61        d'4 e
62        \once \override FootnoteItem.numbering-assertion-function =
63          #(lambda (grob) (make-footnote-numbering-assertion-function 1))
64        < f \footnote #'(1 . -1) \markup { n } a c >
65        \once \override FootnoteSpanner.numbering-assertion-function =
66          #(simultaneous-footnote-numbering-assertion-function 3 5)
67        a8-\single\footnote #'(1 . 1) \markup { p } Hairpin \<
68	-\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c\f |
69        d a b c |\break
70        d,4 e
71        \once \override FootnoteItem.numbering-assertion-function =
72          #(lambda (grob) (make-footnote-numbering-assertion-function 7))
73        < f \footnote #'(1 . -1) \markup { n } a c >
74        \once \override FootnoteSpanner.numbering-assertion-function =
75          #(simultaneous-footnote-numbering-assertion-function 9 11)
76        a8-\footnote #'(1 . 1) \markup { p } \<
77	-\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c |
78        d a b c\f |\pageBreak
79        d,4 e
80        \once \override FootnoteItem.numbering-assertion-function =
81          #(lambda (grob) (make-footnote-numbering-assertion-function 13))
82        < f \footnote #'(1 . -1) \markup { n } a c >
83        \once \override FootnoteSpanner.numbering-assertion-function =
84          #(simultaneous-footnote-numbering-assertion-function 15 17)
85        a8-\single\footnote #'(1 . 1) \markup { p } Hairpin \<
86	-\footnote #'(1 . 1) \markup { o } [ b c d ] a4 b c |
87        d a b c\! |\break
88      }
89    >>
90  }
91}
92