# putting a footnote in the caption of a table within a figure

I have lots of figures with multiple subfigures and associated tables, and I have been asked to add footnotes to them.

Here is a minimalish working example of a figure including a table on a page with my setup. I would like to add a footnote to the captionof{table} environment. As this is going to be within a chapter in which footnotes are numbered I also want to number it correctly.

I found some questions that were close but couldn't make their answers work.

% !TEX TS-program = pdflatexmk
%%
\documentclass[a4paper,11pt,twoside]{report}
\usepackage{amsmath, amsthm, amssymb}
%\usepackage{epstopdf}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{fixltx2e}
\usepackage[mathscr]{euscript}
\usepackage{hyperref}
\usepackage{setspace}                   %https://tex.stackexchange.com/questions/819/double-line-spacing line spacing
\usepackage[section]{placeins}
\usepackage[labelfont=bf]{caption}
\usepackage{array}
\usepackage[titletoc]{appendix}
\usepackage{upgreek}
\usepackage{fancyhdr}
\usepackage{chapterbib}
\usepackage[version=3]{mhchem}
\usepackage{pdfpages}
\usepackage{calc}
%\usepackage{rotating}
\usepackage[all]{xy}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,calc,arrows.meta,shapes,fit,backgrounds}
\usepackage[noprefix]{nomencl}
\usepackage{alltt}
\usepackage{rotating}
%\usepackage[final]{pdfpages}
\usepackage{csquotes}

\fancypagestyle{IHA-fancy-style}{%
\fancyfoot[LE,RO]{\thepage\ }% Custom footer
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}

% Redefine the plain page style
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[LE,RO]{\thepage\ } %
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}

\pagestyle{IHA-fancy-style}

\makeatletter
\newcounter{imagepage} \newcommand*{\foreachpage}[2]{%
\begingroup
\sbox0{\includegraphics{#1}}%
\xdef\foreachpage@num{\the\pdflastximagepages}%
\endgroup
\setcounter{imagepage}{0}%
\@whilenum\value{imagepage}<\foreachpage@num\do{%
\stepcounter{imagepage}%
#2\relax }%
}
\makeatother

%allow smaller pieces of text bellow figures
\renewcommand{\textfraction}{0.15}  % allow minimal text w. figs
\renewcommand{\topfraction}{0.84}   % allow minimal text w. figs
\renewcommand{\floatpagefraction}{0.8}  % allow minimal text w. figs
%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%

\noindent\begin{figure}%{\textwidth}
\centering
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1AssPhase}
\end{minipage}\hfil
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1DissPhase}
\end{minipage}

\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1AssPhase}
\end{minipage}\hfill
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1DissPhase}
\end{minipage}

%\captionof{figure}[Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase]{Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase (cyan) alongside nullcline-planes $x_1$ in blue, $x_2$ in red, $C$ in green}
\caption[Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase]{Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase (cyan) alongside nullcline-planes $x_1$ in blue, $x_2$ in red, $C$ in green.}
\label{LwT2PhasePort}

\vspace{\floatsep}% standard interfloat separation
\label{tab:LwTsols}
\small
\footnotesize
\setlength{\extrarowheight}{1.5pt}
\begin{tabular}
{ | c | c  c  c  c  c c c c |  }
\hline
Parameter                      &$k_{a1}$              & $k_{a2}$       & $k_{d1}$& $k_{d2}$&     $R$            & $C_T$ & $k_m$                                         & $h$ \\%\hline
&M$^{-1}$s$^{-1}$      &M$^{-1}$s$^{-1}$&s$^{-1}$ &s$^{-1}$ & pg nm$^{-2}$       & nM    &  pgnm$^{-2}$ M$^{-1}$s$^{-1}$                  &pgnm$^{-2}$ M$^{-1}$ \\\hline%\hline
Value                          &6$\times 10^{-4}$                  &5$\times 10^{-4}$            &7$\times 10^{-3}$     &1$\times 10^{-2}$     & 500                &  100  & 10$^{-4}$                                     & 10$^{-6}$  \\\hline
\end{tabular}
\captionof{table}{Values taken by parameters in Fig. \ref{LwT2PhasePort} }%add key
\end{figure}

\end{document}

• In the captionof{table}{...}, \ref{LwT2dPhasePort} is not found in the document. Please update your example to have something to actually refer to. – M. Al Jumaily May 24 '19 at 10:57
• i removed the second ref as requested – Abijah May 24 '19 at 11:14
• The way that floats work, all global changes are made immediately, not when when the float shows up. OTOH, \protected@write will be delayed until the float shows up. – John Kormylo May 24 '19 at 14:56

One can place a \footnotemark in the \captionof as long as an alternative text for the list of tables is provided in square brackets (the accompanying \footnotetext should be outside the figure):

\documentclass[a4paper,11pt,twoside]{report}
\usepackage{amsmath, amsthm, amssymb}
%\usepackage{epstopdf}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{fixltx2e}
\usepackage[mathscr]{euscript}
\usepackage{hyperref}
\usepackage{setspace}                   %https://tex.stackexchange.com/questions/819/double-line-spacing line spacing
\usepackage[section]{placeins}
\usepackage[labelfont=bf]{caption}
\usepackage{array}
\usepackage[titletoc]{appendix}
\usepackage{upgreek}
\usepackage{fancyhdr}
\usepackage{chapterbib}
\usepackage[version=3]{mhchem}
\usepackage{pdfpages}
\usepackage{calc}
%\usepackage{rotating}
\usepackage[all]{xy}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,calc,arrows.meta,shapes,fit,backgrounds}
\usepackage[noprefix]{nomencl}
\usepackage{alltt}
\usepackage{rotating}
%\usepackage[final]{pdfpages}
\usepackage{csquotes}

\fancypagestyle{IHA-fancy-style}{%
\fancyfoot[LE,RO]{\thepage\ }% Custom footer
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}

% Redefine the plain page style
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[LE,RO]{\thepage\ } %
\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible
}

\pagestyle{IHA-fancy-style}

\makeatletter
\newcounter{imagepage} \newcommand*{\foreachpage}[2]{%
\begingroup
\sbox0{\includegraphics{#1}}%
\xdef\foreachpage@num{\the\pdflastximagepages}%
\endgroup
\setcounter{imagepage}{0}%
\@whilenum\value{imagepage}<\foreachpage@num\do{%
\stepcounter{imagepage}%
#2\relax }%
}
\makeatother

%allow smaller pieces of text bellow figures
\renewcommand{\textfraction}{0.15}  % allow minimal text w. figs
\renewcommand{\topfraction}{0.84}   % allow minimal text w. figs
\renewcommand{\floatpagefraction}{0.8}  % allow minimal text w. figs
%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%

\noindent\begin{figure}%{\textwidth}
\centering
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1AssPhase}
\end{minipage}\hfil
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1DissPhase}
\end{minipage}

\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1AssPhase}
\end{minipage}\hfill
\begin{minipage}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
%\captionof{subfigure}{}
\label{LwT1DissPhase}
\end{minipage}

%\captionof{figure}[Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase]{Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase (cyan) alongside nullcline-planes $x_1$ in blue, $x_2$ in red, $C$ in green}
\caption[Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase]{Visualisations of a solution trajectory for the Langmuir two concentration model in the association phase (cyan) alongside nullcline-planes $x_1$ in blue, $x_2$ in red, $C$ in green.}
\label{LwT2PhasePort}

\vspace{\floatsep}% standard interfloat separation
\label{tab:LwTsols}
\small
\footnotesize
\setlength{\extrarowheight}{1.5pt}
\begin{tabular}
{ | c | c  c  c  c  c c c c |  }
\hline
Parameter                      &$k_{a1}$              & $k_{a2}$       & $k_{d1}$& $k_{d2}$&     $R$            & $C_T$ & $k_m$                                         & $h$ \\%\hline
&M$^{-1}$s$^{-1}$      &M$^{-1}$s$^{-1}$&s$^{-1}$ &s$^{-1}$ & pg nm$^{-2}$       & nM    &  pgnm$^{-2}$ M$^{-1}$s$^{-1}$                  &pgnm$^{-2}$ M$^{-1}$ \\\hline%\hline
Value                          &6$\times 10^{-4}$                  &5$\times 10^{-4}$            &7$\times 10^{-3}$     &1$\times 10^{-2}$     & 500                &  100  & 10$^{-4}$                                     & 10$^{-6}$  \\\hline
\end{tabular}
\captionof{table}[Values taken by parameters in Fig. \ref{LwT2PhasePort}]{Values taken by parameters in Fig. \ref{LwT2PhasePort}\footnotemark}%add key
\end{figure}
\footnotetext{text}

\end{document}