]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Merge branch 'master' into lilypond/translation
[lilypond.git] / scm / define-markup-commands.scm
index d4d6784692e4022da6c5116c2a12555f37313e60..eb96aee8453df5bc8840ee03715b2869f529f5a7 100644 (file)
   "
 @cindex drawing lines within text
 
-A simple line."
+A simple line.
+@lilypond[verbatim,quote]
+\\markup {
+  \\draw-line #'(4 . 4)
+  \\override #'(thickness . 5)
+  \\draw-line #'(-3 . 0)
+}
+@end lilypond"
   (let ((th (* (ly:output-def-lookup layout 'line-thickness)
                thickness))
         (x (car dest))
@@ -52,9 +59,13 @@ A simple line."
 
 A circle of radius @var{radius}, thickness @var{thickness} and
 optionally filled.
-@c
+
 @lilypond[verbatim,quote]
-\\markup { \\draw-circle #2 #0.5 ##f \\hspace #2 \\draw-circle #2 #0 ##t }
+\\markup {
+  \\draw-circle #2 #0.5 ##f
+  \\hspace #2
+  \\draw-circle #2 #0 ##t
+}
 @end lilypond"
   (make-circle-stencil radius thickness fill))
 
@@ -68,9 +79,13 @@ optionally filled.
 @cindex drawing triangles within text
 
 A triangle, either filled or empty.
-@c
+
 @lilypond[verbatim,quote]
-\\markup { \\triangle ##f \\triangle ##t }
+\\markup {
+  \\triangle ##t
+  \\hspace #2
+  \\triangle ##f
+}
 @end lilypond"
   (let ((ex (* (magstep font-size) 0.8 baseline-skip)))
     (ly:make-stencil
@@ -94,7 +109,11 @@ A triangle, either filled or empty.
 
 Draw a circle around @var{arg}.  Use @code{thickness},
 @code{circle-padding} and @code{font-size} properties to determine line
-thickness and padding around the markup."
+thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup \\circle { Hi }
+@end lilypond"
   (let ((th (* (ly:output-def-lookup layout 'line-thickness)
                thickness))
          (pad (* (magstep font-size) circle-padding))
@@ -103,17 +122,18 @@ thickness and padding around the markup."
 
 (define-builtin-markup-command (with-url layout props url arg)
   (string? markup?)
-  other
+  graphic
   ()
   "
 @cindex inserting URL links into text
 
 Add a link to URL @var{url} around @var{arg}.  This only works in
 the PDF backend.
+
 @lilypond[verbatim,quote]
 \\markup {
   \\with-url #\"http://lilypond.org/web/\" {
-    LilyPond ... \\italic \"music notation for everyone\"
+    LilyPond ... \\italic { music notation for everyone }
   }
 }
 @end lilypond"
@@ -132,7 +152,10 @@ the PDF backend.
   "
 @cindex drawing beams within text
 
-Create a beam with the specified parameters."
+Create a beam with the specified parameters.
+@lilypond[verbatim,quote]
+\\markup \\beam #5 #1 #2
+@end lilypond"
   (let* ((y (* slope width))
         (yext (cons (min 0 y) (max 0 y)))
         (half (/ thickness 2)))
@@ -151,13 +174,17 @@ Create a beam with the specified parameters."
 
 (define-builtin-markup-command (underline layout props arg)
   (markup?)
-  other
+  music
   ((thickness 1))
   "
 @cindex underlining text
 
 Underline @var{arg}.  Looks at @code{thickness} to determine line
-thickness and y offset."
+thickness and y offset.
+
+@lilypond[verbatim,quote]
+\\markup \\underline { CONTENTS }
+@end lilypond"
   (let* ((thick (* (ly:output-def-lookup layout 'line-thickness)
                    thickness))
          (markup (interpret-markup layout props arg))
@@ -172,7 +199,7 @@ thickness and y offset."
 
 (define-builtin-markup-command (box layout props arg)
   (markup?)
-  other
+  font
   ((thickness 1)
    (font-size 0)
    (box-padding 0.2))
@@ -181,7 +208,15 @@ thickness and y offset."
 
 Draw a box round @var{arg}.  Looks at @code{thickness},
 @code{box-padding} and @code{font-size} properties to determine line
-thickness and padding around the markup."  
+thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\override #'(box-padding . 0.5)
+  \\box
+  \\line { V. S. }
+}
+@end lilypond"
   (let* ((th (* (ly:output-def-lookup layout 'line-thickness)
                 thickness))
          (pad (* (magstep font-size) box-padding))
@@ -190,7 +225,7 @@ thickness and padding around the markup."
 
 (define-builtin-markup-command (filled-box layout props xext yext blot)
   (number-pair? number-pair? number?)
-  other
+  graphic
   ()
   "
 @cindex drawing solid boxes within text
@@ -203,13 +238,23 @@ Draw a box with rounded corners of dimensions @var{xext} and
 @end verbatim
 creates a box extending horizontally from -0.3 to 1.8 and
 vertically from -0.3 up to 1.8, with corners formed from a
-circle of diameter@tie{}0 (i.e. sharp corners)."
+circle of diameter@tie{}0 (i.e. sharp corners).
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\filled-box #'(0 . 4) #'(0 . 4) #0
+  \\filled-box #'(0 . 2) #'(-4 . 2) #0.4
+  \\filled-box #'(1 . 8) #'(0 . 7) #0.2
+  \\with-color #white
+  \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7
+}
+@end lilypond"
   (ly:round-filled-box
    xext yext blot))
 
 (define-builtin-markup-command (rounded-box layout props arg)
   (markup?)
-  other
+  graphic
   ((thickness 1)
    (corner-radius 1)
    (font-size 0)
@@ -222,7 +267,7 @@ thickness and padding around the markup; the @code{corner-radius} property
 makes possible to define another shape for the corners (default is 1).
 
 @lilypond[quote,verbatim,fragment,relative=2]
-c^\\markup{ \\rounded-box Overtura }
+c^\\markup \\rounded-box { Overtura }
 c,8. c16 c4 r
 @end lilypond" 
   (let ((th (* (ly:output-def-lookup layout 'line-thickness)
@@ -234,7 +279,7 @@ c,8. c16 c4 r
 
 (define-builtin-markup-command (rotate layout props ang arg)
   (number? markup?)
-  other
+  align
   ()
   "
 @cindex rotating text
@@ -255,7 +300,7 @@ Provide a white background for @var{arg}."
 
 (define-builtin-markup-command (pad-markup layout props padding arg)
   (number? markup?)
-  other
+  align
   ()
   "
 @cindex padding text
@@ -293,7 +338,7 @@ Create a box of the same height as the space in the current font."
 ;; todo: fix negative space
 (define-builtin-markup-command (hspace layout props amount)
   (number?)
-  other
+  align
   ()
   "
 @cindex creating horizontal spaces in text
@@ -349,7 +394,16 @@ Use a stencil as markup."
 @cindex inlining an Encapsulated PostScript image
 
 Inline an EPS image.  The image is scaled along @var{axis} to
-@var{size}."
+@var{size}.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\general-align #Y #DOWN {
+    \\epsfile #X #20 #\"context-example.eps\"
+    \\epsfile #Y #20 #\"context-example.eps\"
+  }
+}
+@end lilypond"
   (if (ly:get-option 'safe)
       (interpret-markup layout props "not allowed in safe")
       (eps-file->stencil axis size file-name)
@@ -384,7 +438,36 @@ For the postscript backend, use the following
 gsave /ecrm10 findfont 
  10.0 output-scale div 
  scalefont setfont 90 rotate (hello) show grestore 
-@end example"
+@end example
+
+@lilypond[verbatim,quote]
+eyeglassesps = #\"
+  0.15 setlinewidth
+  -0.9 0 translate
+  1.1 1.1 scale
+  1.2 0.7 moveto
+  0.7 0.7 0.5 0 361 arc
+  stroke
+  2.20 0.70 0.50 0 361 arc
+  stroke
+  1.45 0.85 0.30 0 180 arc
+  stroke
+  0.20 0.70 moveto
+  0.80 2.00 lineto
+  0.92 2.26 1.30 2.40 1.15 1.70 curveto
+  stroke
+  2.70 0.70 moveto
+  3.30 2.00 lineto
+  3.42 2.26 3.80 2.40 3.65 1.70 curveto
+  stroke\"
+
+eyeglasses = \\markup {
+  \\with-dimensions #'(0 . 4.4) #'(0 . 2.5)
+  \\postscript #eyeglassesps
+}
+
+\\relative c'' { c2^\\eyeglasses a_\\eyeglasses }
+@end lilypond"
   ;; FIXME
   (ly:make-stencil
    (list 'embedded-ps
@@ -404,7 +487,47 @@ grestore
   "
 @cindex inserting music into text
 
-Inline an image of music."
+Inline an image of music.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\score {
+    \\new PianoStaff <<
+      \\new Staff \\relative c' {
+        \\key f \\major
+        \\time 3/4
+        \\mark \\markup { Allegro }
+        f2\\p( a4)
+        c2( a4)
+        bes2( g'4)
+        f8( e) e4 r
+      }
+      \\new Staff \\relative c {
+        \\clef bass
+        \\key f \\major
+        \\time 3/4
+        f8( a c a c a
+        f c' es c es c)
+        f,( bes d bes d bes)
+        f( g bes g bes g)
+      }
+    >>
+    \\layout {
+      indent = 0.0\\cm
+      \\context {
+        \\Score
+        \\override RehearsalMark #'break-align-symbols =
+          #'(time-signature key-signature)
+        \\override RehearsalMark #'self-alignment-X = #LEFT
+      }
+      \\context {
+        \\Staff
+        \\override TimeSignature #'break-align-anchor-alignment = #LEFT
+      }
+    }
+  }
+}
+@end lilypond"
   (let* ((output (ly:score-embedded-format score layout)))
 
     (if (ly:music-output? output)
@@ -430,7 +553,7 @@ An empty markup with extents of a single point."
 
 (define-builtin-markup-command (simple layout props str)
   (string?)
-  other
+  font
   ()
   "
 @cindex simple text strings
@@ -441,7 +564,7 @@ A simple text string; @code{\\markup @{ foo @}} is equivalent with
 
 (define-builtin-markup-command (tied-lyric layout props str)
   (string?)
-  other
+  music
   ()
   "
 @cindex simple text strings with tie characters
@@ -570,7 +693,7 @@ determines the space between each markup in @var{args}."
 
 (define-builtin-markup-command (concat layout props args)
   (markup-list?)
-  other
+  align
   ()
   "
 @cindex concatenating text
@@ -758,12 +881,21 @@ the line width, where @var{X} is the number of staff spaces."
 
 (define-builtin-markup-command (combine layout props m1 m2)
   (markup? markup?)
-  other
+  align
   ()
   "
 @cindex merging text
 
-Print two markups on top of each other."
+Print two markups on top of each other.
+@lilypond[verbatim,quote]
+\\markup {
+  \\fontsize #5
+  \\override #'(thickness . 2)
+  \\combine
+  \\draw-line #'(0 . 4)
+  \\arrow-head #Y #DOWN ##f
+}
+@end lilypond"
   (let* ((s1 (interpret-markup layout props m1))
         (s2 (interpret-markup layout props m2)))
     (ly:stencil-add s1 s2)))
@@ -779,7 +911,12 @@ Print two markups on top of each other."
 @cindex stacking text in a column
 
 Stack the markups in @var{args} vertically.  The property
-@code{baseline-skip} determines the space between each markup in @var{args}."
+@code{baseline-skip} determines the space between each
+markup in @var{args}.
+
+@lilypond[verbatim,quote]
+\\markup \\column { one two three }
+@end lilypond"
   (let ((arg-stencils (interpret-markup-list layout props args)))
     (stack-lines -1 0.0 baseline-skip
                  (remove ly:stencil-empty? arg-stencils))))
@@ -793,7 +930,15 @@ Stack the markups in @var{args} vertically.  The property
 @cindex changing direction of text columns
 
 Make a column of args, going up or down, depending on the setting
-of the @code{#'direction} layout property."
+of the @code{#'direction} layout property.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\override #'(direction . 1)
+  \\dir-column { going up }
+  \\dir-column { going down }
+}
+@end lilypond"
   (stack-lines (if (number? direction) direction -1)
                0.0
                baseline-skip
@@ -806,7 +951,11 @@ of the @code{#'direction} layout property."
   "
 @cindex centering a column of text
 
-Put @code{args} in a centered column."
+Put @code{args} in a centered column.
+
+@lilypond[verbatim,quote]
+\\markup \\center-align { one two three }
+@end lilypond"
   (let* ((mols (interpret-markup-list layout props args))
          (cmols (map (lambda (x) (ly:stencil-aligned-to x X CENTER)) mols)))
     (stack-lines -1 0.0 baseline-skip cmols)))
@@ -892,7 +1041,7 @@ Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}."
 
 (define-builtin-markup-command (pad-around layout props amount arg)
   (number? markup?)
-  other
+  align
   ()
   "Add padding @var{amount} all around @var{arg}."  
   (let* ((m (interpret-markup layout props arg))
@@ -904,7 +1053,7 @@ Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}."
 
 (define-builtin-markup-command (pad-x layout props amount arg)
   (number? markup?)
-  other
+  align
   ()
   "
 @cindex padding text horizontally
@@ -919,7 +1068,7 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
 
 (define-builtin-markup-command (put-adjacent layout props arg1 axis dir arg2)
   (markup? integer? ly:dir? markup?)
-  other
+  align
   ()
   "Put @var{arg2} next to @var{arg1}, without moving @var{arg1}."
   (let ((m1 (interpret-markup layout props arg1))
@@ -938,7 +1087,7 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
 
 (define-builtin-markup-command (pad-to-box layout props x-ext y-ext arg)
   (number-pair? number-pair? markup?)
-  other
+  align
   ()
   "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space."
   (let* ((m (interpret-markup layout props arg))
@@ -950,7 +1099,7 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
 
 (define-builtin-markup-command (hcenter-in layout props length arg)
   (number? markup?)
-  other
+  align
   ()
   "Center @var{arg} horizontally within a box of extending
 @var{length}/2 to the left and right."
@@ -996,8 +1145,8 @@ returns an empty markup."
 @cindex overriding properties within text markup
 
 Add the first argument in to the property list.  Properties may be
-any sort of property supported by @internalsref{font-interface} and
-@internalsref{text-interface}, for example
+any sort of property supported by @rinternals{font-interface} and
+@rinternals{text-interface}, for example
 
 @example
 \\override #'(font-family . married) \"bla\"
@@ -1012,7 +1161,11 @@ any sort of property supported by @internalsref{font-interface} and
   (string?)
   other
   ()
-  "Read the contents of a file, and include it verbatim."
+  "Read the contents of a file, and include it verbatim.
+
+@lilypond[verbatim,quote]
+\\markup \\verbatim-file #\"simple.ly\"
+@end lilypond"
   (interpret-markup layout props
                     (if  (ly:get-option 'safe)
                          "verbatim-file disabled in safe mode"
@@ -1029,7 +1182,13 @@ any sort of property supported by @internalsref{font-interface} and
   (markup?)
   font
   ()
-  "Increase the font size relative to current setting."
+  "Increase the font size relative to current setting.
+
+@lilypond[verbatim,quote]
+\\markup \\bigger {
+  Voici venir les temps où vibrant sur sa tige
+}
+@end lilypond"
   (interpret-markup layout props
    `(,fontsize-markup 1 ,arg)))
 
@@ -1050,7 +1209,10 @@ any sort of property supported by @internalsref{font-interface} and
   (markup?)
   font
   ()
-  "Set the argument as small numbers."
+  "Set the argument as small numbers.
+@lilypond[verbatim,quote]
+\\markup \\finger { 1 2 3 4 5 }
+@end lilypond"
   (interpret-markup layout
                     (cons '((font-size . -5) (font-encoding . fetaNumber)) props)
                     arg))
@@ -1059,10 +1221,12 @@ any sort of property supported by @internalsref{font-interface} and
   (number? markup?)
   font
   ((font-size 0)
+   (word-space 1)
    (baseline-skip 2))
   "Add @var{increment} to the font-size.  Adjust baseline skip accordingly."
   (let ((entries (list
                   (cons 'baseline-skip (* baseline-skip (magstep increment)))
+                  (cons 'word-space (* word-space (magstep increment)))
                   (cons 'font-size (+ font-size increment)))))
     (interpret-markup layout (cons entries props) arg)))
 
@@ -1091,7 +1255,13 @@ Use @code{\\fontsize} otherwise."
   (markup?)
   font
   ()
-  "Switch to bold font-series."
+  "Switch to bold font-series.
+  
+@lilypond[verbatim,quote]
+\\markup \\bold {
+  Chaque fleur s'évapore ainsi qu'un encensoir
+}
+@end lilypond"
   (interpret-markup layout (prepend-alist-chain 'font-series 'bold props) arg))
 
 (define-builtin-markup-command (sans layout props arg)
@@ -1107,7 +1277,11 @@ Use @code{\\fontsize} otherwise."
   ()
   "Set font family to @code{number}, which yields the font used for
 time signatures and fingerings.  This font only contains numbers and
-some punctuation.  It doesn't have any letters."
+some punctuation.  It doesn't have any letters.
+
+@lilypond[verbatim,quote]
+\\markup \\number { 0 1 2 3 4 5 6 7 8 9 . , + - }
+@end lilypond"
   (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaNumber props) arg))
 
 (define-builtin-markup-command (roman layout props arg)
@@ -1163,7 +1337,7 @@ some punctuation.  It doesn't have any letters."
   (markup?)
   font
   ()
-  "Set @code{font-shape} to @code{caps}."
+  "Set @code{font-shape} to @code{caps}"
   (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg))
 
 ;; Poor man's caps
@@ -1212,7 +1386,13 @@ Note: @code{\\smallCaps} does not support accented characters."
   (markup?)
   font
   ()
-  "Emit @var{arg} as small caps."
+  "Emit @var{arg} as small caps.
+
+@lilypond[verbatim,quote]
+\\markup \\caps {
+  Les sons et les parfums tournent dans l'air du soir
+}
+@end lilypond"
   (interpret-markup layout props (make-smallCaps-markup arg)))
 
 (define-builtin-markup-command (dynamic layout props arg)
@@ -1222,7 +1402,10 @@ Note: @code{\\smallCaps} does not support accented characters."
   "Use the dynamic font.  This font only contains @b{s}, @b{f}, @b{m},
 @b{z}, @b{p}, and @b{r}.  When producing phrases, like
 @q{pi@`{u}@tie{}@b{f}}, the normal words (like @q{pi@`{u}}) should be
-done in a different font.  The recommended font for this is bold and italic."
+done in a different font.  The recommended font for this is bold and italic.
+@lilypond[verbatim,quote]
+\\markup { \\dynamic sfzp }
+@end lilypond"
   (interpret-markup
    layout (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg))
 
@@ -1240,7 +1423,11 @@ done in a different font.  The recommended font for this is bold and italic."
   (markup?)
   font
   ()
-  "Use italic @code{font-shape} for @var{arg}."
+  "Use italic @code{font-shape} for @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup \\italic { scherzando e leggiero }
+@end lilypond"
   (interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg))
 
 (define-builtin-markup-command (typewriter layout props arg)
@@ -1289,7 +1476,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a double sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\doublesharp }
 @end lilypond"
@@ -1300,7 +1487,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a 3/2 sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sesquisharp }
 @end lilypond"
@@ -1311,7 +1498,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sharp }
 @end lilypond"
@@ -1322,7 +1509,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a semi sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\semisharp }
 @end lilypond"
@@ -1333,7 +1520,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a natural symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\natural }
 @end lilypond"
@@ -1344,7 +1531,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a semiflat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\semiflat }
 @end lilypond"
@@ -1355,7 +1542,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\flat }
 @end lilypond"
@@ -1366,7 +1553,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a 3/2 flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sesquiflat }
 @end lilypond"
@@ -1377,7 +1564,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a double flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\doubleflat }
 @end lilypond"
@@ -1405,7 +1592,19 @@ Draw @var{arg} in color specified by @var{color}."
   graphic
   ()
   "Produce an arrow head in specified direction and axis.
-Use the filled head if @var{filled} is specified."
+Use the filled head if @var{filled} is specified.
+@lilypond[verbatim,quote]
+\\markup {
+  \\fontsize #5
+  \\general-align #Y #DOWN {
+    \\arrow-head #Y #UP ##t
+    \\arrow-head #Y #DOWN ##f
+    \\hspace #2
+    \\arrow-head #X #RIGHT ##f
+    \\arrow-head #X #LEFT ##f
+  }
+}
+@end lilypond"
   (let*
       ((name (format "arrowheads.~a.~a~a"
                     (if filled
@@ -1425,11 +1624,26 @@ Use the filled head if @var{filled} is specified."
   "@var{glyph-name} is converted to a musical symbol; for example,
 @code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from
 the music font.  See @ruser{The Feta font} for a complete listing of
-the possible glyphs."
-  (ly:font-get-glyph
-   (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
-                                  props))
-   glyph-name))
+the possible glyphs.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\musicglyph #\"f\"
+  \\musicglyph #\"rests.2\"
+  \\musicglyph #\"clefs.G_change\"
+}
+@end lilypond"
+  (let* ((font (ly:paper-get-font layout
+                                 (cons '((font-encoding . fetaMusic)
+                                         (font-name . #f))
+                                       
+                                                props)))
+        (glyph (ly:font-get-glyph font glyph-name)))
+    (if (null? (ly:stencil-expr glyph))
+       (ly:warning (_ "Cannot find glyph ~a") glyph-name))
+
+    glyph))
+
 
 (define-builtin-markup-command (lookup layout props glyph-name)
   (string?)
@@ -1474,7 +1688,11 @@ letter @q{A}."
   other
   ()
   "Make a markup letter for @var{num}.  The letters start with A to@tie{}Z
-(skipping letter@tie{}I), and continue with double letters."
+(skipping letter@tie{}I), and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markletter #8 \\hspace #2 \\markletter #26 }
+@end lilypond"
   (ly:text-interface::interpret-markup layout props
     (number->markletter-string number->mark-letter-vector num)))
 
@@ -1483,7 +1701,11 @@ letter @q{A}."
   other
   ()
    "Make a markup letter for @var{num}.  The letters start with A to@tie{}Z
-and continue with double letters."
+and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markalphabet #8 \\hspace #2 \\markalphabet #26 }
+@end lilypond"
    (ly:text-interface::interpret-markup layout props
      (number->markletter-string number->mark-alphabet-vector num)))
 
@@ -1496,7 +1718,15 @@ and continue with double letters."
 @cindex slashed digits
 
 A feta number, with slash.  This is for use in the context of
-figured bass notation."
+figured bass notation.
+@lilypond[verbatim,quote]
+\\markup {
+  \\slashed-digit #5
+  \\hspace #2
+  \\override #'(thickness . 3)
+  \\slashed-digit #7
+}
+@end lilypond"
   (let* ((mag (magstep font-size))
          (thickness (* mag
                        (ly:output-def-lookup layout 'line-thickness)
@@ -1532,7 +1762,7 @@ figured bass notation."
               (ly:stencil-add number-stencil slash-stencil))
         (ly:warning "invalid number for slashed digit ~a" num))
     number-stencil))
-\f
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; the note command.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1548,8 +1778,15 @@ figured bass notation."
 @cindex notes within text by log and dot-count
 
 Construct a note symbol, with stem.  By using fractional values for
-@var{dir}, you can obtain longer or shorter stems."
+@var{dir}, you can obtain longer or shorter stems.
 
+@lilypond[verbatim,quote]
+\\markup {
+  \\note-by-number #3 #0 #DOWN
+  \\hspace #1
+  \\note-by-number #1 #2 #0.8
+}
+@end lilypond"
   (define (get-glyph-name-candidates dir log style)
     (map (lambda (dir-name)
      (format "noteheads.~a~a~a" dir-name (min log 2)
@@ -1606,8 +1843,10 @@ Construct a note symbol, with stem.  By using fractional values for
                                                         (number->string log)))
                        (cons (+ (car attach-off) (if (< dir 0) stem-thickness 0)) stemy)))))
 
-    (if (and dots flaggl (> dir 0))
-       (set! dots (ly:stencil-translate-axis dots 0.35 X)))
+    ; If there is a flag on an upstem and the stem is short, move the dots to avoid the flag.
+    ; 16th notes get a special case because their flags hang lower than any other flags.
+    (if (and dots (> dir 0) (> log 2) (or (< dir 1.15) (and (= log 4) (< dir 1.3))))
+       (set! dots (ly:stencil-translate-axis dots 0.5 X)))
     (if flaggl
         (set! stem-glyph (ly:stencil-add flaggl stem-glyph)))
     (if (ly:stencil? stem-glyph)
@@ -1650,7 +1889,16 @@ Construct a note symbol, with stem.  By using fractional values for
 This produces a note with a stem pointing in @var{dir} direction, with
 the @var{duration} for the note head type and augmentation dots.  For
 example, @code{\\note #\"4.\" #-0.75} creates a dotted quarter note, with
-a shortened down stem."
+a shortened down stem.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\override #'(style . cross)
+  \\note #\"4..\" #UP
+  \\hspace #1
+  \\note #\"breve\" #0
+}
+@end lilypond"
   (let ((parsed (parse-simple-duration duration)))
     (note-by-number-markup layout props (car parsed) (cadr parsed) dir)))
 \f
@@ -1660,7 +1908,7 @@ a shortened down stem."
 
 (define-builtin-markup-command (lower layout props amount arg)
   (number? markup?)
-  other
+  align
   ()
   "
 @cindex lowering text
@@ -1688,7 +1936,7 @@ Translate @var{arg} by @var{offset}, scaling the offset by the
 
 (define-builtin-markup-command (raise layout props amount arg)
   (number? markup?)
-  other
+  align
   ()
   "
 @cindex raising text
@@ -1705,9 +1953,9 @@ If the text object itself is positioned above or below the staff, then
 positions it next to the staff cancels any shift made with
 @code{\\raise}.  For vertical positioning, use the @code{padding}
 and/or @code{extra-offset} properties.
-@c
+
 @lilypond[verbatim,quote]
-\\markup { C \\small \\raise #1.0 \\bold { \"9/7+\" } }
+\\markup { C \\small \\raise #1.0 \\bold 9/7+ }
 @end lilypond"
   (ly:stencil-translate-axis (interpret-markup layout props arg) amount Y))
 
@@ -1718,7 +1966,10 @@ and/or @code{extra-offset} properties.
   "
 @cindex creating text fractions
 
-Make a fraction of two markups."
+Make a fraction of two markups.
+@lilypond[verbatim,quote]
+\\markup { π ≈ \\fraction 355 113 }
+@end lilypond"
   (let* ((m1 (interpret-markup layout props arg1))
          (m2 (interpret-markup layout props arg2))
          (factor (magstep font-size))
@@ -1743,7 +1994,7 @@ Make a fraction of two markups."
 
 (define-builtin-markup-command (normal-size-super layout props arg)
   (markup?)
-  other
+  font
   ((baseline-skip))
   "
 @cindex setting superscript in standard font size
@@ -1755,7 +2006,7 @@ Set @var{arg} in superscript with a normal font size."
 
 (define-builtin-markup-command (super layout props arg)
   (markup?)
-  other
+  font
   ((font-size 0)
    (baseline-skip))
   "  
@@ -1763,9 +2014,9 @@ Set @var{arg} in superscript with a normal font size."
 
 Raising and lowering texts can be done with @code{\\super} and
 @code{\\sub}:
-@c
+
 @lilypond[verbatim,quote]
-\\markup { E \"=\" \\concat { \"mc\" \\super \"2\" } }
+\\markup { E = \\concat { mc \\super 2 } }
 @end lilypond"
   (ly:stencil-translate-axis
    (interpret-markup
@@ -1777,7 +2028,7 @@ Raising and lowering texts can be done with @code{\\super} and
 
 (define-builtin-markup-command (translate layout props offset arg)
   (number-pair? markup?)
-  other
+  align
   ()
   "
 @cindex translating text
@@ -1797,7 +2048,7 @@ that."
 
 (define-builtin-markup-command (sub layout props arg)
   (markup?)
-  other
+  font
   ((font-size 0)
    (baseline-skip))
   "
@@ -1814,7 +2065,7 @@ Set @var{arg} in subscript."
 
 (define-builtin-markup-command (normal-size-sub layout props arg)
   (markup?)
-  other
+  font
   ((baseline-skip))
   "
 @cindex setting subscript in standard font size
@@ -1831,24 +2082,28 @@ Set @var{arg} in subscript, in a normal font size."
 
 (define-builtin-markup-command (hbracket layout props arg)
   (markup?)
-  other
+  graphic
   ()
   "
 @cindex placing horizontal brackets around text
   
-Draw horizontal brackets around @var{arg}."  
+Draw horizontal brackets around @var{arg}."
   (let ((th 0.1) ;; todo: take from GROB.
         (m (interpret-markup layout props arg)))
     (bracketify-stencil m X th (* 2.5 th) th)))
 
 (define-builtin-markup-command (bracket layout props arg)
   (markup?)
-  other
+  graphic
   ()
   "
 @cindex placing vertical brackets around text
   
-Draw vertical brackets around @var{arg}."  
+Draw vertical brackets around @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup \\bracket \\note #\"2.\" #UP
+@end lilypond"
   (let ((th 0.1) ;; todo: take from GROB.
         (m (interpret-markup layout props arg)))
     (bracketify-stencil m Y th (* 2.5 th) th)))