Use scalar instead of embedded_scm for context mod overrides.
[lilypond/mpolesky.git] / ly / titling-init.ly
blob60c07e6ef0776102b59cbdcdedd2b07a5bd9db3e
1 \version "2.12.0"
3 slashSeparator = \markup {
4 \center-align
5 \vcenter \combine
6 \beam #2.0 #0.5 #0.48
7 \raise #0.7 \beam #2.0 #0.5 #0.48
10 tagline = \markup {
11 \with-url
13 %% todo: lilypond.org/music-engraving
14 #"http://lilypond.org/web/"
15 \line {
17 %% 2014 = em dash.
19 #(ly:export
20 (format "Music engraving by LilyPond ~a~awww.lilypond.org"
21 (lilypond-version)
22 (ly:wide-char->utf-8 #x2014)
27 #(define (print-all-headers layout props arg)
28 (if (eq? (ly:output-def-lookup layout 'print-all-headers) #t)
29 (interpret-markup layout props arg)
30 empty-stencil))
32 bookTitleMarkup = \markup {
33 \override #'(baseline-skip . 3.5)
34 \column {
35 \fill-line { \fromproperty #'header:dedication }
36 \override #'(baseline-skip . 3.5)
37 \column {
38 \huge \larger \bold
39 \fill-line {
40 \larger \fromproperty #'header:title
42 \fill-line {
43 \large \smaller \bold
44 \larger \fromproperty #'header:subtitle
46 \fill-line {
47 \smaller \bold
48 \fromproperty #'header:subsubtitle
50 \fill-line {
51 \fromproperty #'header:poet
52 { \large \bold \fromproperty #'header:instrument }
53 \fromproperty #'header:composer
55 \fill-line {
56 \fromproperty #'header:meter
57 \fromproperty #'header:arranger
63 scoreTitleMarkup = \markup { \column {
64 \on-the-fly #print-all-headers { \bookTitleMarkup \hspace #1 }
65 \fill-line {
66 \fromproperty #'header:piece
67 \fromproperty #'header:opus
72 %% Book first page and last page predicates
73 #(define (first-page layout props arg)
74 (define (ancestor layout)
75 "Return the topmost layout ancestor"
76 (let ((parent (ly:output-def-parent layout)))
77 (if (not (ly:output-def? parent))
78 layout
79 (ancestor parent))))
80 (if (= (chain-assoc-get 'page:page-number props -1)
81 (ly:output-def-lookup (ancestor layout) 'first-page-number))
82 (interpret-markup layout props arg)
83 empty-stencil))
85 #(define (last-page layout props arg)
86 (if (and (chain-assoc-get 'page:is-bookpart-last-page props #f)
87 (chain-assoc-get 'page:is-last-bookpart props #f))
88 (interpret-markup layout props arg)
89 empty-stencil))
91 #(define (not-first-page layout props arg)
92 (define (ancestor layout)
93 "Return the topmost layout ancestor"
94 (let ((parent (ly:output-def-parent layout)))
95 (if (not (ly:output-def? parent))
96 layout
97 (ancestor parent))))
98 (if (not (= (chain-assoc-get 'page:page-number props -1)
99 (ly:output-def-lookup (ancestor layout) 'first-page-number)))
100 (interpret-markup layout props arg)
101 empty-stencil))
103 %% Bookpart first page and last page predicates
104 #(define (part-first-page layout props arg)
105 (if (= (chain-assoc-get 'page:page-number props -1)
106 (ly:output-def-lookup layout 'first-page-number))
107 (interpret-markup layout props arg)
108 empty-stencil))
110 #(define (part-last-page layout props arg)
111 (if (chain-assoc-get 'page:is-bookpart-last-page props #f)
112 (interpret-markup layout props arg)
113 empty-stencil))
115 %% unused
116 #(define (not-single-page layout props arg)
117 (if (not (and (= (chain-assoc-get 'page:page-number props -1)
118 (ly:output-def-lookup layout 'first-page-number))
119 (chain-assoc-get 'page:last? props -1)))
120 (interpret-markup layout props arg)
121 empty-stencil))
123 #(define (create-page-number-stencil layout props arg)
124 (if (eq? (ly:output-def-lookup layout 'print-page-number) #t)
125 (interpret-markup layout props arg)
126 empty-stencil))
128 #(define (print-page-number-check-first layout props arg)
129 (if (or (not (= (chain-assoc-get 'page:page-number props -1)
130 (ly:output-def-lookup layout 'first-page-number)))
131 (eq? (ly:output-def-lookup layout 'print-first-page-number) #t))
132 (create-page-number-stencil layout props arg)
133 empty-stencil))
135 oddHeaderMarkup = \markup
136 \fill-line {
137 %% force the header to take some space, otherwise the
138 %% page layout becomes a complete mess.
140 \on-the-fly #not-first-page \fromproperty #'header:instrument
141 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string
144 evenHeaderMarkup = \markup
145 \fill-line {
146 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string
147 \on-the-fly #not-first-page \fromproperty #'header:instrument
151 oddFooterMarkup = \markup {
152 \column {
153 \fill-line {
154 %% Copyright header field only on first page.
155 \on-the-fly #first-page \fromproperty #'header:copyright
157 \fill-line {
158 %% Tagline header field only on last page.
159 \on-the-fly #last-page \fromproperty #'header:tagline