Myself, Coding, Ranting, and Madness

The Consciousness Stream Continues…

The LaTeX Atrocities — Footnotes

17 Feb 2012 8:00 Tags: None

Footnotes are something of a way of life for me1. They're like bracketed sub clauses that don't clutter up the page, thus allowing information to actually make sense2.

LaTeX's in-built footnote support is, as always, excellent. As usual, there are number of package to make it even better. Of the off chance that you don't know, or haven't figured it out whilst reading this, the way of having a footnote in LaTeX is

\footnote{}

99 times out of 100, that's all you'll ever want or need. As always, however, the 99% think a lot more of themselves that it is worth giving them credit for, so here are some of my 1%s

Footnotes in any Environment

Footnotes can only be cleanly applied in certain types on environments3; for example, footnotes in a tabular environment are dropped - silently. This can come at something of a surprise the first time it happens, and seems like something someone would have fixed, as tables are often a place where footnotes are used - look at any bus timetable.

For tables, there's a very easy work around - use tabularx instead. However, there is a more general method which works with any environment - using the lower level \footnotemark and \footnotetext commands. They work in quite a simple way - footnotemark inserts the next footnote anchor - generally the footnote marker in lovely superscript - and footnotetext sets the text for the current footnote.

Take note of the order, or you might end up with some oddities in the numbering of your footnotes - mark first, then the text.

\begin{tabbing} Benedict Harcourt \= Coder\footnotemark ... \end{tabbing} \footnotetext{Also, blogs sporadically}

This allows you to place the text of the footnote as a command in the main scope, but does cause some issues, most noticeably that you'll get warning about the location of the footnotes if you are working in a multicols environment - Because of the mark/text separation, LaTeX can not always guarantee that it puts the footnote in the most logical place. I'm yet to find a way to get it to suppress this in re runs - of course the build process for a LaTeX document is theoretically unbounded, and may never converge to a steady state, thus there is always the chance that the layout is not correctly optimised.

The footmisc Package - Styling Footnotes

The footmisc package offers a really simple and quick way to configure your footnotes. You can find the full documentation 4.

\usepackage[perpage,bottom]{footmisc}

perpage

The footnote numbering is reset when a new page begins. Note that this will likely require an extra rebuild, as footnotes can interfere with the placement of other footnotes, so the first set of numbers may not be accurate.

bottom

This forces the footnotes to be rendered right at the bottom of the page - basically the equivalent of putting a \vfill between the page content and the footnote marker.

symbol/symbol*

Makes the footnote marks use the more traditional symbol set, starting from *. The * version of this is designed for use with perpage; it basically makes the first pass take slightly wilder guesses as to which page things will end up on to speed the process up.

multiple

This concatenates the markers in situations where there are two consecutive footnotes, so that 1,2 is not displayed as 12

norule

This package option removes the line between the main body of the text and the footnotes.

  1. 1 You may have noticed this...
  2. 2 Well, as much sense as my writing ever makes
  3. 3 I don't want to get drawn into a discussion of LaTeX's environment-ing system. At least, not without a large pot of tea, several monitors, and a preferably a terminal connected directly to Google's server for increased search speeds
  4. 4 There are some exception for the layout handling