]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/footnote-auto-numbering-vertical-order.ly
d229da8454df55067b42ec9faa65240c9cc11671
[lilypond.git] / input / regression / footnote-auto-numbering-vertical-order.ly
1 \version "2.15.25"
2 \header {
3   texidoc = "This regtest makes sure that footnote numbers are laid out
4 in 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 c' {
32         d4 e
33         \once \override FootnoteItem #'numbering-assertion-function =
34           #(lambda (grob) (make-footnote-numbering-assertion-function 0))
35         < f  a-\footnote #'(1 . -1) \markup { n } c >
36         \once \override FootnoteSpanner #'numbering-assertion-function =
37           #(simultaneous-footnote-numbering-assertion-function 2 4)
38         \footnote #'(1 . 1) #'Beam \markup { o }
39         \footnote #'(1 . 1) #'Hairpin \markup { p }
40         a8\< [ b c d ] a4 b c\f |
41         d a b c |\break
42         d,4 e
43         \once \override FootnoteItem #'numbering-assertion-function =
44           #(lambda (grob) (make-footnote-numbering-assertion-function 6))
45         < f  a-\footnote #'(1 . -1) \markup { n } c >
46         \once \override FootnoteSpanner #'numbering-assertion-function =
47           #(simultaneous-footnote-numbering-assertion-function 8 10)
48         \footnote #'(1 . 1) #'Beam \markup { o }
49         \footnote #'(1 . 1) #'Hairpin \markup { p }
50         a8\< [ b c d ] a4 b c |
51         d a b c\f |\pageBreak
52         d,4 e
53         \once \override FootnoteItem #'numbering-assertion-function =
54           #(lambda (grob) (make-footnote-numbering-assertion-function 12))
55         < f  a-\footnote #'(1 . -1) \markup { n } c >
56         \once \override FootnoteSpanner #'numbering-assertion-function =
57           #(simultaneous-footnote-numbering-assertion-function 14 16)
58         \footnote #'(1 . 1) #'Beam \markup { o }
59         \footnote #'(1 . 1) #'Hairpin \markup { p }
60         a8\< [ b c d ] a4 b c |
61         d a b c\! |\break
62       }
63       \new Staff \relative c' {
64         d4 e
65         \once \override FootnoteItem #'numbering-assertion-function =
66           #(lambda (grob) (make-footnote-numbering-assertion-function 1))
67         < f  a-\footnote #'(1 . -1) \markup { n } c >
68         \once \override FootnoteSpanner #'numbering-assertion-function =
69           #(simultaneous-footnote-numbering-assertion-function 3 5)
70         \footnote #'(1 . 1) #'Beam \markup { o }
71         \footnote #'(1 . 1) #'Hairpin \markup { p }
72         a8\< [ b c d ] a4 b c\f |
73         d a b c |\break
74         d,4 e
75         \once \override FootnoteItem #'numbering-assertion-function =
76           #(lambda (grob) (make-footnote-numbering-assertion-function 7))
77         < f  a-\footnote #'(1 . -1) \markup { n } c >
78         \once \override FootnoteSpanner #'numbering-assertion-function =
79           #(simultaneous-footnote-numbering-assertion-function 9 11)
80         \footnote #'(1 . 1) #'Beam \markup { o }
81         \footnote #'(1 . 1) #'Hairpin \markup { p }
82         a8\< [ b c d ] a4 b c |
83         d a b c\f |\pageBreak
84         d,4 e
85         \once \override FootnoteItem #'numbering-assertion-function =
86           #(lambda (grob) (make-footnote-numbering-assertion-function 13))
87         < f  a-\footnote #'(1 . -1) \markup { n } c >
88         \once \override FootnoteSpanner #'numbering-assertion-function =
89           #(simultaneous-footnote-numbering-assertion-function 15 17)
90         \footnote #'(1 . 1) #'Beam \markup { o }
91         \footnote #'(1 . 1) #'Hairpin \markup { p }
92         a8\< [ b c d ] a4 b c |
93         d a b c\! |\break
94       }
95     >>
96   }
97 }