lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function operating on header


From: Francisco Vila
Subject: Re: Function operating on header
Date: Thu, 12 Mar 2020 17:42:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

This shows that header fields behave just like plain markups and can be used inside other markups:

\header {
  title="The title"
  composer=\markup{Composer of \italic\title }
}
  { b }


On 7/3/20 18:50, Timothy Lanfear wrote:
On 07/03/2020 14:52, Noeck wrote:
Thank you, Timothy,

this is how far I got already. It is probably a step in the right
direction. But there are two issues with it:

1) I would like to use some Scheme code on the fields (with if etc),
    so I need the 'header:author as a string and #(markup->string …)
    did not work.
2) Can this be put in a command which I can move to a separate file?
    Like \evaluateHeaders

Cheers,
Joram

Ok, so here is an example of a function to create a bookpart consisting of a single blank page by clearing all the header variables. It should give some clues about how to construct a header in Scheme,


\version "2.19.80"

% Print a blank page
blankpage = #(define-void-function () ()
  (let ((bookpart #{ \bookpart { \paper { page-count = 1 print-page-number = ##f } \markup \null } #})
        (header   (make-module))
        (props    '(dedication title subtitle subsubtitle instrument
                    poet composer meter arranger opus piece copyright)))
    (for-each (lambda (prop) (module-define! header prop #f)) props)
    (ly:book-set-header! bookpart header)
    (ly:book-add-bookpart! $current-book bookpart)))


--
Francisco Vila, Ph.D. - Badajoz (Spain)
paconet.org , lilypond.es




reply via email to

[Prev in Thread] Current Thread [Next in Thread]