Next: , Previous: Text alignment, Up: Formatting text


Graphic notation inside markup

Various graphic objects may be added to a score, using markup commands.

Some markup commands allow decoration of text elements with graphics, as demonstrated in the following example.

     
     \markup \fill-line {
       \center-column {
         \circle Jack
         \box "in the box"
         \null
         \line {
           Erik Satie
           \hspace #3
           \bracket "1866 - 1925"
         }
         \null
         \rounded-box \bold Prelude
       }
     }

[image of music]

Some commands may require an increase in the padding around the text; this is achieved with some markup commands exhaustively described in Align.

     
     \markup \fill-line {
       \center-column {
         \box "Charles Ives (1874 - 1954)"
         \null
         \box \pad-markup #2 "THE UNANSWERED QUESTION"
         \box \pad-x #8 "A Cosmic Landscape"
         \null
       }
     }
     \markup \column {
       \line {
         \hspace #10
         \box \pad-to-box #'(-5 . 20) #'(0 . 5)
           \bold "Largo to Presto"
       }
       \pad-around #3
           "String quartet keeps very even time,
     Flute quartet keeps very uneven time."
     }

[image of music]

Other graphic elements or symbols may be printed without requiring any text. As with any markup expression, such objects can be combined.

     
     \markup {
       \combine
         \draw-circle #4 #0.4 ##f
         \filled-box #'(-4 . 4) #'(-0.5 . 0.5) #1
       \hspace #5
     
       \center-column {
         \triangle ##t
         \combine
           \draw-line #'(0 . 4)
           \arrow-head #Y #DOWN ##f
       }
     }

[image of music]

Advanced graphic features include the ability to include external image files converted to the Encapsulated PostScript format (eps), or to directly embed graphics into the input file, using native PostScript code. In such a case, it may be useful to explicitely specify the size of the drawing, as demonstrated below:

     
     c1^\markup {
       \combine
         \epsfile #X #10 #"./context-example.eps"
         \with-dimensions #'(0 . 6) #'(0 . 10)
         \postscript #"
           -2 3 translate
           2.7 2 scale
           newpath
           2 -1 moveto
           4 -2 4 1 1 arct
           4 2 3 3 1 arct
           0 4 0 3 1 arct
           0 0 1 -1 1 arct
           closepath
           stroke"
       }
     c

[image of music]

An exhaustive list of graphics-specific commands can be found in Graphic.

See also

Notation Reference: Graphic, Editorial annotations.

Snippets: Text.

Internals Reference: TextScript.

Installed files: scm/define-markup-commands.scm, scm/stencil.scm.

Autres langues : español, deutsch.