Introduction to LaTeX’s main footnote commands
According to Wikipedia, footnotes were invented by an English printer called Richard Jugge (c.1514-1577). This time-honoured literary device is supported by LaTeX and in this help article we explain the main footnote-related commands and provide a range of examples to demonstrate their use.
The footnote command
The footnote command is the core LaTeX command for creating footnotes and takes two forms:
- footnote{text for footnote}: This inserts an (automatically-generated) superscript number, called the footnote marker, into the document text and also creates the corresponding footnote at the bottom of the page, containing the corresponding footnote marker and text for footnote.
- footnote[number]{text for footnote}: This form of the command uses the optional value number to create the superscript footnote marker; it also inserts the corresponding footnote at the bottom of the page, containing the identifying footnote marker (number) and text for footnote.
Example: using the footnote command
Here is an example which demonstrates the two variants of footnote:
- footnote{Automatically generated footnote markers work fine!} automatically typesets the numeric (superscript) value (1) for the footnote marker, whereas
- footnote[42]{...is that the answer to everything?} uses 42 as the value of the footnote marker and, as you may observe, it does not increment the integer used for auto-creation of markers: the third footnote has a marker value of 2.
Open this example in Overleaf
This example produces the following output:
Storing the current footnote marker value: LaTeX counters
LaTeX uses so-called counter variables to store the current value of footnote markers. In practice, LaTeX provides and uses two counter variables according to where the footnote is being used:
- footnote: the counter variable for footnotes within the main document text
- mpfootnote: the counter variable for footnotes within a minipage environment
Each time the footnote{text} version of that command is used, the corresponding counter variable is incremented by 1. With the footnote[number]{text} version, the corresponding counter variable is not incremented.
You can create additional counter variables and use them for producing footnotes, as demonstrated in the example below.
The footnotemark and footnotetext commands
In addition to footnote, LaTeX provides the commands:
- footnotemark which typesets the footnote marker, and
- footnotetext which typesets the footnote text
Both commands take an optional argument enclosed in square brackets ([...]):
- footnotemark[number]: typesets a footnote marker at the point the command is used but does not create/typeset a corresponding footnote at the bottom of the page.
- [number] is the optional argument, specifying that the value number should be used for the footnote marker.
- If you use this command without the optional argument, writing it as footnotemark, this form of the command generates the footnote marker using an internal LaTeX variable called a counter variable—which is incremented by 1 when the optional number value is not provided.
- footnotetext[number]{text for footnote}: typesets the footnote text (text for footnote) corresponding to the marker produced by the previous footnotemark.
- [number] is the optional argument which specifies the corresponding footnote marker for the text for footnote.
- If you use this command without the optional number argument, i.e. writing it as footnotetext{text for footnote}, this form of the command generates a footnote whose marker corresponds to the most recent footnotemark.
Example: using footnotemark and footnotetext
The footnotemark and footnotetext commands are often used together to construct footnotes in tables, or other locations, where the standard footnote command does not work, or is not the best/optimal solution—some applications are demonstrated in this article (see here and here).
Open this example in Overleaf
This example produces the following output:
Other LaTeX footnote commands
In addition to the commands we have explored:
- footnote[number]{text for footnote}
- footnotemark[number]
- footnotetext[number]{text for footnote}
LaTeX provides several additional footnote-related commands that we’ll list but not explore in any detail. The following descriptions are taken from the LaTeX2e source code documentation:
- footnotesize: Size-changing command for footnotes.
- footins: Space between main text and footnotes. The rule separating footnotes from text occurs in this space. This space lies above the strut of height footnotesep which is at the beginning of the first footnote.
- footnoterule: Macro to draw the rule separating footnotes from text. It is executed right after a vspace of skipfootins. It should take zero vertical space—i.e., it should to a negative skip to compensate for any positive space it occupies.
- footnotesep: The height of a strut placed at the beginning of every footnote.
Examples and applications of footnotes
Footnotes with multiple references
The following example demonstrates one way to make multiple references to the same footnote. By using footnotemark[value{footnote}] you can insert a superscript corresponding to the current value of the footnote counter but without incrementing the footnote counter value (for more information on counters, see this Overleaf help article).
Open this example in Overleaf
This example produces the following output:
Changing the numbering style
The current value of the footnote number is stored in a LaTeX variable called the footnote counter and can be typeset by the command thefootnote. You can change the typeset format of footnote markers by modifying the thefootnote command; for example, renewcommand{thefootnote}{roman{footnote}} will typeset markers in lowercase Roman numerals. You can use renewcommand{thefootnote}{...} in the preamble to change the numbering style of footnotes in the main document text.
Other possible marker styles are:
- arabic{counter variable}: typeset counter variable in Arabic numerals.
- Roman{counter variable}: typeset counter variable in uppercase Roman numerals.
- alph{counter variable}: typeset counter variable in lowercase Alphabetic characters.
- Alph{counter variable}: typeset counter variable in uppercase Alphabetic characters.
- fnsymbol{counter variable}: typeset counter variable using a set of 9 special symbols.
For background information on creating, using and modifying counters see this Overleaf article on counters.
Here is an example using renewcommand{thefootnote}{roman{footnote}}:
Open this example in Overleaf
This example produces the following output:
Footnotes in minipage environments
Footnotes within a minipage environment behave differently because the commands footnote and footnotetext are temporarily redefined so that footnotes are:
- placed at the bottom of the minipage, not the main document page
- labled/numbered using a scheme different to in-text footnotes—in a minipage the footnotes use a counter called mpfootnote
Here's an example of footnotes in a minipage:
Open this example in Overleaf
This example produces the following output:
Changing minipage footnote markers
As shown by the example above, within a minipage footnote markers are lowercase letters; however, the renewcommand can be used to redefine how the mpfootnote counter value is typeset. For example, to typeset minipage footnote markers as Arabic digits:
as show in the following example:
Open this example in Overleaf
This example produces the following output:
Footnotes in tables
The following sections examine a number of topics related to using footnotes in tables.
Should you use footnotes in tables?
The Frequently Asked Question List for TeX has an entry for footnotes in tables which comments that using footnotes in tables is not considered to be typographic best practice: ideally, table notes should be used instead of table footnotes. The use of table notes or table footnotes may be defined by document class/style files you are required to use, or the choice may be yours: either way, LaTeX provides a range of solutions you can use.
Example: footnote does not work in the tabular environment
The footnote command does not work inside a tabular environment, as the following example demonstrates. Note this example uses the hologo LaTeX package to typeset the names of various TeX engines.
Open this example in Overleaf
This example produces the following output, showing the presence of footnote marks in the table cell and caption, but there is no corresponding footnote text:
A partial solution is to place the tabular inside a minipage environment:
Open this example in Overleaf
This example produces the following output:
Note that you can also write renewcommand{thempfootnote}{arabic{mpfootnote}} to have the minipage table footnote markers typeset as Arabic digits rather than lowercase letters.
Example from LaTeX2e unofficial reference manual
The LaTeX2e unofficial reference manual has an interesting example in the section Footnotes in a table. Normally, table footnotes within a minipage are placed at the bottom of the minipage, as the examples above have shown. The following example, from the LaTeX2e unofficial reference manual uses the footnotemark and footnotetext commands, together with a new counter (mpFootnoteValueSaver) to ensure the table footnotes appear at the bottom of the document page, to be included as part of the document’s standard footnotes.
When the table is typeset, the LaTeX code setcounter{mpFootnoteValueSaver}{value{footnote}} sets the value of mpFootnoteValueSaver to be the current footnote counter value; this ensures footnotes produced within the table use marker values that are synchronized with the main document footnote sequence (numbering). After the table is typeset, note how the mpFootnoteValueSaver is incremented by 1 through the code stepcounter{mpFootnoteValueSaver}.
Open this example in Overleaf
This example produces the following output:
Example: table footnotes via the tablefootnote package
One option is the tablefootnote package which is mentioned on tex.stackexchange and referenced in the Frequently Asked Question List for TeX entry for footnotes in tables. The following example demonstrates the tablefootnote package:
Open this tablefootnote package example in Overleaf
This example produces the following output:
Table notes: an alternative to footnotes
The threeparttable package provides a mechanism to create table notes—an alternative to using footnotes in tables. The threeparttablex package implements a table notes facility for use with the longtable package.
Example: creating table notes using the threeparttable package
The threeparttable package documentation is very brief, so we won't repeat it here but instead we'll provide an example of its use:
Open this threeparttable example in Overleaf
This example produces the following output
Discussions on tex.stackexchange
Table footnotes are also discussed on tex.stackexchange and various solutions outlined in threads, such as the following, which readers may be interested to explore:
- footnotes for tables in LaTeX, and
- footnote in table.
Further reading
For more information see:
- Margin notes
- Page size and margins
- Headers and footers
- Hyperlinks
- Counters
- Lists
- Font sizes, families, and styles
- Bold, italics and underlining
- Font typefaces
- Line breaks and blank spaces
- Management in a large project
- Multi-file LaTeX projects
- The not so short introduction to LaTeX2ε