8

I am using the subcaption package to place figures side-by-side, and I need to have labels in the form of letters to the top left of the figures.

I.e. I am trying to achieve

A [Figure] B [Figure]
  [Figure]   [Figure]
  [Figure]   [Figure]
  [Figure]   [Figure]
  [Figure]   [Figure]

where a single image is denoted by:

  [Figure] 
  [Figure] 
  [Figure] 
  [Figure]
  [Figure] 

I am happy for my figures to be aligned to the top of the float.

I have tried:

\documentclass[12pt,a4paper,twoside,table]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat = empty,position=top]{subcaption} 
\begin{document}
\begin{figure}[tb]
\centering
\begin{subfigure}[t]{0.05\textwidth}
\textbf{A}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{figures/figure1.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.05\textwidth}
\textbf{B}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{figures/figure2.pdf}
\end{subfigure}
\caption[This is for my LOF]{Yay I am usually a huge figure caption}
\label{Iamalabel}
\end{figure}
\end{document}

How do I get the labels to be

(1) Letters A, B ...

(2) Actually properly positioned as above?

1
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Feb 1, 2015 at 11:34

1 Answer 1

13

Something like this?

enter image description here

Code

\documentclass[12pt, a4paper, twoside]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat=empty, position=top]{subcaption}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}

\begin{document}
\begin{figure}[tb]
  \centering
  \begin{subfigure}[t]{0.03\textwidth}
    \textbf{A}
  \end{subfigure}
  \begin{subfigure}[t]{0.45\textwidth}
    \includegraphics[width=\linewidth, valign=t]{figures/figure1.pdf}
  \end{subfigure}\hfill
  \begin{subfigure}[t]{0.03\textwidth}
    \textbf{B}
  \end{subfigure}
  \begin{subfigure}[t]{0.45\textwidth}
    \includegraphics[width=\linewidth, valign=t]{figures/figure2.pdf}
  \end{subfigure}
  \caption[This is for my LOF]{Yay I am usually a huge figure caption}
  \label{Iamalabel}
\end{figure}
\end{document} 

The trick is to add the option valign=t to \includegraphics, provided by the package adjustbox with the option export.


An example with multiple figures:

\documentclass[12pt, a4paper, twoside]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat=empty, position=top]{subcaption}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}

\begin{document}
\begin{figure}[tb]
  \centering
  \begin{subfigure}[t]{0.03\textwidth}
    \textbf{A}
  \end{subfigure}
  \begin{subfigure}[t]{0.45\textwidth}
    \includegraphics[width=\linewidth, valign=t]{figures/figure1.pdf}\\[3pt]
    \includegraphics[width=\linewidth]{figures/figure1.pdf}\\[3pt]
    \includegraphics[width=\linewidth]{figures/figure1.pdf}
  \end{subfigure}\hfill
  \begin{subfigure}[t]{0.03\textwidth}
    \textbf{B}
  \end{subfigure}
  \begin{subfigure}[t]{0.45\textwidth}
    \includegraphics[width=\linewidth, valign=t]{figures/figure2.pdf}\\[3pt]
    \includegraphics[width=\linewidth]{figures/figure1.pdf}\\[3pt]
    \includegraphics[width=\linewidth]{figures/figure1.pdf}
  \end{subfigure}
  \caption[This is for my LOF]{Yay I am usually a huge figure caption}
  \label{Iamalabel}
\end{figure}
\end{document} 

enter image description here

Note that, since you are not using subcaptions for your subfigures, you replace all your subfigures with minipages.

2
  • any way to get the letter labels (A, B) higher up on the page -- so that they're diagonally up and to the left from the top left corners of the images?
    – abcd
    May 16, 2016 at 2:14
  • You could also make this work without the \usepackage[export]{adjustbox} (and valign=t) by adding \vskip 0pt at the top of every subfigure that contains an image.
    – Augustin
    Mar 18, 2019 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .