3

I want to add vertical (rotated) text at the beginning of a row of subfigures using the subcaption package. My solution right now is to create a separate subfigure:

\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
  \begin{subfigure}{1in}
    \rotatebox{90}{\makebox[2in]{center}}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}
\end{figure}

\end{document}

which works fine except that I don't want any caption for the vertical text. However if I remove the "\caption{}" line then the text is no longer vertically aligned with the two subfigures. Is there a better way to do this?

1
  • 1
    There might be a simpler alternative, but you could use the starred version for the first caption: \caption*{}. Nov 14, 2014 at 17:56

1 Answer 1

2

Using the origin=c option to \rotatebox will give text that is vertically centered without the use of an extra subfigure. Alternatively you can [t] align the subfigures are rotate with origin=l:

origin=c:

Sample output

origin=l and subfigures with [t]:

Second sample

\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
  \rotatebox[origin=c]{90}{\makebox[2in]{center}}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}
\end{figure}

\begin{figure}
  \rotatebox[origin=l]{90}{\makebox[2in]{center}}%
  \quad
  \begin{subfigure}[t]{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}[t]{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}
\end{figure}

\end{document}

You must log in to answer this question.

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