[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Make left and right margin with text in it
From:       "Neil Puttock" <n.puttock () gmail ! com>
Date:       2008-04-29 22:16:46
Message-ID: 7ca3d5a30804291516q40f59ddbxa1c3ef22dfe6a91f () mail ! gmail ! com
[Download RAW message or body]

Hi Maarten,

2008/4/29 Maarten Deen <mdeen@xs4all.nl>:
> How do I accomplish the example in the attachment?

Why not take advantage of the fact that the Trio is a separate
movement, and have two scores in a \book; then you'll get the "Trio"
indent for free. Here's one way of doing it:

\version "2.11.45"
\book {
  \score {
    \new Staff \relative c'' {
      % make sure text on right stays within margin
      \override Score.PaperColumn #'keep-inside-line = ##t
      \time 2/4
      \repeat volta 2 {
        r8 c16 c c8 c
        c c c c
        r c r c16 c
        b8 b r c
      }
      \alternative {
        {
          r e16 e e8 e
          e r r4
        }
        {
          e8 r r4
          r g,8 e'
        }
      }
      \bar "||"
      \stopStaff
      % hide anchor note for text
      \hideNotes
      % get text as close to note as possible
      \override TextScript #'Y-offset = #'()
      c,1^\markup { \override #'(baseline-skip . 2.5) \column {
"Repeat first part" "then Trio" } }
    }
    \layout {
      % only required if there's only one stave in this score
      indent = 0.0\cm
    }
  }
  \score {
    \new Staff \relative c'' {
      \set Staff.instrumentName = \markup \huge "Trio"
      \time 2/4
      % we know the time signature already, kill this one
      \once \override Staff.TimeSignature #'stencil = ##f
      \grace { \stemDown c16[^( d e]) } f8 r f r
      f r a,8. a16
      % using \bar here for convenience
      \bar "|:"
      a4 a
      a a
      c2 ~
      c8 r a8. a16
    }
    % only required in version 2.11.45 to override new default behaviour
    \layout { ragged-right = ##f }
  }
}

Regards,
Neil



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic