[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function operating on header
From: |
David Kastrup |
Subject: |
Re: Function operating on header |
Date: |
Fri, 13 Mar 2020 16:59:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Aaron Hill <address@hidden> writes:
> On 2020-03-12 11:49 am, Noeck wrote:
>> Thanks Francisco! That's great news!
>> It also works across separate header blocks and even from within
>> included files. And it is easier to turn it into a string than for the
>> \fromproperty mechanism. So this works for me:
>> \header {
>> title = "my title"
>> composer = "will be replaced"
>> }
>> % can also be included via \include
>> \header {
>> composer = \markup { Composer of \italic
>> #(string-append "»" (markup->string title) "«") }
>> % instead of string-append, I can now work with the string
>> }
>> % end of include
>> { b }
>
> It may be your intention, but markup->string strips out formatting.
> For markup that is just simple text, you would not notice any loss.
> But it is best to keep markup as markup in order to preserve
> formatting. You never know when your simple text today needs to
> become more complex later.
>
> Next, why use strings and string-append at all? \markup already
> supports the ability to concatenate multiple arguments into one. A
> simple markup list (i.e. #{ \markup { one two three } #}) joins items
> using word-space to separate them.
Uh, there is so much wrong in that statement... { one two three } is the
markup list here, and the three items are three separate items in that
list, not joined by anything. That's what makes it a _list_.
Now \markup <markup list> is a shorthand for \markup \line <markup list>
and it's the \line that joins a markup list into a single markup (of
course there are other such commands with different results) using
word-space as separator.
> If no spacing is desired, use \concat.
Yes, that is another one for turning a markup list into a single markup.
--
David Kastrup
- Function operating on header, Noeck, 2020/03/07
- Re: Function operating on header, Timothy Lanfear, 2020/03/07
- Re: Function operating on header, Noeck, 2020/03/07
- Re: Function operating on header, Timothy Lanfear, 2020/03/07
- Re: Function operating on header, Francisco Vila, 2020/03/12
- Re: Function operating on header, Noeck, 2020/03/12
- Re: Function operating on header, Aaron Hill, 2020/03/12
- Re: Function operating on header,
David Kastrup <=
- Re: Function operating on header, Noeck, 2020/03/13
- Re: Function operating on header, Timothy Lanfear, 2020/03/13
- Re: Function operating on header, Noeck, 2020/03/14
- Re: Function operating on header, Timothy Lanfear, 2020/03/14