How do I get subfig
-like captions for a single figure? I've got images that have multiple panels each, and I'd like to make a caption for all the sub-panels, as well as be able to reference each sub-panel. Something like Fig 1A, 1B etc.
Update This is what I've come up with, based on Werner's answer:
\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{graphicx}
\usepackage[labelformat=simple]{caption,subcaption}
\usepackage{hyperref}
\usepackage{varioref}
\renewcommand\thesubfigure{\Alph{subfigure}}
\begin{document}
Tofu gluten-free VHS locavore, viral williamsburg +1 cliche fanny pack leggings terry richardson cred photo booth artisan. Echo park locavore jean shorts shoreditch before they sold out, farm-to-table keytar high life banksy tofu sartorial marfa. Gentrify butcher leggings
\captionsetup{singlelinecheck=false}
\begin{figure}[htb]
\includegraphics[scale=1]{figure2}
\caption{This is a general heading for figure 1.}\label{fig:1}
\subcaptionbox{This is something about figure 1A.}[\linewidth]{\label{fig:1a}}
\subcaptionbox{This is more more more more more more more more more more text about figure 1B. Sustainable terry richardson craft beer homo, cardigan wayfarers blog commodo DIY quinoa sartorial american apparel nostrud.\label{fig:1b}}[\linewidth] {}
\end{figure}
Here's a ref to fig \vref{fig:1b}.Skateboard tempor hoodie helvetica quis. Sustainable terry richardson craft beer homo, cardigan wayfarers blog commodo DIY quinoa sartorial american apparel nostrud. Williamsburg aute mcsweeney's wes anderson. Dolor eiusmod tempor assumenda stumptown, delectus irony laboris
\end{document}
Best Answer
This example, slightly altered from the
subcaption
package documentation is probably what you're looking for (\rule
is meant for illustration only):
The subcaption package necessarily requires its contents to be typeset in a box. As such, the use of the
\subcaptionbox{<heading>}[<width>][<inner-pos>]{<contents>}
is ideal to have possible variable-width (the<width>
argument is optional) contents with a subcaption. Without the<width>
specification, the subfigure will be put in a box of "natural width" equivalent to the width of<contents>
. So, if you have images that are very wide, you don't have to worry about specifying<width>
. However, for a very narrow<contents>
specifying<width>
will allow for correct typesetting of the caption.Also, there are ways to manipulate the representation of the your (sub-)captions and references.