Footnotes

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:

Example: using the footnote command

Here is an example which demonstrates the two variants of footnote:

Open this example in Overleaf

This example produces the following output:

Basic footnote example

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:

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:

Both commands take an optional argument enclosed in square brackets ([...]):

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:

Using footnotes in Overleaf

Other LaTeX footnote commands

In addition to the commands we have explored:

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:

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:

Using multiple footnote references

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:

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:

Changing footnote numbering style

Footnotes in minipage environments

Footnotes within a minipage environment behave differently because the commands footnote and footnotetext are temporarily redefined so that footnotes are:

Here's an example of footnotes in a minipage:

Open this example in Overleaf

This example produces the following output:

Using footnotes in a minipage

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:

Changing minipage footnote marker

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:

Missing footnote text in a tabular environment

A partial solution is to place the tabular inside a minipage environment:

Open this example in Overleaf

This example produces the following output:

LaTeX tabular in a minipage to fix footnotes

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:

Creatinf table footnotes in LaTeX

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:

Example of tablefootnote package

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

Overleaf example of table notes in LaTeX

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:

Further reading

For more information see:

Link nội dung: https://pmil.edu.vn/cach-them-footnote-trong-word-a68865.html