%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "snippets/breaking-horizontal-alignment-of-dynamics-and-textscripts.ly"
\sourcefileline 0
%% 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 {
%% Translation of GIT committish: 1abe87de51b9b00a391da1be4cf4b5ebe4021ca9
  texidocfr = "
Par défaut, LilyPond utilise des objets @code{DynamicLineSpanner} pour
aligner horizontalement une succession d'objets nuance tels que
soufflets et indications textuelles, et quel que soit leur
positionnement par rapport à la portée. Ceci peut, parfois, ne pas être
désirable et une rupture de l'étendue de l'alignement n'est pas possible
comme en matière d'alignement vertical (voir l'exemple « Rupture
d'alignement vertical des nuances graphiques et textuelles »).

Deux solutions permettent de pallier ce désagrément.

@itemize
@item
Modifier la propriété @code{shorten-pair} de l'objet @code{Hairpin} pour
compenser le décalage qui a été apppliqué au soufflet.
@item
Placer les deux objets de nuance dans des voix différentes.
@end itemize

Le code ci-dessous illustre ces deux possibilités.
"

  doctitlefr = "Rupture d'alignement horizontal des nuances graphiques et textuelles"

  categories = "Spacing, Tweaks and overrides, Workaround"

  texidoc = "
LilyPond uses @code{DynamicLineSpanner} grobs to horizontally align
successive dynamic objects like hairpins and dynamic text, even if they
are positioned on different sides of a staff. This connection cannot be
broken, contrary to the vertical alignment (see snippet @qq{Breaking
vertical alignment of dynamics and textscripts}).

There are two solutions to circumvent the problem.

@itemize
@item
Modify the @code{shorten-pair} property of the @code{Hairpin} grob to
compensate the offset by which the hairpin was moved.
@item
Put the two dynamic objects into different voices.
@end itemize

Both solutions are demonstrated in this snippet.
"

  doctitle = "Breaking horizontal alignment of dynamics and textscripts"
} % begin verbatim


{
  <>^"default"
  f'_\pp ^\> f' f' f'\!
}

{
  <>^\markup { setting \typewriter shorten-pair }
  f'_\pp \tweak shorten-pair #'(-3 . 0) ^\> f' f' f'\!
}

{
  <>^\markup { using another \typewriter Voice context }
  << { f'^\> f' f' f'\! }
     \new Voice { s4_\pp } >>
}

\layout {
  line-width = 8\cm
  ragged-right = ##f

  \context {
    \Voice
    \override TextScript.staff-padding = #3.5
  }
}



% ****************************************************************
% end ly snippet
% ****************************************************************
