lilypond-user
[Top][All Lists]
Advanced

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

Re: Adding to header using module-define! and alist with markups


From: David Kastrup
Subject: Re: Adding to header using module-define! and alist with markups
Date: Thu, 02 Dec 2021 17:02:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Nate Whetsell <nathan.whetsell@gmail.com> writes:

> I’m trying to programmatically add items to score headers from an alist. This 
> works when an item consists of just a string. I can’t seem to get this to 
> work when an item is a markup, no matter how the markup is entered. Is there 
> some way to store markups in an alist, and then use those markups in a header?
>
> Below is an example illustrating the issue I’m having. Any help would be 
> greatly appreciated!
>
> Thanks,
> Nate
>
> ```
> \version "2.22.0"
>
> \paper {
>   scoreTitleMarkup = \markup {
>     \column {
>       \fromproperty #'header:piece
>       \justify-field #'header:instruction
>     }
>   }
> }
>
> #(define instructions '(
>   ; Using a LilyPond code block does not work.
>   (1 . #{
>     \markup {
>       "Does not work"

' introduces a non-evaluated constant expression but you need to
evaluate #{ ... #} to get a markup.  So try

#(define instructions `( ;; note backtick instead of forward tick
  (1 . ,#{               ;; note comma to evaluate one part of the
                         ;; quasi-quoted list

-- 
David Kastrup



reply via email to

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