Hi Andrew,

Ha! Works like a charm! Thanks, that's going to be super-handy when I, uh …
start my lilypond publishing empire. Seriously, though, that's some cool
scripting magic.

For others who might want to use the function, one remark: note that the
quotation marks for the "catalog-number" variable are not straight-quotes
in the provided example (they're so-called "smart-quotes", which Scheme
does not recognize and throws a syntax error if not replaced). So, make
that trivial change, and you're all set for automagically-generated catalog
IDs. I also re-named the variable to "composer-shortstring" to make clear
that it's not the definition set in \header, and that it can be a different
format from the full name.

Cheers,

A

On Mon, Feb 15, 2016 at 7:35 AM, Andrew Bernard <[email protected]>
wrote:

> Hi Andrew,
>
> If I follow you correctly, then this would work:
>
> Put these vars in directly in your lilypond file:
>
> composer = "Bob Smith"
> catalog-number = “001”
>
>
> In default.ily, create this function:
>
> #(define-markup-command (substitute layout props) ()
>    (interpret-markup layout props
>      (markup (string-append composer "." catalog-number))
>      ))
>
>
>
> Then use it in default.ily as follows:
>
>  \on-the-fly #not-part-first-page \line { Klang Büro \substitute }
>
>
> I am sure you can think of a better function name than I can.
>
> Obviously you can format the substitute string as per your desire.
>
> Andrew
>
>
>
>
>
>
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to