How to properly use subcaption with threeparttable
I replaced the subcaption
with the subfig
package and used the \subfloat
command, now it works like a charm with \tnotes
in the (sub)caption.
Another option, without using threeparttable, can be found here using a simple \footnotesize
inside figure environment.
\documentclass[a4paper]{memoir}
\usepackage{geometry,array,graphicx,float,caption}
\usepackage{subfig}
\usepackage{threeparttable}
\begin{document}
\captionsetup[subfloat]{position=bottom}
\begin{figure}[ht]
\caption{Samples picture} \label{fig:picture_temp}
\centering
\begin{threeparttable}
\subfloat[Before]{
\includegraphics[width=6cm]{example-image-b}
\label{fig:1a}
}
~
\subfloat[After \tnote{a}]{
\includegraphics[width=6cm]{example-image-c}
\label{fig:1b}
}
\begin{tablenotes}
\item Diference in samples over the range of temperatures.
\item[a] Calculated.
\end{tablenotes}
\end{threeparttable}
\end{figure}
\end{document}
Inside threeparttable
the meaning of \@caption
is changed. You want that inside of subfigure
the meaning is as established by caption
.
\documentclass[a4paper]{memoir}
\usepackage{geometry,array,graphicx,caption}
\usepackage{subcaption}
\usepackage{threeparttable}
\usepackage{etoolbox}
\makeatletter
\AtBeginEnvironment{subfigure}{\let\@caption\caption@original@caption}
\AtBeginDocument{\let\caption@original@caption\@caption}
\makeatother
\begin{document}
\begin{figure}[ht]
\caption{Samples picture} \label{fig:picture_temp}
\centering
\begin{threeparttable}
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=6cm]{example-image-b}
\caption{Before}
\label{fig:1a}
\end{subfigure}
~
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=6cm]{example-image-c}
\caption{After}
\label{fig:1b}
\end{subfigure}
\begin{tablenotes}
\item Difference in samples over the range of temperatures.
\end{tablenotes}
\end{threeparttable}
\end{figure}
\end{document}
The original meaning (as further modified by memoir
) has to be saved at begin document. With \AtBeginDocument
I restore that meaning, but only inside subfigure
. You may need the same for tables.