Thomas Morley <[email protected]> writes:

> 2012/7/18 Specken Flecken <[email protected]>:
>> Dear lilypond people,
>>
>> Marek from the bug squad suggested, I should post this question here.
>> Does someone know a solution for the following problem:
>>
>> I want to distinguish odd and even lyrics lines, i.e. stanzas. I can
>> think of 3 variants:
>>
>>  1. Colored resp. light gray background,
>>  2. a vertical line after each even numbered stanza  or
>>  3. extra vertical spacing after each even numbered stanza.
>>
>> I would be grateful for suggestions how to accomplish this, e.g.
>> using scheme.
>
> Hi,
>
> I've no clue about 1. or 2., but following
> http://lsr.dsi.unimi.it/LSR/Item?id=641 I've defined a new
> AltLyrics-context. Offering more lower space and an altered font-shape
> and color.
>
> One problem persists. I didn't manage how to use a command like
> \override LyricText #'font-size = #-1 in \layout affecting both Lyrics
> _and_ AltLyrics.
> You can use \override Lyrics . LyricText #'font-size = #-1 in
> \lyricmode of both contexts. But in \layout you have to set it twice:
>
>        \context { \Lyrics \override LyricText #'font-size = #-1 }
>
> _and_
>
>        \context { \AltLyrics \override LyricText #'font-size = #-1 }
>
> Perhaps I overlooked something.

Why are you reentering all those engravers when you copy them from
\Lyrics anyway?  You can use

\layout { \override Lyrics.LyricText #'font-size = #-1 }

in order to catch all aliases of Lyrics in one fell swoop.  So this
gives

%% Implement an alternate lyric context
myLayout =
\layout {
  \context{
    \Lyrics 
    
    \description "Corresponds to a voice with lyrics.  Handles the
           printing of a single line of lyrics. More lower vertical space
           than default-Lyrics"
        
    \name "AltLyrics"
    \alias Lyrics

    \override LyricText #'font-shape = #'italic
    \override LyricText #'color = #(x11-color 'grey20)
    \override VerticalAxisGroup #'nonstaff-nonstaff-spacing =
           #'((basic-distance . 0)
              (minimum-distance . 5)  ;; <================ more lower space
              (padding . 0.2)
              (stretchability . 0))
        }
        
        \context {
                \Score
                \accepts AltLyrics
        }
        
        \context {
                \StaffGroup
                \accepts AltLyrics
        }
        
        \context {
                \ChoirStaff
                \accepts AltLyrics
        }
        
        \override Lyrics.LyricText #'font-size = #-1
}


-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to