# How to place a caption in the bottom right corner of a grid of images?

I have a grid of images as shown below.

This is achieved using the code below (taken from: [how to insert a fixed number of figures per row/col])2

\begin{figure}
\captionsetup{justification=centering,textfont=small}
\centering
\subcaptionbox*{A subcaption that is wider than the image above it.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic1}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic2}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic3}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic4}}\\[4mm]
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic5}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic6}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic7}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic8}}\\[4mm]
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic9}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic10}}\hfill
\subcaptionbox*{}[59.3mm]{}
\end{figure}


I would like to place a caption in the bottom right (as shown in the attached picture) and be able to control it like a normal caption (i.e. auto numbering, formatting, vertical/horizobtal justification etc). How best to do this?

Caption like this?

Just put caption inside minipage or similar parbox, which follows last subfigure.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{1em}

\begin{document}
\begin{figure}
\centering
\subcaptionbox{A subcaption that is wider than the image above it.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\\[4mm]
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\\[4mm]
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\caption{main caption. 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 text text text}
\end{minipage}
\end{figure}
\end{document}


Next time please provide MWE begining with \documentclas{...} and ended with\end{document} ...

• Sorry, I copied the code from Lyx and forgot to add the necessaries. Many thanks. – Josh Faure Jun 7 '15 at 14:24

You can do that also with the floatrow package and its \RawCaption command:

\documentclass{article}
\usepackage{caption, subcaption}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}

\DeclareFloatVCode{myrowsep}{\vskip 3.5ex}
\begin{document}

\begin{figure}
\centering
\floatsetup{justification =centering, rowpostcode=myrowsep, floatwidth = 28mm}
\captionsetup{justification=centering,textfont=small}
\ffigbox{
\begin{subfloatrow}[4]
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic1}}{\caption{A subcaption}\label{pic1}}%A subcaption that is wider than the image above it
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic2}}{\caption{A second subcaption}\label{pic2}}
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic3}}{\caption{A third subcaption}\label{pic3}}
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic4}}{\caption{A fourth subcaption}\label{pic4}}
\end{subfloatrow}
\begin{subfloatrow}[4]
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic5}}{\caption{A fifth subcaption}\label{pic5}}
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic6}}{\caption{A sixth subcaption}\label{pic6}}
\ffigbox[32mm]{\includegraphics[width=22mm, height=32mm]{pic7}}{\caption{A seventh subcaption}\label{pic7}}
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic8}}{\caption{An eighth subcaption}\label{pic8}}
\end{subfloatrow}
\begin{subfloatrow*}[4]
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic9}}{\subcaption{A ninth subcaption}\label{pic9}}
\ffigbox{\includegraphics[width=22mm, height=32mm]{pic10}}{\subcaption{A tenth subcaption}\label{pic10}}%
\ffigbox[\dimexpr56mm + 4em\relax][][t]{}{\captionsetup{justification=RaggedRight}\RawCaption{\parbox[t][32mm]{48mm}{\caption{A global caption.\\ Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. }\label{glo}}}}
\end{subfloatrow*}
}{}
\end{figure}

\end{document}