1

How can I put the subcaptions in the kaobook package into the center of the the subfigure. I tried \captionsetup[subfigure]{justification=centering}, but this has no effect on the placement of the subcaptions.
I expect there is some interaction with the floatrow package used by kaobook, but I could not find the proper option to change the position of the subcaption.

MWE:

\documentclass{kaobook}

\usepackage{subcaption}

\begin{document}

\begin{figure*}
  \captionsetup[subfigure]{justification=centering}
  \begin{subfigure}{0.45\textwidth}
    \includegraphics[width=1\linewidth,keepaspectratio]{example-image-1x1}
    \caption{subcap 1}
  \end{subfigure}
  \begin{subfigure}{0.45\textwidth}
    \includegraphics[width=1\linewidth,keepaspectratio]{example-image-golden-upright}
    \caption{subcap 2} 
  \end{subfigure}
  \caption{big caption}
\end{figure*}

\end{document}

2 Answers 2

2

kao.sty sets the following caption options:

% Set the global caption style
\captionsetup{
    format=margin, % Use the style previously declared
    strut=no,%
    %hypcap=true, % Links point to the top of the figure
    singlelinecheck=false,%
    %width=\marginparwidth,
    indention=0pt, % Suppress indentation
    parindent=0pt, % Suppress space between paragraphs
    aboveskip=6pt, % Increase the space between the figure and the caption
    belowskip=6pt, % Increase the space between the caption and the table
}

To get short (sub-)caption centered, one needs to revert the format=margin and singlelinecheck=false setting, e.g.:

\documentclass{kaobook}

\usepackage{subcaption}

\begin{document}

\begin{figure*}
  \captionsetup[subfigure]{format=plain,singlelinecheck=true}
  \begin{subfigure}{0.45\textwidth}
    \includegraphics[width=1\linewidth,keepaspectratio]{example-image-1x1}
    \caption{subcap 1}
  \end{subfigure}
  \begin{subfigure}{0.45\textwidth}
    \includegraphics[width=1\linewidth,keepaspectratio]{example-image-golden-upright}
    \caption{subcap 2} 
  \end{subfigure}
  \caption{big caption}
\end{figure*}

\end{document}
1

Thanks to P.M. for pointing me to pointing to the \captionsetup. The solution works but there a slight differences in the font size of the subcaption.
To solve this issue one can define a caption format similar to margin and @margin@par in kao.sty and replace \justifying with \Centering.

\newcommand{\subcappar}{%
    \Centering% center text
    \setlength{\RaggedRightParindent}{0em}% Suppress indentation
    \setlength{\parindent}{0em}% Suppress indentation
    \setlength{\parskip}{0.5pc}% Set the space between paragraphs
    %%\singlespacing% Set the space between lines
    \frenchspacing% No additional space after periods
    \normalfont% Use the default font
    \footnotesize% Use a smaller size
}
\DeclareCaptionFormat{subcap}{\subcappar #1#2#3}

The following line can be either added to the header to affect all subcaptions or to the figure environment to affect only one figure.

\captionsetup[subfigure]{format=subcap}

You must log in to answer this question.

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