%% 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 = "Expressive marks, Scheme, Text, Workaround"

  texidoc = "
The easiest way to parenthesize dynamics is to use the normal
@code{\\parenthesize} command and adjust the font size, e.g.,
@code{@{ c'4\\tweak Parentheses.font-size 2 \\parenthesize \\f @}}.
However, this results in upright parentheses, while dynamic marks are
normally slanted. This snippet gives a method to make the parentheses
slanted as well.
"

  doctitle = "Slanted parentheses around dynamics"
} % begin verbatim


paren =
#(define-event-function (dyn) (ly:event?)
   (make-dynamic-script
    #{ \markup \concat {
         \normal-text \italic \fontsize #2 (
         \pad-x #0.2 #(ly:music-property dyn 'text)
         \normal-text \italic \fontsize #2 )
       }
    #}))

\relative c'' {
  c4\paren\f c c \dynamicUp c\paren\p
}
