- (let ((x (ly:modules-lookup scopes sym)))
- (if (markup? x) x "")))
- (define (has sym)
- (markup? (ly:modules-lookup scopes sym)))
-
- (let ((props (page-properties layout)))
-
- (interpret-markup
- layout props
- (make-override-markup
- '(baseline-skip . 4)
- (make-column-markup
- (append
- (if (has 'dedication)
- (list (markup #:fill-line
- (#:normalsize (get 'dedication))))
- '())
- (if (has 'title)
- (list
- (markup (#:fill-line
- (#:huge #:bigger #:bigger #:bigger #:bigger #:bold
- (get 'title)))))
- '())
- (if (or (has 'subtitle) (has 'subsubtitle))
- (list
- (make-override-markup
- '(baseline-skip . 3)
- (make-column-markup
- (list
- (markup #:fill-line
- (#:large #:bigger #:bigger #:bold (get 'subtitle)))
- (markup #:fill-line (#:bigger #:bigger #:bold
- (get 'subsubtitle)))
- (markup #:override '(baseline-skip . 5)
- #:column ("")))
-
- ))
- )
- '())
-
- (list
- (make-override-markup
- '(baseline-skip . 2.5)
- (make-column-markup
- (append
- (if (or (has 'poet) (has 'composer))
- (list (markup #:fill-line
- (#:bigger (get 'poet)
- #:large #:bigger #:caps
- (get 'composer))))
- '())
- (if (or (has 'texttranslator) (has 'opus))
- (list
- (markup
- #:fill-line
- (#:bigger (get 'texttranslator) #:bigger (get 'opus))))
- '())
- (if (or (has 'meter) (has 'arranger))
- (list
- (markup #:fill-line
- (#:bigger (get 'meter) #:bigger (get 'arranger))))
- '())
- (if (has 'instrument)
- (list
- ""
- (markup #:fill-line (#:large #:bigger (get 'instrument))))
- '())
-;;; piece is done in the score-title
-;;; (if (has 'piece)
-;;; (list ""
-;;; (markup #:fill-line (#:large #:bigger #:caps (get 'piece) "")))
-;;; '())
- ))))))))))
-
-
-(define-public (default-user-title layout markup)
- "Generate book title from header markup."
- (if (markup? markup)
- (let ((props (page-properties layout))
- (baseline-skip (chain-assoc-get 'baseline-skip props 2)) )
- (stack-lines DOWN 0 BASELINE-SKIP
- (list (interpret-markup layout props markup))))))
-
-(define-public (default-score-title layout scopes)
- "Generate score title from header strings."
+ (ly:output-def-lookup layout sym))
+
+ (define (interpret-in-page-env potential-markup)
+ (if (markup? potential-markup)
+ (let* ((alists (map ly:module->alist scopes))
+ (prefixed-alists
+ (map (lambda (alist)
+ (map (lambda (entry)
+ (cons
+ (string->symbol
+ (string-append
+ "header:"
+ (symbol->string (car entry))))
+ (cdr entry)))
+ alist))
+ alists))
+ (pgnum-alist
+ (list
+ (cons 'header:tagline
+ (ly:modules-lookup scopes 'tagline
+ (ly:output-def-lookup layout 'tagline)))
+ (cons 'page:is-last-bookpart is-last-bookpart)
+ (cons 'page:is-bookpart-last-page is-bookpart-last-page)
+ (cons 'page:page-number-string
+ (number->string page-number))
+ (cons 'page:page-number page-number)))
+ (props (append
+ (list pgnum-alist)
+ prefixed-alists
+ (layout-extract-page-properties layout))))
+ (interpret-markup layout props potential-markup))
+
+ empty-stencil))
+
+ (interpret-in-page-env
+ (if (and (even? page-number)
+ (markup? (get what-even)))
+ (get what-even)
+ (get what-odd))))
+(export marked-up-headfoot)
+
+(define ((marked-up-title what) layout scopes)
+ "Read variables @var{what} from @var{scopes}, and interpret it as markup.
+The @var{props} argument will include variables set in @var{scopes} (prefixed
+with `header:'."