The \fill-line command: Difference between revisions

m New category
Simplify
 
Line 1: Line 1:
The <code>\fill-line</code> command aligns and justifies markup text by setting as many columns as required, in a given space.<br />
The <code>\fill-line</code> command aligns and justifies markup text by setting as many columns as required, in a given space.
<br />
In this snippet we use numbers to (beautifully) show how the command works; but when using text beware to use quotes if you want your words to stay together:<br />
<br />
<code>\fill-line {The quick brown fox}</code><br />
results in something like:<br />


In this snippet we use numbers to (beautifully) show how the command works; but when using text beware to use quotes if you want your words to stay together.  For example, this code


The quick brown fox
\fill-line { The quick brown fox }


<code>\fill-line {&quot;The quick brown fox&quot;}</code><br />
results in something like the following (i.e., four columns).
results in something like:<br />


The    quick    brown    fox


The quick brown fox
With quotes, input like


<br />
\fill-line { "The quick brown fox" }
 
produces output like this (i.e., a single, centered column).
 
      The quick brown fox


<lilypond version="2.24">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=244
\paper {
\paper {
   line-width = 15\cm
   line-width = 15\cm
  bookTitleMarkup = \markup {
    \column {
      \fill-line {
        1
      }
      \fill-line {
        1
        2
      }
      \fill-line {
        1
        2
        3
      }
      \fill-line {
        1
        2
        3
        4
      }
      \fill-line {
        1
        2
        3
        4
        5
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
      }
      \fill-line {
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
      }
    }
  }
}
}


\score {
\markup \column {
   \new Staff \relative c'' {
  \fill-line { 1 }
   \repeat unfold 4 c1
   \fill-line { 1 2 }
   }
  \fill-line { 1 2 3 }
   \fill-line { 1 2 3 4 }
   \fill-line { 1 2 3 4 5 }
  \fill-line { 1 2 3 4 5 6 }
  \fill-line { 1 2 3 4 5 6 7 }
  \fill-line { 1 2 3 4 5 6 7 8 }
  \fill-line { 1 2 3 4 5 6 7 8 9 }
  \fill-line { 1 2 3 4 5 6 7 8 9 10 }
  \fill-line { 1 2 3 4 5 6 7 8 9 10 11 }
  \fill-line { 1 2 3 4 5 6 7 8 9 10 11 12 }
  \fill-line { 1 2 3 4 5 6 7 8 9 10 11 12 13 }
  \fill-line { 1 2 3 4 5 6 7 8 9 10 11 12 13 14 }
}
}
</lilypond>
</lilypond>