答案1
这就是我解决问题的方法。
\begin{figure}[H]
\centering
\footnotesize
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/happy/happy1}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/happy/happy2}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/happy/happy3}}{\tableCaption h i j} \\
\bigskip
\caption*{The caption without a number}
\bigskip
\footnotesize
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/neutral/neutral1}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/neutral/neutral2}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/neutral/neutral3}}{\tableCaption h i j}
\bigskip
\caption*{The caption without a number}
\bigskip
\footnotesize
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/sad/sad1}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/sad/sad2}}{\tableCaption h i j} \qquad
\hspace{1cm}%
\stackunder[5pt]{\includegraphics[scale=0.30]{gfx/dataSet/ourDataset/sad/sad3}}{\tableCaption h i j}
\bigskip
\caption*{The caption without a number}
\caption{Sample Results}
\end{figure}
还有这些命令。
\newcommand \tableCaption[3]{
\begin{tabular}{cc}
first & #1 \\
second & #2 \\
third & #3 \\
\end{tabular}
}
\usepackage{stackengine}
答案2
可能有点过于复杂...
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\begin{subfigure}{\linewidth}
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\caption{Bugs}
\end{subfigure}
\begin{subfigure}{\linewidth}
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\caption{Flies}
\end{subfigure}
\begin{subfigure}{\linewidth}
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\hfill
\begin{subfigure}{.3\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption*{test\\ text\\ text}
\end{subfigure}
\caption{Dinos}
\end{subfigure}
\caption{Welcome to animal kingdom}
\end{figure}
\end{document}
答案3
类似这样的解决方案就是我为此subcaption
包提供的解决方案。
\documentclass[]{article}
\usepackage{graphicx}
\usepackage[textfont=bf]{subcaption} % bold text in sub caption
\captionsetup{labelfont=bf} % bold label
\usepackage{chngcntr}
\counterwithin{figure}{section} % include section number in caption of figure
\begin{document}
\section{Sectiontitle}
\begin{figure}[h]\centering\small
\begin{subfigure}{1\linewidth}\centering
\begin{tabular}{ccc}
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} \\
Text 1.1 & Text 2.1 & Text 3.1 \\
Text 1.2 & Text 2.2 & Text 3.2 \\
Text 1.3 & Text 2.3 & Text 3.3 \\
\end{tabular}
\caption{caption}
\vspace{2\tabcolsep}
\end{subfigure}
\begin{subfigure}{1\linewidth}\centering
\begin{tabular}{ccc}
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} \\
Text 1.1 & Text 2.1 & Text 3.1 \\
Text 1.2 & Text 2.2 & Text 3.2 \\
Text 1.3 & Text 2.3 & Text 3.3 \\
\end{tabular}
\caption{caption}
\vspace{2\tabcolsep}
\end{subfigure}
\begin{subfigure}{1\linewidth}\centering
\begin{tabular}{ccc}
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} &
\includegraphics[width=0.2\linewidth]{example-image} \\
Text 1.1 & Text 2.1 & Text 3.1 \\
Text 1.2 & Text 2.2 & Text 3.2 \\
Text 1.3 & Text 2.3 & Text 3.3 \\
\end{tabular}
\caption{caption}
\end{subfigure}
\caption{the main caption}
\end{figure}
\end{document}
编辑:做了一些更改以使风格与图片更加匹配。