Footnotes

Introduction

Footnotes are marked up by enclosing the footnote text between <fn> and </fn> tags. On output, the fn element, including the enclosed text, gets replaced with a footnote reference, i.e. a superscript number in brackets. The <fnlist /> tag can then be used (all by itself) to generate a numbered list of all footnote entries in the desired place of the document.

The fn element

The fn element serves two purposes: it defines a footnote entry, and it marks the place where a reference to the entry will be inserted. For example, the markup

    According to scientists, the Sun is pretty big.<fn>E. Miller, “The Sun”,
    New York: Academic Press, 2005: 23-5.</fn>
    The moon, however, is not so big.<fn>R. Smith, “Size of the Moon”,
    Scientific American, 46 (April 1978): 44-6.</fn>

will render as

According to scientists, the Sun is pretty big.[1] The moon, however, is not so big.[2]

Footnote references are automatically numbered starting from 1 with the bracketed number forming a hyperlink to the footnote.

Sometimes it is desirable to refer to the same footnote from multiple places in the file. This is done by identifying the footnote by a name attribute. If we rewrite the first citation from above as

    <fn name="miller">E. Miller, “The Sun”, New York: Academic Press, 2005: 23-5.</fn>

we can subsequently refer to this footnote by the empty tag <fn name="miller" />. For example, the markup

    According to scientists, the Sun is pretty big.<fn name="miller">E. Miller,
    “The Sun”, New York: Academic Press, 2005: 23-5.</fn>
    It is also quite hot.<fn name="miller" />

will render as

According to scientists, the Sun is pretty big.[1] It is also quite hot.[1]

Here the second reference (specified by the empty tag) is identical to the first one both visually and in terms of its hyperlink address.

The last fn element for a given name that has content (i.e. is not an empty tag) will determine the content of the footnote.

The fnlist element

The fnlist element generates a list of all footnote entries collected while processing fn elements. More specifically, on output the fnlist element gets replaced by an ol (ordered list) element containing an li (list item) for each defined footnote entry. The element's sole function therefore is to mark the place in the document where you want your footnotes to appear. The mark up

    <fnlist />

will render as follows

  1. ^ a b c E. Miller, “The Sun”, New York: Academic Press, 2005: 23-5.
  2. ^ R. Smith, “Size of the Moon”, Scientific American, 46 (April 1978): 44-6.

Each numbered list item consists of a back reference followed by the text of the footnote. For footnotes that are referred from one place only, the back reference is a caret (^) pointing to the place of reference. In the case of footnotes with multiple references (achieved through the use of the name attribute), a separate superscript index links to each reference.

Note: if a class attribute was present in fn elements, a class attribute with the same value must be specified for fnlist.

Any aspect of the footnote list can be styled using Cascade Style Sheets (CSS). Here are two examples of commonly used CSS rules. First, to remove back references entirely from footnote entries, use the rule

    ol.fn span.backref { display: none; }

To cause the footnote list to be formatted in two columns, use the rule

    ol.fn { -moz-column-count:2; -webkit-column-count:2; column-count:2; }

Multiple footnote streams

Footnotes can be used for many purposes: citations, definitions, translations, proofreaders' corrections and author's notes, just to name a few. When a document features footnotes of more than one type, it is sometimes desirable to have them numbered and listed separately at the end of the document.

Nelson supports this feature, known as footnote streams, through the use of the class attribute. Given that the fnlist element will only list those footnotes whose class value matches its own, it follows that we can separate our footnotes to more than one stream simply by choosing a different class value for each stream. Footnotes are numbered per stream, with each stream starting from 1. Separate fnlist elements make it possible to add a distinctive heading for each list.

This strategy also has the added convenience that footnote references relating to a particular footnote stream are readily selectable for distinctive styling through CSS. One might, for example, use the footnote stream “error” for proofreaders' corrections

    <fn class="error">Too much tautology here.</fn>

    <fnlist class="error" />
The following CSS rule would then cause all footnote references and footnotes related to proofreaders' corrections to be displayed in red.

    .error { color: red; }

Some distinctive styling is recommended as by default there is no visual cue to differentiate footnote streams from one another.

The classless footnote stream (i.e. class attribute not specified) is considered a distinctive “default” stream, which can coexist with streams that have an explicitly specified class.

History

Nelson's model for footnotes was inspired by the Cite Extension in MediaWiki, the software that runs Wikipedia. While the semantics between the two systems are (by design) not fully compatible, users with experience in editing Wikipedia should feel readily at home with footnotes in Nelson.