I am using the sidecap
package for side captions. I also want to have subfigures (for example, three or four subfigures labeled with a), b), c) and d), respectively).
When not using the SCfigure
environment, this is what I get (the figures are aligned correctly, but the caption is obviously not at the side):
\documentclass[a4paper,twoside,11pt,openright]{scrbook}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\graphicspath{{./images/}}
\usepackage[wide]{sidecap} % custom captions on the side
\sidecaptionvpos{figure}{t} % captions should be on top
\sidecaptionvpos{table}{t}
\usepackage[font=footnotesize,
format=plain,
labelfont={bf,sf},
nooneline,
textfont={it}]{caption}
\usepackage{subcaption}
\usepackage[twoside]{geometry}
\geometry{a4paper,
left=24.8mm,
top=27.4mm,
%headheight=\baselineskip,
%headsep=2\baselineskip,
textwidth=135mm,
marginparsep=8.2mm,
marginparwidth=28mm
}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:01:054a}}
{\includegraphics[width=0.5\textwidth]{a}}
\subcaptionbox{\label{fig:01:054b}}
{\includegraphics[width=0.5\textwidth]{b}}
\subcaptionbox{\label{fig:01:054c}}
{\includegraphics[width=0.5\textwidth]{c}}
\caption{A test figure}\label{fig:01:054}
\end{figure}
\end{document}
When using SCfigure
but with only two subfigures, the result is satisfying, correctly displaying the side caption:
\begin{SCfigure}
\subcaptionbox{\label{fig:01:054a}}
{\includegraphics[width=0.5\textwidth]{a}}
\subcaptionbox{\label{fig:01:054b}}
{\includegraphics[width=0.5\textwidth]{b}}
% \subcaptionbox{\label{fig:01:054c}}
% {\includegraphics[width=0.5\textwidth]{c}}
\caption{A test figure}\label{fig:01:054}
\end{SCfigure}
When I uncomment the last \subcaptionbox
, this is what I get:
What do I have to do in order to display three or more figures of width=0.5\textwidth
correctly like in the figure
environment? Can't be that I'm the only one who's using side captions in conjunction with subfigures….
Edit: In this German forum thread, the author of the subcaption
package claims that it is compatible with sidecap
.
Best Answer
I would suggest you the more powerful and flexible
floatrow
package (in fact, the author of caption also suggest this package as an alternative tosidecap
).I commented out a spurious blank space after the first
\subcaptionbox
and added a line changing command\\
after the second one; I also added a "fake" four image (a rule of zero height and0.5\textwidth
width) to have the third image flushed left instead of centered: