lilypond-user
[Top][All Lists]
Advanced

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

use variable in \markup \override


From: Mark Knoop
Subject: use variable in \markup \override
Date: Wed, 16 Oct 2013 14:50:42 +0100

Is there any way to use a variable in a \markup \override? I'm trying
to find a way to include the same markup in different scores with
different staff sizes, paper sizes, etc. Therefore some distances need
to be scaled, including line-width, baseline-skip, etc.

For commands such as \vspace, this works fine (see example below), and
one can even do scheme maths in place, but the same technique fails for
\override. I know why (because the quote means that "gap" is not
evaluated as a number), but don't know how to work around this.

\version "2.17.28"

gap = 5
bskip = #'(baseline-skip . 5)

\markup {
  \override #bskip                   % <--- this does work
  %\override #'(baseline-skip . gap) % <--- this does not work
  \column {
    \line { line one }
    \vspace #gap
    \line { line two }
    \line { line \hspace #(* gap 4) three }
  }
}

Output with second override uncommented:

GNU LilyPond 2.17.28
Processing `combine.ly'
Parsing.../usr/local/lilypond/usr/share/lilypond/current/scm/stencil.scm:70:24:
In procedure ly:stencil-stack in expression (ly:stencil-stack next
Y ...): /usr/local/lilypond/usr/share/lilypond/current/scm/stencil.scm:70:24:
Wrong type argument in position 6 (expecting number): gap



-- 
Mark Knoop



reply via email to

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