2

I have this LaTeX code:

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

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}{0.6\linewidth}
        \includegraphics[width=\linewidth]{cat.pdf}
        \caption{}
    \end{subfigure}
    \begin{subfigure}{0.6\linewidth}
        \includegraphics[width=\linewidth]{cat.pdf}
        \caption{}
    \end{subfigure}
    \begin{subfigure}{0.6\textwidth}
        \includegraphics[width=\textwidth]{cat.pdf}
        \caption{}
    \end{subfigure}
    \caption{3 subfigures: (a), (b) and (c).}
    \label{fig:label}
\end{figure}

\end{document}

I would like the captions of the subfigures (in this case only the letter) to appear to the left of the images, and not below. This is an image of the desired output:

desired output

I find it really frustrating that such a simple thing can't be done in a simple way (I still can't find how to do it).

Thank you very much.

1
  • 1
    Put sub-images in table. One column use for sub-captions, another for images.
    – Zarko
    Commented Apr 13, 2015 at 23:38

2 Answers 2

3

You can use tabular as suggested by Zarko. This is another method where we use two subfigures, in one we place only sub caption and in second, only figure. Don't forget to leave a blank line in the middle as I did.

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

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}{0.05\linewidth}
      \caption{}
    \end{subfigure}
    \begin{subfigure}{0.6\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}

    \begin{subfigure}{0.05\linewidth}
      \caption{}
    \end{subfigure}
    \begin{subfigure}{0.6\linewidth}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}

    \begin{subfigure}{0.05\linewidth}
      \caption{}
    \end{subfigure}
    \begin{subfigure}{0.6\textwidth}
        \includegraphics[width=\textwidth]{example-image-c}
    \end{subfigure}
    \caption{3 subfigures: (a), (b) and (c).}
    \label{fig:label}
\end{figure}

\end{document}

enter image description here

Adjust 0.05\linewidth in \begin{subfigure}{0.05\linewidth} if you have text as caption so that it doesn't look narrow.

0
1

With the floatrow package, this is easy:

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

\begin{document}

\begin{figure}
  \floatsetup[subfigure]{style=plain,capposition = beside, capbesideposition={left, center},capbesidesep=none, capbesidewidth =0.5em, rowpostcode = captionskip}
  \ffigbox{%
    \begin{subfloatrow}[1]
      \fcapside{\caption{}}{\includegraphics[width=0.6\linewidth]{dejeuner.jpeg}}
    \end{subfloatrow}\\
    \begin{subfloatrow}[1]
      \fcapside{\includegraphics[width=0.6\linewidth]{dejeuner.jpeg}}
      {\caption{}}
    \end{subfloatrow}\\
    \begin{subfloatrow}[1]
      \fcapside{\includegraphics[width=0.6\linewidth]{dejeuner.jpeg}}
      { \caption{}}
    \end{subfloatrow}\\
    }{\caption{3 subfigures: (a), (b) and (c).}
    \label{fig:label}}
\end{figure}

\end{document} 

enter image description here

You must log in to answer this question.

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