Excerpt from Behind Bars demonstrating inline time signatures

How can I create inline time signatures like those displayed in the above paragraph from Behind Bars inside a Lilypond \markup block? Do I need to manually draw the time signature, like a simpler version of this answer, or can I use Lilypond's native time signature engraver in a markup context instead of a music expression?

Context & optional follow-ups

  • I found the above excerpt in this answer to a different question while searching if someone else has already explained how to create inline time signatures. However, it's a scan of a book and not Lilypond output.
  • The \markup is primarily meant to be used as a header to organize the snippets I wrote about in my previous question by time signature more so than running paragraph text. I do not expect that there is a real difference between the two use cases, other than throwing in a \large for the headings.
  • For whatever reason, the Lilypond Scheme manual is ranked much lower on search engines than its notation or snippets manuals. This question feels like something that I've seen in the official documentation years ago when I first discovered Lilypond, but I can't seem to find the direct answer that my memory says should be there. The notation manual is clear that music expression can exist within markup blocks, but does not explain how to create an isolated musical object that is more complex than a single symbol/dynamic without putting an entire \score context within the markup. If this does exist like my memory says, where did I find it and (more importantly) what were the keywords you used to search?

3 Answers 3


Something like

\markup { The fraction \small \raise #1 \compound-meter #'(3 4) }



Nothing wrong with markup.

\markup \score {
  \new Staff \with { \override StaffSymbol.line-count = #0
             \remove "Clef_engraver"
    \time 3/4 e'16 16 16 16 16 16 16 16 16 16 16 16
    \time 6/8 16 16 16 16 16 16 16 16 16 16 16 16
    \time 12/16 16 16 16 16 16 16 16 16 16 16 16 16
  • 1
    That does not make just the time signature appear inline.
    – cjm
    Jan 17, 2022 at 0:24

If you need this more often:

#(define-markup-command (time layout props numer denom) (markup? markup?)
   (let ((stc1 (ly:stencil-aligned-to
                (interpret-markup layout props
                                  (markup #:dynamic #:fontsize -6 denom))
                X CENTER))
         (stc2 (ly:stencil-aligned-to
                (interpret-markup layout props
                                  (markup #:dynamic #:fontsize -6 #:lower 0.2 numer))
                X CENTER)))
     (ly:stencil-combine-at-edge stc1 Y UP stc2 0)))

\markup { For example, \concat {\time 3 4 ,} \time 6 8 and \time 12 16 are of equal bar length }

You cannot really use the engraver for this, as that is just some mechanism to decide where to create time signatures in scores.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.