答案1
使用minipage
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-a}\\
a.
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-a}\\
a.
\end{minipage}
\end{figure}
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-b}\\
b.
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-b}\\
b.
\end{minipage}
\end{figure}
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-c}\\
c.
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[height=3cm]{example-image-c}\\
c.
\end{minipage}
\end{figure}
\end{document}
你有这个:
答案2
使用以下subfloat
包中的环境的替代解决方案:subfig
minipage
\documentclass[10pt,a4paper]{article}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{showframe}% for showing page layout only, in real use it had to be removed
\begin{document}
\begin{figure}[htb]
\centering
\begin{minipage}[t]{0.5\textwidth}
\centering
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-a}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-b}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-c}}
\caption{my first figure}
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\centering
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-a}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-b}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-c}}
\caption{my second figure}
\end{minipage}
\end{figure}
\end{document}
此外,subfloat
您还可以使用subfigure
包中的subcaption
。 它更强大,但需要稍微多一点的代码,例如:
\begin{subfigure}[t]{\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{example-image}
\end{subfigure}
在这两种情况下,您都可以根据自己的喜好添加子标题。以上使用的是默认预设。有关详细信息,请参阅这些软件包的文档以及软件包caption
。