LaTeX/Footnotes and Margin Notes

Customization

 * Enumeration/counter style

It is possible to customize the footnote marking. By default, they are numbered sequentially (Arabic). However, without going too much into the mechanics of LaTeX at this point, it is possible to change this using the following command (which needs to be placed at the beginning of the document, or at least before the first footnote command is issued).

To make a footnote without number mark use this declaration:

In this way, the numbering is switched off globally. To have only one footnote without number mark, the above command has to be placed inside { }. Nevertheless, in that case, the current footnote counter is still incremented, so for instance you'd get footnote 1, unnumbered, and 3. A better solution consists in defining the following macro in the preamble, and to use it:

The package footmisc offers many possibilities for customizing the appearance of footnotes. It can be used, for example, to use a different font within footnotes.

Reset counter

 * every section

(This may require running LaTeX twice)
 * every page

Referencing a footnote
Can be done by placing a  in the end of the footnote and use   to refer to the footnote.

Common problems and workarounds

 * Footnotes don't work with tables, as it is considered a bad practice. You can overcome this limitation with several techniques: you can use  in the table, and  somewhere on the page. The same with references: use {{LaTeX/LaTeX|code=\footnote{HelloWorld!\label{fnote{{))}}}} somewhere on the page and {{LaTeX/LaTeX|code=\textsuperscript{\ref{fnote{{))}}}} in the table.  Or, you can add {{LaTeX/LaTeX|code=\usepackage{footnotehyper}}} and {{LaTeX/LaTeX|code=\makesavenoteenv{tabular}}} to the preamble, and put your {{LaTeX/Environment|table}} environment in a {{LaTeX/LaTeX|code=\begin{savenotes}}} environment.  The latter does not work with the packages {{LaTeX/Package|color}} or {{LaTeX/Package|colortbl}}. See this FAQ page for other approaches (such as the use of tablenotes with {{LaTeX/Package|threeparttable}}).


 * Footnotes also don't work inside minipage environment. (In fact, several environments break footnote support. The {{LaTeX/LaTeX|code=\makesavenoteenv{environmentname}}} command of the footnote package might fix most.) The minipage includes its own footnotes, independent of the document's. The package mpfnmark allows greater flexibility in managing these two sets of footnotes.


 * If the text within the footnote is a URL (using {{LaTeX/LaTeX|code=\url}} or {{LaTeX/LaTeX|code=\href}} commands) with special characters, it will not compile. You must either escape the characters with a leading backslash, or use another command.

{{LaTeX/Usage|code= \interfootnotelinepenalty=10000 }} or setting \samepage after footnote command:
 * If the text within the footnote is very long, LaTeX may split the footnote over several pages. You can prevent LaTeX from doing so by increasing the penalty for such an operation. To do this, insert the following line into the preamble of your document:

{{LaTeX/LaTeX|code=\footnote{ \samepage text of the footnote follows } }} {{LaTeX/Usage|code= Text that has a footnote\footnote{This is the footnote} looks like this. Later text referring to the same footnote\footnotemark[\value{footnote}] uses the other command. }}
 * To make multiple references to the same footnote, you can use the following syntax:

If you need hyperref support, use instead: {{LaTeX/Usage|code= Text that has a footnote\footnote{This is the footnote}\addtocounter{footnote}{-1}\addtocounter{Hfootnote}{-1} looks like this. Later text referring to the same footnote\footnotemark uses the other command. }}

These approaches will not work if there are other footnotes between the first reference and the subsequent "duplicate" references. For more general solutions, see here and here.


 * If the footnote is intended to be added to the title of a chapter, a section, or similar, two methods can be used:
 * 1) Write {{LaTeX/LaTeX|code=\section[title] {title\footnote{I'm a footnote referred to the section} }}} where {{LaTeX/Parameter|title}} is the title of the section.
 * 2) Use the {{LaTeX/Package|footmisc}} package, with package option {{LaTeX/Parameter|stable}}, and simply add the footnote to the section title.

Margin Notes
Margin Notes are useful during the editorial process, to exchange comments among authors. To insert a margin note use. For one-sided layout (simplex), the text will be placed in the right margin, starting from the line where it is defined. For two-sided layout (duplex), it will be placed in the outside margin and for two-column layout it will be placed in the nearest margin.

To swap the default side, use and margin notes will then be placed on the opposite side, which would be the inside margin for two-sided layout.

If the text of your marginpar depends on which margin it is put in (say it includes an arrow pointing at the text or refers to a direction as in "as seen to the left..."), you can use to specify the variants.

To insert a margin note in an area that can't handle, such as footnotes or equation environments, use the package.

Another option for adding colored margin notes in a fancy way provides the package by using. It makes use of the package used for designing and drawing with a huge tool database.

The packages and  can be used if the native  command does not meet your needs.



The marginnote and geometry package can set the widths of the margins and marginnotes as follows.

In the preamble, insert

and use the geometry package with custom sizes:

where A, B, C, D, E, F, G, H are all numbers in cm (of course other units than cm can be used).

In the main text, employ the marginnote package according to:

Specifically,
 * (E) is the width of the margin note,
 * (D) is the separation between the paragraph and the margin note,
 * F is the downwards vertical offset from the first line the margin note was written (negative values of F shift the margin note upwards), and
 * the value G = C − (D + E) is the separation between the edge of the margin note and the edge.

The example on the right was typeset by the following:

Additionally, the minimum vertical gap between margin notes can be adjusted with, such as with.

Notes and References
LaTeX/Подстрочные примечания и заметки на полях