lilypond-user
[Top][All Lists]
Advanced

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

Re: header markup puzzle


From: Simon Albrecht
Subject: Re: header markup puzzle
Date: Fri, 10 Oct 2014 01:47:02 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

Hello David,

I attach a file which should do what you want, and add some comments below:

Am 09.10.2014 um 23:50 schrieb Flaming Hakama by Elaine:
Hello,

I was wondering if anyone had suggestions for a text formatting challenge I've been unable to solve.

The format I like to use for header markup (for pages after page 1) is to have the page number centered with em dashes around it, and then split the title, with half on the left and half on the right.

The following code is what I am using, but I am not very happy with it.

The issues I'd like to solve are:

o How do I get the left/right sides of the title to right/left align next to the page number? I am doing it with literal spaces, but this is very unsatisfactory.
If you use \fill-line with three markups in its argument, the first is flush-left, the second is centered (at least approximately), and the third is flush-right. So use the poet as one markup, the whole split-title-and-page-number complex as one second markup (by enclosing it in \line), and the composer as third argument.

o How do I get an actual em dash rather than use "--"? I know that the code is \char ##x2014, but I cannot figure out how to use that in this header \on-the-fly context.
It’s easier anyway if you apply \on-the-fly to the entire markup as I did in the attached essay. And \char ##x2014 is inserted in precisely the same way as any other markup string.

o Is there a way to encapsulate this in a function, so I can just say something like:
\setSplitTitle "Example: Split" "Centered Title"
See <http://lilypond.org/doc/v2.18/Documentation/extending/new-markup-command-definition>. If you want a command which does not need to be wrapped into \markup {}, use #(define-scheme-function ), which should also be explained in the Extending Manual.

HTH,
Simon

Attachment: split-centered-title.ly
Description: Text document


reply via email to

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