3

I'd like to put some footnotes in a caption of a subcaption paragraph. However, as you can see the footnode appears in the caption itself, and not at the bottom of the page.

enter image description here

Any solution?

Thanks!

MWE

\documentclass{article}
\usepackage{graphicx}
% To display subfigures
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h!]
  \centering
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{My caption with a footnote\footnote{Yes I like footnotes ! But this one is not a true foot note, because it's not at the bottom of the page...}}
    \label{fig:myfiga}
  \end{subfigure}\hspace*{.05\textwidth}%
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-b}
    \caption{Other caption}
    \label{fig:myfigb}
  \end{subfigure}
  \caption{My big caption}
  \label{fig:myfig}
\end{figure}
\end{document}
1
  • Since a subfigure is basically a minipage, see tex.stackexchange.com/questions/274/… However, since you don't know what page you will wind up on (despite the h!) you may have problems putting it at the bottom of the page. The bottom of the figure would work. Feb 7, 2018 at 18:08

2 Answers 2

7

You can use a \footnotemark and \footnotetext pair:

enter image description here

\documentclass{article}
\usepackage{graphicx}
% To display subfigures
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h!]
  \centering
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{My caption with a footnote\protect\footnotemark}
    \label{fig:myfiga}
  \end{subfigure}\hspace*{.05\textwidth}%
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-b}
    \caption{Other caption}
    \label{fig:myfigb}
  \end{subfigure}
  \caption{My big caption}
  \label{fig:myfig}
\end{figure}
\footnotetext{Yes I like footnotes ! But this one is not a true foot note, because it's not at the bottom of the page...}
\end{document}

Or, if you prefer a more automatic solution (requires LaTeX 2020-10-01, at least), you can redefine \footnote in the figure environment, so that it does \footnotemark, and store the \footnotetext in a hook to be executed after the figure environment, then you can just use \footnote inside figure:

enter image description here

\documentclass{article}
\usepackage{graphicx}
% To display subfigures
\usepackage{caption}
\usepackage{subcaption}

\AddToHook{env/figure/begin}{%
  \DeclareRobustCommand\footnote[1]{%
    \footnotemark
    \expanded{\AddToHookNext{env/figure/after}%
      {\noexpand\setcounter{footnote}{\thefootnote}%
       \noexpand\footnotetext\unexpanded{{#1}}}}}}

\begin{document}
\begin{figure}[h!]
  \centering
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{My caption with a footnote\footnote
      {Yes I like footnotes ! But this one is not a true foot note,
        because it's not at the bottom of the page...}}
    \label{fig:myfiga}
  \end{subfigure}\hspace*{.05\textwidth}%
  \begin{subfigure}[t]{.47\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-b}
    \caption{Other caption\footnote{Another}}
    \label{fig:myfigb}
  \end{subfigure}
  \caption{My big caption\footnote{MOAR}}
  \label{fig:myfig}
\end{figure}
\end{document}
9
  • Is there any option to reduce the coupling of this approach? I have defined each subfigure in its own file and placing the \footnotemark and the \footnotetext in different files sounds confusing to me. Sep 13, 2021 at 13:33
  • @ChristophThiede I added a solution that doesn't require separating the text from the footnotemark Sep 13, 2021 at 15:49
  • My latex compiler does not know \AddToHook (undefined control sequence), is this some miktex specific thing? Sep 13, 2021 at 17:27
  • 1
    @ChristophThiede Something's wrong then, in TeX Live 2021 \AddToHook should already be there. What does latex '\stop' show on the terminal? Sep 16, 2021 at 23:40
  • 1
    @ChristophThiede Ah, so it seems VS Code is not using the right path to TL 2021. I don't use VS Code, so I can't help you further, sorry. Sep 17, 2021 at 22:35
0

FWIW, I had a similar use case but I wanted to display all footnotes spawned from a subfigure right below the parent figure. To achieve this, I have adjusted Phelype's solution from above (requires LaTeX 2020-10-01 or higher):

\usepackage{footmisc}
\AddToHook{env/subfigure/begin}{%
    \DeclareRobustCommand\footnote[1]{%
        \mpfootnotemark
        \expanded{\AddToHookNext{env/subfigure/after}%
            {\noexpand\setcounter{mpfootnote}{\arabic{mpfootnote}}%
             \noexpand\footnotetext\unexpanded{{#1}}}}}}
MWE:
\documentclass{article}
\documentclass{article}
\usepackage{graphicx}
% To display subfigures
\usepackage{subcaption}

\usepackage{footmisc} \AddToHook{env/subfigure/begin}{% \DeclareRobustCommand\footnote1{% \mpfootnotemark \expanded{\AddToHookNext{env/subfigure/after}% {\noexpand\setcounter{mpfootnote}{\arabic{mpfootnote}}% \noexpand\footnotetext\unexpanded{{#1}}}}}}

\begin{document}

\begin{figure*} \begin{minipage}{\linewidth} \begin{center} \begin{subfigure}[t]{.47\linewidth} \includegraphics[width=\linewidth]{example-image-a} \caption{Other caption} \end{subfigure}% \hspace*{.05\textwidth}% \begin{subfigure}[t]{.47\linewidth} \includegraphics[width=\linewidth]{example-image-c} \caption[LoF entry]{My caption with a footnote\footnote{This footnote is displayed right below the subfigure at the bottom of the containing parent figure.}} \end{subfigure}

        \caption{My big caption.}
        \label{fig:usage_mining/patterns}
    \end{center}
\end{minipage}

\end{figure*}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .