328

Maybe this is an easy one, but I struggled with this now too long :)

I want to have a footnote in a caption of a figure, see the example.

\begin{figure}[!ht]
  \caption{a figure caption\footnote{where i got it from}}
  \label{somelabel}
  \begin{center}   
    \pgfuseimage{...}
  \end{center}
\end{figure}

The compilation error reads as follows

! Argument of \@caption has an extra }.
<inserted text> 
            \par 
l.192 ...i got it from}}

The actual tex code for my figure with the answer of Leo

\pgfdeclareimage[width=6cm]{aba.medcenter}{aba.medcenter}

\begin{figure}[!ht]
  \begin{minipage}{\textwidth}
    \caption[Medcenter Monthly Medication System]{Medcenter\textsuperscript\textregistered Monthly Medication System\footnote{Quelle Bild: http://www.amazon.com/dp/B000RZPL0M}}
    \label{aba.medcenter}
    \begin{center}
      \pgfuseimage{aba.medcenter}
    \end{center}
  \end{minipage}
\end{figure}

leads to the error

! LaTeX Error: Command \itshape invalid in math mode.

in the same line. If I comment out the foot note, everything compiles fine. \textsuperscript\texttrademark isn't the problem, too.

lockstep
  • 250,273
Matten
  • 5,687

13 Answers13

238

The combination of the answers given by Herbert and by Peter worked for me, i.e. the following code:

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}
   \centering
   \includegraphics{foo}  ...
   \caption[Caption for LOF]{Real caption\protect\footnotemark}
\end{figure}

\footnotetext{blah blah blah}

\end{document}
Dee
  • 2,591
  • 1
  • 14
  • 8
  • 25
    this is the only solution that is really working... thanks – user219882 Dec 06 '12 at 16:32
  • 2
    For me, both this and Herbert's solution worked, however I needed this one to remove my compilation errors. – Chris Apr 29 '14 at 16:58
  • 5
    For me, this works but I also need to take care where \footnotetext{blah blah blah} appear - it realle needs to be inserted between text on the the same page as the table appears in compiled document as Herbert stresses out. – sup Jun 19 '15 at 12:12
  • you need to add a space after the footnotemark if it's within\protect\footnotemark\the text. – ggll Sep 06 '15 at 11:12
  • 1
    Also works for tables – Captain Obvious May 14 '16 at 14:26
  • 3
    This works with the small caveat that If the figure is at the bottom of the page, the footnote will be on the next page. – Max N Dec 03 '17 at 20:58
  • Hello @Dee can you tell me what is the meaning of [Caption for LOF] please? – Gennaro Arguzzi May 18 '22 at 08:05
  • If you need to use a bottom image together with a footnote, you should combine this with the answer of Sean. – Alan CN May 24 '22 at 01:02
  • Putting \protect\footnotemark inside curly brackets works best when there is space after the footnote (in the middle of the sentence). i.e., {\protect\footnotemark}. – Shlomi A Nov 13 '22 at 15:18
204
\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}
  \centering
  \includegraphics{foo}  ...
  \caption[Caption for LOF]{Real caption\footnotemark}
\end{figure}

Anywhere on the same page where the float appears\footnotetext{blah}
but at least before the next footnote\footnote{the nextone}

\end{document}

The optional argument of \caption should always be used when the list of figures is also being used. Otherwise, you have to \protect the \footnote.

  \caption[Caption without FN]{caption with FN}

A useful alternative is to write a footnote-like comment directly under the caption:

\begin{figure}
  \centering
  \includegraphics{foo}  ...
  \caption[Caption for LOF]{Real caption\textsuperscript{a=}}
  \small\textsuperscript{a=} The footnote-like comment under the caption
\end{figure}
Right leg
  • 201
  • 19
    I tried \footnotemark and \footnotetext previously, but I ended up having the foot note a page before the figure, which is not very elegant. Any suggestions for this problem? – Matten Feb 03 '11 at 16:16
  • 5
    Another possible problem is, figure environment may not be at the right page of \footnotetext. – Leo Liu Feb 03 '11 at 16:17
  • 5
    @Matten: could you please read what I wrote ... –  Feb 03 '11 at 16:19
  • 5
    sorry, now I know why you insisted on placing \footnotetext{} on the same page where the float appears :) This solution involves looking up each figure in the produced document and placing the foot notes afterwards. I'm writing a large document with a lot of figures, many requiring the foot notes. Maybe there is another way? But thank you, this is okay for now. I'll accept your answer if no better solutions come up. – Matten Feb 03 '11 at 16:25
  • 2
    @Matten: choose as optional argument for figure [!htb] and you'll get a better placing of the floats. –  Feb 03 '11 at 16:48
  • 2
    FYI, this can lead to skipped footnote numbers because long captions are evaluated twice. See this question. – David B. Aug 27 '13 at 17:04
  • 1
    Make sure to see Dee's answer, as \footnotecaption might need \protect when passed as an argument to \caption, since it's a fragile command. I'm using XeLaTeX and I need \protect to avoid weird errors when using \footnotemark inside \caption. – Andrei Bârsan Nov 26 '13 at 11:00
  • 9
    I had to put a \protect command right before the \footnotemark. Otherwise, this works. For clarification: I used this answer to put a footnote into the caption of a listing made by lstlistings. Maybe \protect is not necessary in other cases. – Dohn Joe May 19 '14 at 13:51
  • 1
    It didn't work for me within the caption of a simple figure (no listings) unless I applied Dohn Joe's comment . – kostrykin Nov 19 '15 at 09:54
  • 1
    @theV0ID: sure. But you didn't use the optional argument. It makes no sense to pass the footnote also into the list of figures! Use always \caption[without fn]{with fn} –  Nov 19 '15 at 10:05
  • 1
    This seems to break hyperrefs in LaTeX PDFs. (Clicking footnote number jumps to beginning of document instead of to actual footnote text.) Is there a simple way to fix this? – jacobq Oct 19 '17 at 05:42
  • Hello @Herbert, can you see my answer here please? https://tex.stackexchange.com/questions/452206/footnote-in-caption-and-in-the-same-page-of-caption?noredirect=1#comment1136974_452206 – Gennaro Arguzzi Sep 24 '18 at 09:37
  • An alternative to protecting the ToT/ToF is to use the stable option of the footmisc package that takes care about the footnote marks automatically. – stefanct Feb 18 '20 at 13:10
  • Another symbol ‡ and horizontal line above the footnote: \caption{The caption\textsuperscript{$\ddagger$}\newline} \line(1,0){82}\newline \small\textsuperscript{$\ddagger$} Footnote text – Andrew Krizhanovsky May 05 '20 at 16:34
  • There is also \footnotesize which could be used instead of \small in the last snippet for more footnote feeling :) – talz Mar 30 '22 at 17:26
  • If there is either no text after a float or the footnote/endnote will end up on an empty page because the float is at the bottom of the page, the margin note is useful:

    \documentclass[]{article} \usepackage[demo]{graphicx} \usepackage{marginnote}

    \begin{document}

    \begin{figure} \centering \includegraphics{foo} ... \caption[Caption for LOF]{Real caption\textsuperscript{a=}} \end{figure}

    \marginnote{\footnotesize\textsuperscript{a} brief note.\footnote{blah blah blah}}

    This works whether the margin note is above or below the float.

    \end{document}

    – afrothetics May 26 '23 at 16:05
  • The alternative is exactly what I want, Thank you! – Wei Shan Lee Nov 19 '23 at 01:36
  • What is the = in the alternative suggestion's superscript command supposed to do? When I tried this, I got a literal equal sign superscripted along with the "a", which I can't imagine anyone would want. – bongbang Jan 06 '24 at 03:49
31

One solution:

\begin{figure}
  \begin{minipage}{\textwidth}
    ...
    \caption[Caption for LOF]%
      {Real caption\footnote{blah}}
  \end{minipage}
\end{figure}

See the TeX FAQ: Footnotes in captions

Leo Liu
  • 77,365
  • thanks for your answer, but I get another error, then...

    ! LaTeX Error: Command \itshape invalid in math mode.

    – Matten Feb 03 '11 at 15:50
  • 4
    @Matten: I don't think it is about footnote in caption. Can you provide a full example in the question? – Leo Liu Feb 03 '11 at 16:16
  • I added the actual figure. If I comment out the foot note, the error disappears. – Matten Feb 03 '11 at 16:22
18

Best way to put the footnote on the same page of the figure:

\usepackage{afterpage}

\afterpage{ \begin{figure} \begin{center} \includegraphics[scale=0.75]{images/the_cited.png} \caption[The LOF caption]{Lorem ipsum. {\tiny Example\footnotemark}} \label{fig:cited_img} \end{center} \end{figure} \footnotetext{Source: \url{http://www.example.com/the_image.png} }

Fonte: http://blog.peschla.net/2012/11/latex-footnotes-in-captions/

Fritz
  • 6,273
  • 31
  • 55
Patucao
  • 181
  • 3
    It will definitely push figure and footnote on the same page, but use with caution! It can have ugly side effects, like pushing a figure into a new section. – Sebastian Schmitz Jul 22 '14 at 08:29
  • 3
    it all works, but believing things such as \tiny{Example\footnotemark}} will come back and bite you sooner or later. it should be {\tiny Example\footnotemark}} -- tiny sets up the “current font”, it doesn’t take an argument in the way you wrote it. – wasteofspace Sep 18 '14 at 14:03
  • 2
    Can someone please explain what afterpage is doing here? – einpoklum Aug 04 '15 at 18:04
  • 1
    @einpoklum: TeX can move a figure around ("float") in the final PDF. Its final position depends on where the surrounding text is placed in the PDF (its quite complex). If the \begin{figure} in the source code comes near the end of a PDF page, TeX will shove the floating figure (with the caption) onto the next page, but the \footnotetext will stay on this page. Afterpage makes sure that TeX "sees" the \begin{figure} and the \footnotetext exactly at the start of the next page. That way, TeX has space for the figure (because the page is still empty) and the footnote together. – Fritz Sep 28 '23 at 11:15
14

In all these answers, people are expecting the footnote to go at the bottom of the page. Sometimes, one wishes the footnote at the bottom of the table, if the footnote appears in the table. I have several ways of dealing with that, but here is one:

\documentclass[12pt]{article}
\parskip 1em
\usepackage{boxhandler}
\begin{document}

 Here is an example of a table with a footnote:
\bxtable[ht]{Caption goes here}
{\begin{tabular}{l}
%FIRST ROW OF OUTER TABULAR IS THE INNER TABLE
\begin{tabular}{|l|c|c|}
\hline
Title & Column 1 & Column 2\\    \hline
First Test & 1.234 & 5.389$^\dag$\\    \hline
Second Test & 3.894 & 1.586~~\\    \hline
\end{tabular}\\    %SECOND ROW OF THE OUTER TABULAR IS THE FOOTNOTE
\rule{0in}{1.2em}$^\dag$\scriptsize This is the footnote text\\    \end{tabular}
}

If you look at the form as defined in the .tex file, you will see
several things of note.  First, there is a tabular within a tabular.
The outer (first to begin, last to end) tabular uses a single column and
contains two ``rows.''  The first ``row'' is the inner tablular and the
second ``row'' is the footnote Next, we use the \verb,\dag, command for
the footnote symbol, but you can use any symbol you like.  I also added
two hard spaces after the 1.586 so that the column alignment wasn't
messed up by the dagger.  I used the rule command of 0 width and 1.2em
height to set the footnote offset below the table.  Making 1.2 a greater
number will increase the offset and vice versa.  Finally, you will note
that I used {\scriptsize\verb,\scriptsize,} to change the size of the
footnote text.  You could make it {\footnotesize\verb,\footnotesize,} or
even keep it the same size as the table {\small\verb,\small,}.

\end{document}

enter image description here

9

To use the usual \footnote command inside \caption and obtain the usual foot notes at the end of page (not just inside the float as using minipages), you can use the package ftnxtra.

Note that in any case, if the float jump to the next page, the foot note will remain in the same place, so this is always a dangerous practice.

Another problem will be the bottom floats with \footnote, since they are placed by default under the foot notes:

MWE2

But this problem can be solved using the fnpos or stfloats packages:

MWE

\documentclass{article}
\usepackage{lipsum} % for dummy text
\usepackage[demo]{graphicx}
\usepackage{ftnxtra}
\usepackage{fnpos} % \makeFNbelow by default 
% or \usepackage{stfloats} \fnbelowfloat
\begin{document}
\lipsum[1-3]
\begin{figure}[b]
\centering
\includegraphics[scale=.2]{image}
\caption{A caption \footnote{A footnote}}
\label{label}
\end{figure}
\lipsum[1-2]
\end{document}
Fran
  • 80,769
  • 1
    I tried you way in your answer, \caption{A caption \footnote{A footnote}} but this no "a footnote" appeared below the page – Nax Apr 23 '14 at 03:25
  • May be appeared above the page? Have you read the second paragraph of my answer? Change \lipsum[1-3] by \lipsum[1-4] and after that \lipsum[1-5] in my MWE and check the result in each case. If this is the problem, the solution is move up/down the figure a few paragraphs until the footnote is showed in the same page that the image (or use the approaches of another answers). – Fran Apr 23 '14 at 05:12
  • This MWE does not work with \usepackage{tikz}. – Mr. Tao May 28 '18 at 18:55
  • It will work loading tikz in last place to avoid the clash of package options. Also using a real image (e.g., example-image instead of image) and without the option demo should work loading even tikz first, but the first seems safer. – Fran Oct 19 '22 at 07:11
8

As mentioned below, sometimes one wants the footnote under the table, rather that at page bottom. Here is the other way I do it

\documentclass[12pt]{article}
\usepackage{boxhandler}
\begin{document}

This is an alternate way to do a footnote in a table, with the minipage
environment.
  \bxtable[ht]{Caption goes here}
  {\begin{minipage}{187.23183pt}   % GUESS (OR CALCULATE) MINIPAGE WIDTH
  \renewcommand\footnoterule{}     % ELIMINATE LITTLE LINE SEPARATER
  \begin{tabular}{|l|c|c|}
  \hline
  Title & Column 1 & Column 2\\      \hline
  First Test & 1.234 & 5.389\footnote{\scriptsize This is the
   footnote text blah blah blah blahty blah}\\      \hline
  Second Test & 3.894 & 1.586~~\\      \hline
  \end{tabular}
  \vspace{-2ex}                    % SHIFT FOOTNOTE UP
  \end{minipage}
  }
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
5

I use minipage, with \protect before \footnote. The footnote text appears right below the figure. This combines several solutions above, the result is quite simple and robust.

The optional argument of \caption, viz., [Short caption] is needed if your document also contains a \listoffigures instruction. If your document does not feature a List of Figures, you can omit the optional argument.

\begin{figure}
    \centering
    \begin{minipage}{1.\textwidth}
    %\renewcommand\footnoterule{} % optional removing footnote bar
        \centering
        \includegraphics[width=.7\linewidth]{somefile}
        \caption[Short caption]{Full caption\protect\footnote{Some footnote text}.}
        \label{fig:somefigure}
    \end{minipage}
\end{figure}
Mico
  • 506,678
THN
  • 173
5

For what it is worth, I simply used a \protect and the regular \footnote seemed to work OK.

doncherry
  • 54,637
Peter
  • 67
5

I had the same issue with table floats. And the discussion here helped me :)

If you surround the float with a savenotes environment, then the snipped \protect\footnote{foo} works. In some cases where the float is far off, you have to move the whole float in the source to the right place in text where the float mechanism of latex wants to put it. This is a job for the finalisation of a document and it is a workaround for the last open issue which is that the footnote sometimes does not appear on the right page. So for me works:

\begin{savenotes}
\begin{table}[tb]
    \begin{tabular}{...}
    ...
    \end{tabular}
    \caption{foo\protect\footnote{bar}}
\end{table}
\end{savenotes}

Someone should test this with figure floats.

4

The only way I could get this working, in my case, was using @Leo Liu's answer (in this same topic https://tex.stackexchange.com/a/10182/35364), plus this workaround to get footnote's numbering ok, for it was displaying a symbol, at first. I got something like this:

\renewcommand\thempfootnote{\arabic{mpfootnote}} %so it will show numbers instead of symbols

\begin{figure}
  \begin{minipage}{\textwidth}
  \setcounter{mpfootnote}{1}  % sets footnote's starting number within this minipage to 1
    ...
    \caption{Caption\footnotemark.}
    \footnotetext{Foot notes}
  \end{minipage}
\end{figure}

This was the only way I was able to have image and footnote on the same page, with desired number. \afterpage solution sent the whole image far away from expected, and the others gave me a footnote text on the page right before my image...

2

The first table in the documentation of the ctable package is a good example, having footnotes in the caption as well as in the table cells. Works for figures, too.

-2

Nothing works fine. The solution is being tricky. Use background colour (white) in the text you wish to hide, i.e., the misplaced footnote number. The problem is fixing the numbering when modifying previous text with more footnotes, you should track numbering.

\begin{figure}[H]
    \centering
    \includegraphics[width=9 cm]{your_figure_file}
    \caption{Your figure's caption$^2$.}{\textcolor{white}{\footnotemark}}
    \label{figure label}
\end{figure}   
\footnotetext{Footnote text.}

Some corections

\begin{figure}[H] 
\centering 
\includegraphics[width=9 cm]{your_figure_file} 
\caption{Your figure's caption$^{footnote corresponding number, you should track}$.}{\textcolor{white}{\footnotemark}} 
\label{figure label} 
\end{figure}
\footnotetext{Footnote text.}
César
  • 1