# Subfigures with number inside figure

I like to have 3 (or whatever number) images and I like them to be as subfigures with numbering a), b), c) and so on:
Here, the numbering is done manually and I wonder if there is a way to let LaTeX do the job. Of course the referencing should still work and the position of the label may be chosen freely.

• What about an usual caption or subcaption ? – Header12 Aug 12 '13 at 15:27
• This could be confusing. In certain situations the numbering might be mistaken as part of the image itself. I would suggest you to have the numbering outside the figures. – Gonzalo Medina Aug 12 '13 at 15:42
• @GonzaloMedina - your comment, I would say, is only an argument against automation, not against internal numbering (that may have been what you meant, I'm not sure) as manual internal numbering is at least reviewed by the author. Of course it's perfectly possible to have a class of figure that has a nice bit of white space in a repeatable position, where a label would fit perfectly - or for there to be no possibility of confusion for some other reason. – Chris H Aug 12 '13 at 16:08
• I find it much better to do this in the graphics package. But it depends on your production process, I guess. At least doing it in latex you have flexibility to reorder the figures. – Andy Clifton Aug 12 '13 at 16:12

Note how I inset "(A)" on the upper left of your image with the \topinset macro. The third and fourth arguments are the vertical distance down (or up with \bottominset) and the horizontal distance relative to the stackalignment (in this case, relative to left edge).

These inset commands can be used to inset images, as well as insetting text.

\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx}
\begin{document}
\def\stackalignment{l}
\topinset{\bfseries(A)}{\includegraphics[width=5in]{vjbrp}}{0.25in}{.4in}
\end{document}


Is this what you were looking for?

\documentclass{article}
\usepackage{subcaption}
\usepackage{color}

\begin{document}

\begin{figure}
\centering
\begin{subfigure}{.5\textwidth}
\centering
\color{red}
\rule{0.8\textwidth}{3cm}
\caption{A subfigure}
\label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
\centering
\color{blue}
\rule{0.8\textwidth}{3cm}
\caption{A subfigure}
\label{fig:sub2}
\end{subfigure}
\begin{subfigure}{1\textwidth}
\centering
\color{green}
\rule{0.8\textwidth}{3cm}
\caption{A subfigure}
\label{fig:sub3}
\end{subfigure}
\caption{A figure with three subfigures}
\label{fig:test}
\end{figure}

\end{document}


You can leave out the color stuff and replace \rule... with your \includegraphics-commands. The colored boxes just serve as illustration.

• No. I like to be able to place the (a), (b) etc IN the figure like in my example. Another user wants the exact same thing as I do and maybe expresses himself better. – DaPhil Aug 18 '13 at 19:07