@item
An output definition, such as @code{\paper}, @code{\midi}, and
@code{\layout}. Such a definition at the toplevel changes the default
-book-wide settings. If more than one such definition of
-the same type is entered at the top level any definitions in the later
-expressions have precedence.
+book-wide settings. If more than one such definition of the same type
+is entered at the top level the definitions are combined, but in
+conflicting situations the later definitions take precedence. For
+details of how this affects the @code{\layout} block see
+@ref{The \layout block}.
@item
A direct scheme expression, such as
Learning Manual:
@rlearning{How LilyPond input files work}.
+Notation Reference:
+@ref{The \layout block}.
+
@node Titles and headers
@section Titles and headers
@item @code{evenFooterMarkup}
@end itemize
+@cindex markup, conditional
+@cindex on-the-fly
+@funindex \on-the-fly
+
+The @code{\markup} command @code{\on-the-fly} can be used to add
+markup conditionally to header and footer text defined within the
+@code{\paper} block, using the following syntax:
+
+@example
+@code{variable} = @code{\markup} @{
+ ...
+ @code{\on-the-fly} #@var{procedure} @var{markup}
+ ...
+@}
+@end example
+
+The @var{procedure} is called each time the @code{\markup} command
+in which it appears is evaluated. The @var{procedure} should test
+for a particular condition and interpret (i.e. print) the
+@var{markup} argument if and only if the condition is true.
+
+A number of ready-made procedures for testing various conditions are
+provided:
+
+@quotation
+@multitable {print-page-number-check-first-----} {should this page be printed-----}
+
+@headitem Procedure name @tab Condition tested
+
+@item print-page-number-check-first @tab should this page number be printed?
+@item create-page-number-stencil @tab 'print-page-numbers true?
+@item print-all-headers @tab 'print-all-headers true?
+@item first-page @tab first page in the book?
+@item (on-page nmbr) @tab page number = nmbr?
+@item last-page @tab last page in the book?
+@item not-first-page @tab not first page in the book?
+@item part-first-page @tab first page in the book part?
+@item part-last-page @tab last page in the book part?
+@item not-single-page @tab pages in book part > 1?
+
+@end multitable
+@end quotation
+
The following example centers page numbers at the bottom of every
page. First, the default settings for @code{oddHeaderMarkup} and
@code{evenHeaderMarkup} are removed by defining each as a @emph{null}
}
@end lilypond
+Several @code{\on-the-fly} conditions can be combined with an
+@q{and} operation, for example,
+
+@example
+ @code{\on-the-fly #first-page}
+ @code{\on-the-fly #last-page}
+ @code{@{ \markup ... \fromproperty #'header: ... @}}
+@end example
+
+determines if the output is a single page.
+
@seealso
Notation Reference:
@ref{Title blocks explained},
@ref{Default layout of book and score title blocks}.
+Installed Files:
+@file{../ly/titling-init.ly}.
+
@node Creating footnotes
@subsection Creating footnotes
referred to in a markup, to get the number of the page where the marked
point is placed, using the @code{\page-ref} markup command.
-@lilypond[verbatim]
+@lilypond[verbatim,papersize=a8landscape]
\header { tagline = ##f }
\book {
\label #'firstScore
(add-toc-item! 'tocActMarkup text))
@end verbatim
-@lilypond[line-width=11.0\cm]
+@lilypond[line-width=10.0\cm]
\header { tagline = ##f }
\paper {
tocActMarkup = \markup \large \column {
Dots can be added to fill the line between an item and its page number:
-@lilypond[verbatim,quote]
+@lilypond[verbatim,line-width=10.0\cm]
\header { tagline = ##f }
\paper {
tocItemMarkup = \tocItemWithDotsMarkup
that are off or accidentals that were mistyped stand out very much
when listening to the MIDI output.
-Standard MIDI oputput is somewhat crude; optionally, an enhanced and
+Standard MIDI output is somewhat crude; optionally, an enhanced and
more realistic MIDI output is available by means of
@ref{The Articulate script}.