# Caption inside of a minipage

I'm looking to include my a figure title (caption) inside of a footnote below the figure rather than above. I commonly use the minipage command, thought including the caption below destroys my alignment. I've included my code below:

\begin{figure}[H]
%{\caption*{Historical Output and Welfare Multipliers\label{figure:historical_mult}}}
%\caption{HISTORICAL OUTPUT AND WELFARE MULTIPLIERS\label{figure:historical_mult}}
\vspace{-5mm}
\begin{center}
\includegraphics[height=4in,width=6in]{multiplier_graph.pdf}
\end{center}
\vspace{-15mm}
\hfill\begin{minipage}[t]{140mm}
\captionof{figure}{Historical output and welfare multipliers.\label{figure:historical_mult}}

{Big long footnote text.}

\end{minipage}
\end{figure}


Any help would be greatly appreciated!

• What's not clear to me is whether you want a footnote and a caption, or just a caption. In the first case, do you want the caption above or below the footnote? – Bernard Jul 14 '14 at 16:30
• Hi @Bernard, I would like both the caption and the footnote to be in one solid block below my figure. Something like... Figure 1.1 Historical Simulation. In the above figure I show the... etc. – Jonathan Jul 14 '14 at 16:47
• What sort of alignment were you hoping for? I take it you want the caption written on top of the image. Do you want "Figure" even with the left side of the minipage? – John Kormylo Jul 14 '14 at 16:57
• I'd like the minipage, including my footnote and a caption which labels my figure for my table of contents, to be fully aligned with the margins on my figure. A minipage environment would normally expand and contract my text in a way that sharp right and left margins are preserved. I'd like the same thing, only now to include the \caption command for my table of contents. Thanks! – Jonathan Jul 14 '14 at 17:05
• Interestingly, I could not get \captionsetup to increase the width beyond a certain limit nor find anything in the manual about this. – John Kormylo Jul 14 '14 at 17:34

With the threeparttablex, you can have something that looks like what you want, if I understand well: you can have the caption under the figure, then the notes of the same width as the table. For that, one needs to use the measuredfigure environment. As there seems to be a bug with labels in the measuredfigure environment, I had to define a \fakecaption command to make the \ label work. Here is the code:

    \documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[draft]{graphicx}
\usepackage{caption, threeparttablex, float}%
\captionsetup{position = below, labelfont = bf, textfont = it}
\DeclareCaptionFormat{empty}{\relax}
\usepackage{cleveref}

\begin{document}

Text text text text text text text text text text text text text text text text text text text text text text text text text.

\begin{figure}[H]
\centering
\begin{measuredfigure}
\includegraphics[height=3in,width=4in]{multiplier_graph.pdf}
\caption{Historical output and welfare multipliers.}
\bigskip
\begin{tablenotes}[flushleft]%
\item\hskip-\labelsep A very long footnote text. A very long footnote text. A very long footnote text. A very long footnote text.
\end{tablenotes}
\end{measuredfigure}
\fakecaption\label{figure:historical_mult}
\end{figure}

\noindent As we can see from \cref{figure:historical_mult}, …

\end{document}


• This works great for the figure and footnote, but it seems to clear my labels. I run the file several times acknowledging that it requires multiple runs to save and then print the \ref{} commands, but no luck. Sorry for the trouble! – Jonathan Jul 14 '14 at 19:57
• @Jonathan: I have a workaround for the label problem, through a \fakecaption command, that prints nothing and takes no vertical space but allows a label. See my updated answer. – Bernard Jul 14 '14 at 23:37

When all else fails, you can always write your own caption.

\documentclass{article}
\usepackage[margin=1in]{geometry}
%\usepackage{caption}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{hyperref}

\newif\iffigure
\newif\iftable

\newcommand{\widecaptionof}[2]% #1=figure/table, #2=text
{\refstepcounter{#1}%
\begingroup% trying not to load other packages
\def\a{#1}%
\def\b{figure}%
\ifx\a\b\global\figuretrue\else\global\figurefalse\fi%
\def\b{table}%
\ifx\a\b\global\tabletrue\else\global\tablefalse\fi%
\endgroup%
\iffigure%
\textbf{Figure \thefigure: }{#2}%
\fi%
\iftable%
\textbf{Table \thetable: }{#2}%
\fi%
\par\medskip}

\begin{document}
\listoffigures

\bigskip
See \ref{figure:historical_mult} for details.

\begin{figure}[H]
%{\caption*{Historical Output and Welfare Multipliers\label{figure:historical_mult}}}
%\caption{HISTORICAL OUTPUT AND WELFARE MULTIPLIERS\label{figure:historical_mult}}
%\vspace{-5mm}
\begin{center}
\includegraphics[height=4in,width=6in]{example-image}
\end{center}
%\vspace{-15mm}
\hfil\begin{minipage}{140mm}
\widecaptionof{figure}{Historical output and welfare multipliers.}
\label{figure:historical_mult}
Big long footnote text.
\end{minipage}
\end{figure}

\end{document}