1

No matter how many packages I remove, I can't seem to find out why the captions on my subfigures are being placed on top of the figures rather than below. I've stripped away everything in my document but the bare essentials, but the captions are still placed on top, despite my code being identical to that of people who do not experience the issue. What in the world is up? How do I force the subcaptions below the images, as is standard?enter image description here

\documentclass[11pt,a4paper]{article}
\pdfoutput=1

\usepackage{graphicx} % Including graphics

\usepackage{subcaption} % For subfigures

\captionsetup[subfigure]{position=bottom}

\begin{document}

\begin{figure}[t]
%\centering
\begin{subfigure}[b]{0.4\textwidth}
    %\centering
    \caption{Test.
    \label{fig:StNDdbL}}
    \includegraphics[width=1\textwidth]{example-image-a}
\end{subfigure}
\hspace{2ex}
\begin{subfigure}[b]{0.4\textwidth}
    %\centering
    \caption{Test.
    \label{fig:StNDdbP}}
    \includegraphics[width=1\textwidth]{example-image-a}
\end{subfigure}
\\[3ex]

%\centering
\begin{subfigure}[b]{0.4\textwidth}
    %\centering
    \caption{Test.
    \label{fig:StNFbpL}}
    \includegraphics[width=1\textwidth]{example-image-a}
\end{subfigure}
\hspace{2ex}
\begin{subfigure}[b]{0.4\textwidth}
    %\centering
    \caption{Test.
    \label{fig:StNFbpP}}
    \includegraphics[width=1\textwidth]{example-image-a}
\end{subfigure}
\caption{Test.
\label{fig:StImages}}
\end{figure}

\end{document}
3
  • 2
    You have to put the caption literally below the graphic in the code.
    – Roland
    Mar 23, 2022 at 23:58
  • It's actually sensitive to that?! Perhaps I've been spending too much time filling out bibtex files where such a thing doesn't matter.... Wow, thanks.
    – Jerome
    Mar 24, 2022 at 0:00
  • Somewhat related: tex.stackexchange.com/questions/403661/… Mar 24, 2022 at 15:51

1 Answer 1

3

As said in the comment:

Put the \caption{} below the graphic in the code. Like this:

\documentclass[11pt,a4paper]{article}
\pdfoutput=1

\usepackage{graphicx} % Including graphics

\usepackage{subcaption} % For subfigures

\captionsetup[subfigure]{position=bottom}

\begin{document}
    
    \begin{figure}[t]
        %\centering
        \begin{subfigure}[b]{0.4\textwidth}
            %\centering
            \includegraphics[width=1\textwidth]{example-image-a}
            \caption{Test.
                \label{fig:StNDdbL}}
        \end{subfigure}
        \hspace{2ex}
        \begin{subfigure}[b]{0.4\textwidth}
            %\centering
            \includegraphics[width=1\textwidth]{example-image-a}
            \caption{Test.
                \label{fig:StNDdbP}}
        \end{subfigure}
        \\[3ex]
        
        %\centering
        \begin{subfigure}[b]{0.4\textwidth}
            %\centering
            \includegraphics[width=1\textwidth]{example-image-a}
            \caption{Test.
                \label{fig:StNFbpL}}
        \end{subfigure}
        \hspace{2ex}
        \begin{subfigure}[b]{0.4\textwidth}
            %\centering
            \includegraphics[width=1\textwidth]{example-image-a}
            \caption{Test.
                \label{fig:StNFbpP}}
        \end{subfigure}
        \caption{Test.
            \label{fig:StImages}}
    \end{figure}
    
\end{document}

enter image description here

1
  • Indeed, thank you. It never even crossed my mind that the creators would make the order of the arguments relevant.
    – Jerome
    Mar 24, 2022 at 0:02

You must log in to answer this question.

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