[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conditionally setting variables in \paper section
From: |
David Kastrup |
Subject: |
Re: Conditionally setting variables in \paper section |
Date: |
Fri, 30 Aug 2013 15:49:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Daniel Thompson <address@hidden> writes:
> Hi Folks
>
> I am trying to modify an shared include file the allow it to switch
> the score that uses it between A4 "normal" mode and an cut-down A5
> form (for an e-book reader).
>
> I can make set-paper-size conditional using a $(if construct but can't
> find a way to conditionally set the margins. I've constructed a tiny
> example showing what I have trouble with (it no longer shows my motive
> but does show my problem).
>
> --- cut here ---
> \version "2.16.2"
> \paper {
> $(if (ly:get-option 'binder-margins) #{
> left-margin = 20
> line-width = 180
> #})
> }
Well, inside of #{ ... #} there is music by default. If you want to
have an output block, you need to place it there. For me,
\version "2.16.2"
\paper {
$(if (ly:get-option 'binder-margins) #{
\paper {
left-margin = 20
line-width = 5
}
#})
}
\score { \relative { c4 d e f g a b c } }
appears to do the trick.
--
David Kastrup