lilypond-user
[Top][All Lists]
Advanced

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

How to store lengths in variables


From: Urs Liska
Subject: How to store lengths in variables
Date: Tue, 12 Dec 2017 11:40:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Hi,

I would like to parametrize my paper settings. But for that I need to either store the measurement unit in a variable (outside the paper block) or store the plain number in the variable and create a length from that within the paper block.

tm = 5\in

\paper {
  top-margin = #tm
}

This doesn't work because LilyPond doesn't recognize the "\in" in the toplevel variable definition.

And rather than using the LilyPond syntax I would need to store the settings in an alist like

values =
#'((top-margin . 5)
   (bottom-margin . 2.5))

etc. and retrieve those values in the paper definition.

So I need to either store the numbers together with their unit (so I can directly use them in the paper block) or have a way to "create" that variable from the stored number within the paper block.

Any pointers appreciated
Urs




reply via email to

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