[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble defining markup functiion
From: |
David Kastrup |
Subject: |
Re: Trouble defining markup functiion |
Date: |
Thu, 17 Jan 2019 16:02:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Carl Sorensen <address@hidden> writes:
> I'm trying to define a markup function for establishing a common set of
> formatting for a number of text markups.
>
> %%% beginning of sample code
>
> \version "2.19.82"
>
> \displayScheme
> \markup{\sans{\fontsize #10 "C"}} % Just used to show the scheme markup
> command -- this is what I'm trying
>
> #(define-markup-command (chord-name-markup layout props chord-name) (markup?)
> "Display a chord name in the desired formatting"
> (interpret-markup layout props
> (make-line-markup (#:sans (#:fontsize 10 chord-name)))))
>
>
> \markup \chord-name-markup "E"
>
> %%% end of code
>
> I've used displayScheme to get the representation of the markup
> function. I've found that is uses #:line so that I have to use
> make-line-markup.
#:sans is garbage outside of the markup macro. Also make-line-markup
requires a list as its argument.
Your original
\markup{\sans{\fontsize #10 "C"}}
contains two levels of spurious braces. Those generate spurious markup
lists causing LilyPond to intersperse a \line call for converting back
to a single markup.
Any reason you don't use #{ \markup ... #} for constructing your markup?
That way you don't need to replace LilyPond's expertise for constructing
markups with your own.
--
David Kastrup