Bertalan Fodor (LilyPondTool) wrote:
Hi, I have a note with two simultaneous markups:

c''^"A"_"B"

I want to move "B" to be right below the note and not below the staff.
How to achieve that without instantiating a new Voice containing a hidden note? I couldn't find any other solutions.

Hi, Bertalan,


you can use the following tweaks:
    c ^"Barbara Ann in Barrabas' Inn"
    % Allow grob to go into the staff
    -\tweak #'outside-staff-priority #'()
    % Adjust position w.r.t. the note head's lower left corner
    -\tweak #'X-offset #0.5
    -\tweak #'Y-offset #-2
    -"Barbara Ann"

You might have to consider the warning section from http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Writing-text#Text-scripts as well as \textLengthOn and -Off there for longer scripts; see the attached snippet.


Cheers,
Alexander
\version "2.12.1"

\score {
  \new Staff \relative c'' {
    \textLengthOn
    c ^"Barbara Ann in Barrabas' Inn"
    % Allow grob to go into the staff
    -\tweak #'outside-staff-priority #'()
    % Adjust position w.r.t. the note head's lower left corner
    -\tweak #'X-offset #0.5
    -\tweak #'Y-offset #-2
    -"Barbara Ann"
    
    c

    \textLengthOff
    c ^"Barrabas' Inn"
    -\tweak #'outside-staff-priority #'()
    -\tweak #'X-offset #0.5
    -\tweak #'Y-offset #-2
    -"Barbara Ann"

    c
  }

  \layout {
    \context {
      \Score
      \override PaperColumn #'keep-inside-line = ##t
    }
  }
}

\score {
  \new Staff \relative c'' {
    \textLengthOn
    c ^\markup \with-dimensions #'(0 . 0) #'(0 . 0) "Barbara Ann in Barrabas' Inn"
    -\tweak #'outside-staff-priority #'()
    -\tweak #'X-offset #0.5
    -\tweak #'Y-offset #-2
    -"Barbara Ann"
    
    c

    \textLengthOff
    c
    -\tweak #'outside-staff-priority #'()
    -\tweak #'X-offset #0.5
    -\tweak #'Y-offset #-2
    -"Barbara Ann"

    c
  }

  \layout {}
}

Attachment: textscript-in-staff.pdf
Description: Adobe PDF document

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

Reply via email to