[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple substitution for oddFooterMarkup?
From: |
Trevor Bača |
Subject: |
Re: Simple substitution for oddFooterMarkup? |
Date: |
Thu, 2 Nov 2006 10:08:29 -0600 |
On 11/2/06, Mats Bengtsson <address@hidden> wrote:
Trevor Bača wrote:
> Hi,
>
> I've been looking over 12.1 and 12.4 and I'm still struggling with the
> following task:
>
> I want to store
>
> boldPageNumber = \markup { \fill-line { \bold \fontsize #3
> \on-the-fly #print-page-number-check-first \fromproperty
> #'page:page-number-string } }
>
> in a standard include file called standard.ly and then write
>
> \include "standard.ly"
>
> \paper {
> oddFooterMarkup = \boldPageNumber
> }
>
> This isn't right, however. The interpreter says
>
> Parsing...ERROR: Unbound variable: print-page-number-check-first
>
> Can anyone help with the right way to store the longish markup command
> in an external file for inclusion later in the paper block?
>
You probably have to copy the definition of
print-page-number-check-first from
ly/titling-init.ly into your include file. The reason is probably that
it's defined using
(define ...) instead of (define-public ...) and that your function
definition is
outside the "scope" of the definitions in titling-init.ly (I don't know
any details
on how this works, though).
Hm; maybe it simplifies things a bit to get rid of the include file
and do the example in a single file like this?
%%% BEGIN %%%
\version "2.9.27"
boldNumber = \markup { \fill-line { \bold \fontsize #3 \on-the-fly
#print-page-number-check-first \fromproperty #'page:page-number-string
} }
\paper {
oddFooterMarkup = \boldNumber
}
\new Staff {
c'4
}
%%% END %%%
And here the same parser error arises ...
Parsing...ERROR: Unbound variable: print-page-number-check-first
... which makes me think that maybe there's something going on other
than a scoping error.
Come to think of it, is it even possible to define a substitution for
the righthand side of an assignment like this (where the righthand
side isn't actually a (music) expression but is markup instead)?
I'd love something like ...
boldNumber = "\markup { \fill-line { \bold \fontsize #3 \on-the-fly
#print-page-number-check-first \fromproperty #'page:page-number-string
} }"
\paper {
oddFooterMarkup = \eval boldNumber
}
... but this generates a syntax error:
Parsing...
342.ly:7:0: error: syntax error, unexpected '}', expecting '='
}
--
Trevor Bača
address@hidden