lilypond-user
[Top][All Lists]
Advanced

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

Re: Using Scheme inside header markup


From: Nicolas Sceaux
Subject: Re: Using Scheme inside header markup
Date: Tue, 12 Jul 2005 14:33:18 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

"Sven Axelsson" <address@hidden> writes:

> Lilypond 2.6.0 Windows

> myCond = ##t
> \paper {
>     bookTitleMarkup = \markup {
>         \column {
>             \fill-line {
>                 \large \bold \fromproperty #'header:title
>                 \fromproperty #'header:meter
>                 \line { \fromproperty #'header:composer " " \italic
> \fromproperty #'header:arranger } 
>             }
>             #(if myCond ( #{\line { \fromproperty #'header:comment } #} ))
>         }
>     }
> }

> [...] but it always gives me a "unknown escaped string" for all the
> backslash expressions at the point right after \header, and
> "unexpected SCM_T" at the #(if statement.

#{ ... #} is for entering music expressions inside Scheme. What you want
here is to enter markup expressions. You can do that using the
'markup' macro. See the LilyPond manual:
http://lilypond.org/doc/v2.6/Documentation/user/out-www/lilypond/Markup-construction-in-Scheme.html

\version "2.7.0"
#(define my-cond #f)

\paper {
  bookTitleMarkup = \markup {
    \column {
      \fill-line {
        \large \bold \fromproperty #'header:title
        \fromproperty #'header:meter
        \line { \fromproperty #'header:composer " " 
                \italic \fromproperty #'header:arranger } 
      }
      #(ly:export (if my-cond 
                      (markup #:fromproperty 'header:comment) 
                      (markup)))
    }
  }
}

\header {
    title = "Title"
    meter = "Meter"
    composer = "Composer"
    comment = "Comment"
}

\relative c'' { a b c d }




reply via email to

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