解决方案subfig

解决方案subfig

我尝试在一页中排列多个图形,但失败了。我希望它们显示如下:

在此处输入图片描述

任何建议都将不胜感激。

答案1

解决方案subfig

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}

\newcommand{\subsubfloat}[2]{%
  \begin{tabular}{@{}c@{}}#1\\#2\end{tabular}%
}

\begin{document}

\begin{figure}
\centering
\subfloat[Just One Duck]{\label{duck1}\includegraphics[width=0.3\columnwidth]{duck}}

\subfloat[Three Ducks]{\label{duck2}%
  \begin{minipage}{\columnwidth}\footnotesize
  \centering
  \subsubfloat{\includegraphics[width=0.15\columnwidth]{duck}}{First Duck}%
  \qquad
  \subsubfloat{\includegraphics[width=0.15\columnwidth]{duck}}{Second Duck}

  \medskip

  \subsubfloat{\includegraphics[width=0.3\columnwidth]{duck}}{Third Duck}
  \end{minipage}}

\caption{Four Ducks}
\end{figure}
\end{document}

在此处输入图片描述

解决方案subcaption

\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}

\newcommand{\subsubfloat}[2]{%
  \begin{tabular}{@{}c@{}}#1\\#2\end{tabular}%
}

\begin{document}

\begin{figure}
\centering
\begin{subfigure}{.3\columnwidth}
\includegraphics[width=\textwidth]{duck}
\caption{Just One Duck}\label{duck1}
\end{subfigure}

\begin{subfigure}{\columnwidth}
  \begin{minipage}{\textwidth}\footnotesize
  \centering
  \subsubfloat{\includegraphics[width=0.15\textwidth]{duck}}{First Duck}%
  \qquad
  \subsubfloat{\includegraphics[width=0.15\textwidth]{duck}}{Second Duck}

  \medskip

  \subsubfloat{\includegraphics[width=0.3\textwidth]{duck}}{Third Duck}
  \end{minipage}
\caption{Three Ducks}\label{duck2}
\end{subfigure}

\caption{Four Ducks}
\end{figure}
\end{document}

在此处输入图片描述

答案2

subcaption对于这种事情很有用——它有很多选择。对于这种特殊情况,环境subfigure很有用

截屏

这是一个完整的 MWE,可供使用

% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[htb]
    \centering
    \begin{subfigure}{.25\textwidth}
        \includegraphics[width=\textwidth]{flower}
        \caption{}
        \label{fig:1flower}
    \end{subfigure}

    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics[width=.5\textwidth]{flower}%
        \includegraphics[width=.5\textwidth]{flower}\\
        \includegraphics[width=.75\textwidth]{flower}
        \caption{}
        \label{fig:3flower}
    \end{subfigure}
    \caption{\ref{fig:1flower}: $1$ flower; \ref{fig:3flower}: $3$ flowers}
\end{figure}
\end{document}

相关内容