一行中所有子图的子图标题(子图环境;子图标题包)

一行中所有子图的子图标题(子图环境;子图标题包)

嘿嘿,

这是我今天的第三个问题 :-)

我再次查看了 Axel Sommerfeldt 编写的子标题包手册,但未能成功为所有连续的子图设置一个子标题。有人能帮助我吗?

\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}

不期望的输出:

不需要

期望输出:

期望

...抱歉我无能为力,但我坐在笔记本电脑前已经 14 个小时了 :-)

问候本杰明

答案1

您可以subfigure对多个图形使用相同的环境:

\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}

在此处输入图片描述

相关内容