%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
  categories = "Spacing, Tweaks and overrides, Workaround"

  texidoc = "
For all @code{DynamicLineSpanner} objects (i.e., hairpins and dynamic
texts), the vertical minimum distance between their reference line and
the staff is given by the value in the @code{staff-padding} property,
unless other notation elements forces them to be farther away. Setting
this property to a sufficiently large value aligns the dynamics.

The same idea, together with @code{\\textLengthOn}, is used to align
text scripts along their baseline.
"

  doctitle = "Vertically aligned dynamics and textscripts"
} % begin verbatim


music = \relative c' {
  a'2\p b\f
  e4\p f\f\> g, b\p
  c2^\markup { \huge gorgeous } c^\markup { \huge fantastic }
}

{
  \music
  \break
  \override DynamicLineSpanner.staff-padding = 3
  \textLengthOn
  \override TextScript.staff-padding = 1
  \music
}
