答案1
如果两个环境不应浮动到不同的页面上,您可以将它们minipage
(每个环境都有自己的\caption
四个\subcaptionbox
命令)放入一个环境中:figure
\documentclass{article}
\usepackage{subcaption}
\usepackage{mwe}% for example-image
\begin{document}
\begin{figure}
\begin{minipage}{\linewidth}\centering
\subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
\subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
\subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
\subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
\caption{This is the first figure}
\end{minipage}
\bigskip
\begin{minipage}{\linewidth}\centering
\subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
\subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
\subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
\subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
\caption{This is the second figure}
\end{minipage}
\end{figure}
\end{document}
但如果要让它们浮动到不同的页面上,那么只需使用两个图形即可:
\documentclass{article}
\usepackage{subcaption}
\usepackage{mwe}% for example-image
\begin{document}
\begin{figure}
\centering
\subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
\subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
\subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
\subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
\caption{This is the first figure}
\end{figure}
\begin{figure}
\centering
\subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
\subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
\subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
\subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
\caption{This is the second figure}
\end{figure}
\end{document}
答案2
你可以在一个浮点数中添加两个标题。使用subfig
软件包可以得到以下解决方案:
\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp]
\centering
\subfloat[First]{\includegraphics[height=7em,width=.45\linewidth]{example-image-a}}
\hfil
\subfloat[Second]{\includegraphics[height=7em,width=.45\linewidth]{example-image-b}}
\subfloat[Third]{\includegraphics[height=7em,width=.45\linewidth]{example-image-c}}
\hfil
\subfloat[Forth]{\includegraphics[height=7em,width=.45\linewidth]{example-image}}
\caption{This is the first figure}
\bigskip
\subfloat[First]{\includegraphics[height=7em,width=.45\linewidth]{example-image-a}}
\hfil
\subfloat[Second]{\includegraphics[height=7em,width=.45\linewidth]{example-image-b}}
\subfloat[Third]{\includegraphics[height=7em,width=.45\linewidth]{example-image-c}}
\hfil
\subfloat[Forth]{\includegraphics[height=7em,width=.45\linewidth]{example-image}}
\caption{This is the second figure}
\end{figure}
\end{document}