2

I am trying to create an image composed of three subfigures that looks like this:

enter image description here

Key features I am trying to capture are:

  • No vertical space between the subfigures
  • Subfigure letters are in the top left hand corner
  • I would like to be able to label the subfigures so that I can refer to them in text so I dont want to put the subfigure letters in their own subfigure
  • as a bonus I would like to be able to control the aesthetics of the subfigure labels if possible

Looking at a couple of questions like this one or this one I have had a go but am not very familiar with this and cant get it to work. Here is a MWE that does not actually work as I get

LaTeX Error: No counter 'subfigure@save' defined.

which I gather is because the subfig and subcaption packages conflict???

\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{subfig}

\begin{document}

\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{figure}
\centering

\sidesubfloat[]{
\begin{subfigure}[b]{0.8\linewidth}
  \includegraphics[width=\linewidth]{}
\end{subfigure}}\\[-2ex]

\sidesubfloat[]{
\begin{subfigure}[b]{0.8\linewidth}
  \includegraphics[width=\linewidth]{}
\end{subfigure}}\\[-2ex]

\sidesubfloat[]{
\begin{subfigure}[b]{0.8\linewidth}
  \includegraphics[width=\linewidth]{}
\end{subfigure}}

\caption{Test Caption}
\label{fig: my-label}
\end{figure}

\end{document} 

Any help is much appreciated.

1

Inspired by solution in sidesubfloats (to which your question is very similar):

    \documentclass{article}
    \usepackage{floatrow}
    \usepackage{graphicx}
    \usepackage{subfig}
    \usepackage{caption}
    \floatsetup[figure]{style=plain,subcapbesideposition=top}

    \usepackage[margin=70mm]{geometry}

    \begin{document}
        \begin{figure}[h]\centering
    \sidesubfloat[]{\includegraphics[width = 0.8\textwidth]{example-image}\label{fig:a}}\\[-1pt]
   \sidesubfloat[]{\includegraphics[width = 0.8\textwidth]{example-image}\label{fig:b}}\\[-1pt]
    \sidesubfloat[]{\includegraphics[width = 0.8\textwidth]{example-image}\label{fig:c}}
    \caption{Main caption}
        \end{figure}
Figure \ref{fig:myfigure} consist three sub figures: \ref{fig:a}, \ref{fig:b} and \ref{fig:c} ...
    \end{document}

Edit: Now I also succeed to managed referencing of sub figures (usually helps to read package documentations ...). Code above is accordingly upgraded/correct, and picture now show the referencing ...

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.