lilypond-user
[Top][All Lists]
Advanced

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

Re: Access the first/last line of a markup


From: Urs Liska
Subject: Re: Access the first/last line of a markup
Date: Wed, 13 Mar 2019 18:50:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1


Am 13.03.19 um 09:34 schrieb Urs Liska:
...

Well, I *thought* I'd managed to integrate it in my project infrastructure, but as often the devil is in the details.

The solution works only if \apply-hack is basically the last markup command:

% This works
\markup \column \apply-hack { a column }
% but not this
\markup \apply-hack \column { a column }

In the first example the placeholder is overlaid over *every* column (or word in a \wordwrap context), but in the second example it is only attached to the *first* element.

The problem is that I have a function that takes markup? arguments - which of course may include all sorts of markup constructs. I have no idea how I could solve this. I'm afraid I would have to somehow parse the markup? argument recursively and use \apply-hack on *every* sub-element of the markup.

Well, I'll try further to get to grips with how markups are handled ...

Urs


Just for the record: I didn't manage to find an *automated* solution because I stopped searching when I found a workaround that is good enough for the use case: In the case of multiline markup I can simply apply the (renamed) \apply-hack function manually. This is not ideal because one of the project's main goals is to keep the content files clinically clean (they will be presented as part of the online edition), but the scores where this problem occurs are pretty much non-standard, and so it has been agreed upon to be more lenient with the code ...

Urs


reply via email to

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