1

I need to position subfigure labels on the top left of their respective figures. I can do this fine for a normal report, however if I change to a twosided report the labels are incorrect on even pages. On even pages the labels don't shift into the correct position, and the subfigures become offset (provided they are different sizes). I'm not sure what to do to appraoch this issue from here.

Here's a MWE, any help or insight would be fantastic:

\documentclass[12pt, twoside]{report}

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

\usepackage{lipsum}

\captionsetup[subfigure]{
    singlelinecheck = false,
    justification = raggedright,
    margin = {-3ex, 0ex},
}

\begin{document}

%
\begin{figure}[tbp]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels in correct position.}
\end{figure}
%

\lipsum[1-3]

%
\begin{figure}[tbp]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels in incorrect position, and figures offset.}
\end{figure}
%

\lipsum[4-5]

%
\begin{figure}[tbp]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels back in correct position.}
\end{figure}
%

\end{document}

1 Answer 1

2

According to caption package document Page.11, 'In twoside documents the left and right margin will be swapped on even pages. To prevent this, you can specify the option oneside additionally, e.g. \captionsetup{margin= {0pt,10pt},oneside}'. So the correct example is:

\documentclass[12pt, twoside]{report}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\captionsetup[subfigure]{
    singlelinecheck = false,
    justification = raggedright,
    margin = {-3ex, 0ex},
    oneside
}
\usepackage[showframe]{geometry}

\begin{document}
%
\begin{figure}[t]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels in correct position.}
\end{figure}
%
\lipsum[1-3]
%
\begin{figure}[t]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels in incorrect position, and figures offset.}
\end{figure}
%
\lipsum[4-5]
%
\begin{figure}[t]
    \centering
    \begin{subfigure}[t]{0.4\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-a}
    \end{subfigure}
    \hspace{3ex}
    \begin{subfigure}[t]{0.28\linewidth}
        \subcaption{}
        \includegraphics[width=\linewidth]{example-image-b}
    \end{subfigure}
    \caption{Labels back in correct position.}
\end{figure}
%
\end{document}

enter image description here

1
  • Perfect, thank you! Apr 20, 2022 at 6:19

You must log in to answer this question.

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