3.2.3 Creating footnotes

Footnotes may be used in many different situations. In all cases,
a ‘footnote mark’ is placed as a reference in text or music, and
the corresponding ‘footnote text’ appears at the bottom of the
same page.

Footnotes within music expressions and footnotes in stand-alone text
outside music expressions are created in different ways.

Footnotes in music expressions

Music footnotes overview

Footnotes in music expressions fall into two categories:

Event-based footnotes

are attached to a particular event. Examples for such events are
single notes, articulations (like fingering indications, accents,
dynamics), and post-events (like slurs and manual beams). The
general form for event-based footnotes is as follows:

[direction] \footnote [mark] offsetfootnotemusic

Time-based footnotes

are bound to a particular point of time in a musical context. Some
commands like \time and \clef don’t actually use events
for creating objects like time signatures and clefs. Neither does a
chord create an event of its own: its stem or flag is created at the
end of a time step (nominally through one of the note events inside).
Exactly which of a chord’s multiple note events will be deemed the
root cause of a stem or flag is undefined. So for annotating those,
time-based footnotes are preferable as well.

A time-based footnote allows such layout objects to be annotated
without referring to an event. The general form for Time-based
footnotes is:

\footnote [mark] offsetfootnote [Context].GrobName

The elements for both forms are:

direction

If (and only if) the \footnote is being applied to a
post-event or articulation, it must be preceded with a direction
indicator (-, _, ^) in order to attach music (with
a footnote mark) to the preceding note or rest.

mark

is a markup or string specifying the footnote mark which is used for
marking both the reference point and the footnote itself at the
bottom of the page. It may be omitted (or equivalently replaced with
\default) in which case a number in sequence will be generated
automatically. Such numerical sequences restart on each page
containing a footnote.

offset

is a number pair such as ‘#(2 . 1)’ specifying the X and
Y offsets in units of staff-spaces from the boundary of the
object where the mark should be placed. Positive values of the
offsets are taken from the right/top edge, negative values from the
left/bottom edge and zero implies the mark is centered on the edge.

Context

is the context in which the grob being footnoted is created. It
may be omitted if the grob is in a bottom context, e.g. a
Voice context.

GrobName

specifies a type of grob to mark (like ‘Flag’). If it is
specified, the footnote is not attached to a music expression in
particular, but rather to all grobs of the type specified which
occur at that moment of musical time.

footnote

is the markup or string specifying the footnote text to use at the
bottom of the page.

music

is the music event or post-event or articulation
that is being annotated.

Event-based footnotes

A footnote may be attached to a layout object directly caused
by the event corresponding to music with the syntax:

Marking a whole chord with an event-based footnote is not
possible: a chord, even one containing just a single note, does
not produce an actual event of its own. However, individual
notes inside of the chord can be marked:

If the footnote is to be attached to a post-event or articulation
the \footnote command must be preceded by a direction
indicator, -, _, ^, and followed by the post-event or
articulation to be annotated as the music argument. In this
form the \footnote can be considered to be simply a copy of
its last argument with a footnote mark attached to it. The syntax
is:

Time-based footnotes

If the layout object being footmarked is indirectly caused by
an event (like an Accidental or Stem caused by a
NoteHead event), the GrobName of the layout object
is required after the footnote text instead of music:

A note inside of a chord can be given an individual (event-based)
footnote. A ‘NoteHead’ is the only grob directly caused
from a chord note, so an event-based footnote command is
only suitable for adding a footnote to the ‘NoteHead’
within a chord. All other chord note grobs are indirectly caused.
The \footnote command itself offers no syntax for
specifying both a particular grob type as well as a
particular event to attach to. However, one can use a time-based
\footnote command for specifying the grob type, and then
prefix this command with \single in order to have it
applied to just the following event:

Note: When footnotes are attached to several musical elements at
the same musical moment, as they are in the example above, the
footnotes are numbered from the higher to the lower elements as they
appear in the printed output, not in the order in which they are
written in the input stream.

Layout objects like clefs and key-change signatures are mostly caused
as a consequence of changed properties rather than actual events.
Others, like bar lines and bar numbers, are a direct consequence of
timing. For this reason, footnotes on such objects have to be based
on their musical timing. Time-based footnotes are also preferable
when marking features like stems and beams on chords: while
such per-chord features are nominally assigned to one event
inside the chord, relying on a particular choice would be imprudent.

The layout object in question must always be explicitly specified
for time-based footnotes, and the appropriate context must be
specified if the grob is created in a context other than the bottom
context.

Footnotes in stand-alone text

These are for use in markup outside of music expressions. They do
not have a line drawn to their point of reference: their marks simply
follow the referenced markup. Marks can be inserted automatically,
in which case they are numerical. Alternatively, custom marks can be
provided manually.

Footnotes to stand-alone text with automatic and custom marks are
created in different ways.

Footnotes in stand-alone text with automatic marks

The syntax of a footnote in stand-alone text with automatic marks is

\markup { … \auto-footnote textfootnote … }

The elements are:

text

is the markup or string to be marked.

footnote

is the markup or string specifying the footnote text to use at the bottom
of the page.