\usepackage{subfig}\subfloat{}

需要注意的是使用了\newline来另起一行。

......
\usepackage{graphicx}
\usepackage{subfig}
......
\begin{document}
\begin{figure*}[ht]
  \subfloat[img 1]{\includegraphics[width=0.3\textwidth]{1.jpg}}
 \hfill 	
  \subfloat[img 2]{\includegraphics[width=0.3\textwidth]{2.jpg}}
 \hfill	
  \subfloat[img 3]{\includegraphics[width=0.3\textwidth]{3.jpg}}
  \newline
  \subfloat[img 4]{\includegraphics[width=0.3\textwidth]{1.jpg}}
 \hfill 	
  \subfloat[img 5]{\includegraphics[width=0.3\textwidth]{2.jpg}}
 \hfill	
  \subfloat[img 6]{\includegraphics[width=0.3\textwidth]{3.jpg}}
\caption{Caption}
\end{figure*}
......
\end{document}

效果:
在这里插入图片描述

\usepackge{subcaption}\subfigure{}

需要注意的是使用了\newline来另起一行。

......
\usepackage{graphicx}
\usepackage{subcaption}
......
\begin{document}
......
\begin{figure*}[ht]
\begin{subfigure}{.3\textwidth}
  \centering
  % include first image
  \includegraphics[width=.8\linewidth]{1.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-first}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \centering
  % include second image
  \includegraphics[width=.8\linewidth]{2.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-second}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \centering
  % include second image
  \includegraphics[width=.8\linewidth]{3.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-second}
\end{subfigure}
\newline
\begin{subfigure}{.3\textwidth}
  \centering
  % include first image
  \includegraphics[width=.8\linewidth]{1.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-first}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \centering
  % include second image
  \includegraphics[width=.8\linewidth]{2.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-second}
\end{subfigure}
\hfil
\begin{subfigure}{.3\textwidth}
  \centering
  % include second image
  \includegraphics[width=.8\linewidth]{3.jpg}
  \caption{Put your sub-caption here}
  \label{fig:sub-second}
\end{subfigure}
\caption{Put your caption here}
\label{fig:fig}
\end{figure*}
......
\end{document}

效果:
在这里插入图片描述

\usepackage{subfigure}\subfigure{\minipage{}}

这种方法在之前的博文LaTeX subfigure和minipage的使用中也有介绍过。

......
\usepackage{graphicx}
\usepackage{subfigure}
......
\begin{document}
......
\begin{figure*}
\centering
\subfigure[Caption a]{
\begin{minipage}[b]{0.23\textwidth}
\includegraphics[width=1\linewidth]{1.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{2.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{3.jpg}
\end{minipage}}
\subfigure[Caption b]{
\begin{minipage}[b]{0.23\textwidth}
\includegraphics[width=1\linewidth]{1.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{2.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{3.jpg}
\end{minipage}}
\subfigure[Caption c]{
\begin{minipage}[b]{0.23\textwidth}
\includegraphics[width=1\linewidth]{1.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{2.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{3.jpg}
\end{minipage}}
\subfigure[Caption d]{
\begin{minipage}[b]{0.23\textwidth}
\includegraphics[width=1\linewidth]{1.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{2.jpg}\vspace{4pt}
\includegraphics[width=1\linewidth]{3.jpg}
\end{minipage}}
\caption{description of figure}
\end{figure*}
......
\end{document}

效果:
在这里插入图片描述
对比之下,实现相同的效果,第一种\subfloat会更简洁。第三种包subfigure官方声明被弃用了。
在这里插入图片描述
三个包subcaption会更新功能更强大。具体需要进一步探索。

参考资料:

How to add subfigure in Latex

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐