Jump to content

Extracting text from markup: Difference between revisions

From LilyPond wiki
m Remove redundant category
m Use newer \relative syntax
 
Line 21: Line 21:
}
}


\relative c' {
\relative {
   c
   c'
}
}
</lilypond>
</lilypond>

Latest revision as of 19:40, 10 March 2026

This scheme function extracts a string from markup, removing any formatting information.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=747

#(define-markup-command (plain-text layout props arg)(markup?)
                        (interpret-markup layout props (markup (markup->string arg))))

ttt = \markup {
  \normal-text { good day and \concat { hello \bold { world } } \italic { and moon }  }
}

\header {
  title = \ttt
  subtitle = \markup { \normal-text { \italic { \plain-text \ttt } } }
  tagline = ##f
}

\paper {
  paper-height = 5\cm 
}

\relative {
  c'
}