lilypond-user
[Top][All Lists]
Advanced

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

Re: two-column dialogue markup function(s)


From: David Kastrup
Subject: Re: two-column dialogue markup function(s)
Date: Fri, 27 Dec 2013 08:09:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Kieren MacMillan <address@hidden> writes:

> I’m trying to create a two-column dialogue markup function for my
> musical score(s), e.g.,
>
> *
>
> I’ve got this so far, but even it’s not working correctly:
>
> %%%%% BEGIN SNIPPET
>
> \version "2.17.97"
>
> #(define-markup-command (dialogue layout props charname text) (markup?
> markup?)
> #:properties ((line-width 12))
> (interpret-markup layout props
> #{\markup \line {
> \bold \concat { #charname : }
> \override #`(line-width . ,line-width) \wordwrap { #text } } #}))
>
> \markup \dialogue #”Kieren" #"This long line of text should wrap, into
> a column narrow enough to allow for two of these side-by-side on a
> single U.S. letter page. Furthermore, it should appear 'indented',
> i.e., the text should all sit to the right of the rightmost edge of
> the character name.”
>
> %%%%% END SNIPPET
>
> Any help would be appreciated.

The wrong quotes, Sir!.

Apart from that #:properties ((line-width 12)) will only use the 12 as a
default if it is left unspecified, and it never is unspecified.  You
need to use a non-predefined name for that kind of thing.

At any rate, the following should get you a bit further:

%%%%% BEGIN SNIPPET

\version "2.17.97"

#(define-markup-command (dialogue layout props charname text) (markup?
markup?)
(interpret-markup layout props
#{\markup \line {
\bold \concat { #charname : }
\override #'(line-width . 30)
  \wordwrap-string #text } #}))

\markup
\dialogue #"Kieren" #"This long line of text should wrap, into
a column narrow enough to allow for two of these side-by-side on a
single U.S. letter page. Furthermore, it should appear 'indented',
i.e., the text should all sit to the right of the rightmost edge of
the character name."
I'd actually lean towards _not_ using a markup? as the last argument but
a markup-list?.  Then the argument can be given as

\markup \dialogue Kieren { This long line ... }

which is more natural.

-- 
David Kastrup

reply via email to

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