3

Heyho,

my third question for today :-)

I had again a look at the subcaption package manual by Axel Sommerfeldt but did not got managed to have just one subcaption for all subfigures in a row. Can anybody assist me?

\documentclass[a4paper,oneside,10pt]{scrartcl}

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

%%%%%%%%%%%%

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\textwidth}
            \centering
            {\rule{3cm}{2cm}}
            \caption{Noon}
    \end{subfigure}%
    \begin{subfigure}[b]{0.3\textwidth}
            \centering
            {\rule{3cm}{2cm}}
            \caption{Noon}
    \end{subfigure}

            \begin{subfigure}[b]{0.3\textwidth}
            \centering
            {\rule{3cm}{2cm}}
            \caption{Midnight}
    \end{subfigure}%
    \begin{subfigure}[b]{0.3\textwidth}
            \centering
            {\rule{3cm}{2cm}}
            \caption{Midnight}
    \end{subfigure}
    \caption{Cool (left) and uncool (right) pictures; Recorded at noon (a) and at midnight (b).}
\end{figure}

\end{document}

not desired output:

not desired

desired output:

desired

...sorry for my inability, but I am sitting in front of my laptop for 14 h :-)

kind regards Benjamin

1 Answer 1

4

You can use the same subfigure environment for more than one figure:

\documentclass[a4paper,oneside,10pt]{scrartcl}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}[b]{0.6\textwidth}
            \centering
            {\rule{3cm}{2cm}}\quad
            {\rule{3cm}{2cm}}
            \caption{Noon}
    \end{subfigure}\\
     \begin{subfigure}[b]{0.6\textwidth}
            \centering
            {\rule{3cm}{2cm}}\quad
            {\rule{3cm}{2cm}}
            \caption{Midnight}
    \end{subfigure}%
    \caption{Cool (left) and uncool (right) pictures; Recorded at noon (a) and at midnight (b).}
\end{figure}

\end{document}

enter image description here

1
  • ...again sooooo simple...maybe to simple for figuring it out :-) I love LaTeX :-) Thanks a lot!!!
    – Oldname
    Commented Jul 7, 2013 at 22:57

You must log in to answer this question.

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