Next: Spacing, Previous: Paper and layout, Up: Top
adding-the-current-date-to-a-score.ly
I often find it useful to include a date on printed music, so that I
can see if I'm using the latest version, or tell someone else that he
should only use the version after a certain date. A simple solution is
to enter the date manually to the .ly
file. But that's very
error prone. It's easy to forget updating the date. So i thought it
would be useful if you can add the date on which the PDF file is
generated automatically. I did't figure it out myself, but I asked on
lilypond-user mailing list. And guess what? Someone came with an
excellent solution! So thank you very much Toine Schreurs for sending
this solution to the user mailing list. I post it here for future
reference.
The solution is to use two scheme functions called strftime
and
localtime
, as shown in the snippet. It is a very flexible
solution, you can format the date just as you like it by adapting the
"%d-%m-%Y"
string. See the Guile documentation for more
details on this format string: Formatting Calendar Time.
\score { \relative c'' { c4 c c c } } % and use it in a \markup block: \markup { \date }
aligning-and-centering-instrument-names.ly
Instrument names are generally printed at the left side of the staves. To align the names of several different intruments, you can put them in a \markup block and use one of the following possibilites:
* Right-aligned instrument names: this is LilyPond's default behavior
* Center-aligned instrument names: with the \hcenter-in #n syntax, you can place the instrument names inside a padded box (n being the width of the box)
* Left-aligned instrument names: you have to print the names on top of an empty box, using the \combine command with a \hspace #n object.
\paper{ indent = #0 left-margin = #30 line-width = #160 } \new StaffGroup \relative << \new Staff { \set Staff.instrumentName = "blabla" c1^"default" c1 \break \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" } c1^"centered" c1 \break \set Staff.instrumentName = \markup {\combine \hspace #8 "blabla" } c1^"left-aligned" c1 } \new Staff { \set Staff.instrumentName = "blo" c1 c1 \break \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" } c1 c1 \break \set Staff.instrumentName = \markup {\combine \hspace #8 "blo" } c1 c1 } >>
All header fields with special meanings.
Next: Spacing, Previous: Paper and layout, Up: Top
This page is for LilyPond-2.11.40 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.