Notes

It is a common requirement to place a piece of content outside the normal flow of the text, optionally with a small marker to alert the reader to its presence. This allows the reader to locate it if necessary without interrupting the flow of the main content. TopLeaf uses the term note to describe this type of material.

There are several types of notes, distinguished by where the content of the note is displayed:

  • the content of a column footnote is displayed at the bottom of a text column.

  • the content of a page footnote is displayed at the bottom of a page.

  • the content of a sidenote appears alongside the place where it is referenced.

  • the content of an endnote appears at the end of the document, or at the end of part of the document (for example, at the end of a chapter).

Footnotes and sidenotes are assigned by using mapping properties found on the Content tab. There is no direct support for endnotes, but these can be created as described below.

Footnote types

The distinction between column and page footnotes is most apparent in a multi-column layout.

The following example shows the use of column footnotes:

The following is the same content using page footnotes:

It is possible to have both column and page footnotes present on the same page. When both are present, the page footnotes always appear below the column footnotes.

When using page footnotes it may be necessary to adjust the area used to display the footnote content. The <note-properties/> command can be used to specify the appropriate layout page type to use.

Page footnotes can be formatted into two columns by setting an option in the current layout.

Footnote structure

A footnote consists of:

  • A reference marker in the main content.

  • A label in the footnote display area that identifies the footnote.

  • The body of the footnote containing its content.

In the examples above the reference marker and label are both numbers enclosed in parentheses. The style of these is controlled by note mappings.

In addition, there is an optional separator that appears between the first footnote and the main text. Each type of footnote has a mapping that controls the appearance of the separator. In the examples above the separator is a short horizontal rule.

By default footnotes are numbered starting from 1 and continue throughout the document. Options for controlling this, as well as using non-numeric markers are available by using the <note-properties/> command.

Sidenotes

The content of a sidenote appears alongside the main content in an area defined in the layout.

Unlike a footnote, a sidenote does not usually display a reference marker in the main text, since its vertical position associates it with the content. However, it is possible to create a marker by inserting custom content when the sidenote is defined.

The vertical position of a sidenote is determined by the position of the line of content with which it is associated. Sidenotes are arranged into the area defined by the layout in the order in which they occur. The style of the sidenote content is controlled by the $sidenote note mapping.

If there are multiple sidenotes associated with a line the first one will always be at the same vertical position as the content line. If necessary, extra vertical space will be added before the content line to allow this.

By default the baseline of the content line is aligned with the baseline of the first line of the sidenote. The <note-properties/> command allows the alignment method to be altered.

The following diagram illustrates sidenote alignment.

In the above the $sidenote mapping draws a rule below each sidenote. The red lines identify the points in the content which are associated with the sidenotes. Note that the second paragraph has been moved down so that the final sidenote can be aligned correctly.

Endnotes

There are no mapping properties specifically intended for the creation of endnotes. However, they can be created using custom content in mappings. The following is a summary of what is required. If you are not familiar with the use of custom content consult the Mapping Guide.

  • In the $document mapping set a counter variable to zero, and initialize a variable to contain the notes to an empty string.

    <set var="NoteCount" value="0"/>
    <set var="Notes" string=""/>
  • In the mapping for the note, scan and suppress the note content. Increment the note counter. Emit a note reference, and add the note content to the variable.

    <set var="NoteCount" value="{NoteCount}+1"/>
    <NoteRef>({NoteCount})</NoteRef>
    <set var="Notes">
        {Notes}
        <Note label="{NoteCount}"><content/></Note>
    </set>
  • At the appropriate place for the notes, emit the notes variable. You will need to create a %Note custom marker to format each note as required.