答案1
这是一个使用该subcaption
包及其subfigure
环境的解决方案。
环境内部figure
有两个并排的minipage
环境,每个环境的宽度0.45\textwidth
为 ,水平方向用 分隔\hfill
。左侧minipage
环境包含 2 个subfigure
环境,编号为“(a)”和“(c)”;右侧minipage
环境仅包含 1 个subfigure
环境,编号为“(b)”。3 个环境的宽度subfigure
均设置为\linewidth
。
\label
通过此设置,您可以通过通常的机制创建对整体图形和子图的交叉引用\ref
。
\documentclass[demo]{article} % remove `demo' option in real document
\usepackage{subcaption,graphicx}
\begin{document}
\begin{figure}[ht]
\begin{minipage}{0.45\textwidth} % start of first minipage
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth]{picA}
\caption{\dots}
\end{subfigure}
\bigskip % leave empty line before '\bigskip'
\addtocounter{subfigure}{1} % increment 'subfigure' counter by 1
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth]{picC}
\caption{\dots}
\end{subfigure}
\end{minipage} % end of first minipage
\hfill
\begin{minipage}{0.45\textwidth} % start of second minipage
\addtocounter{subfigure}{-2} % decrement 'subfigure' counter by 2
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth, height=\linewidth]{picB}
\caption{\dots}
\end{subfigure}
\end{minipage} % end of second minipage
\caption{Overall figure caption}
\end{figure}
\end{document}
答案2
我认为最简单的方法是首先排版子浮点数,然后将它们保存在可以根据需要稍后移动的框中。
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\newsavebox{\subcapboxA}
\newsavebox{\subcapboxB}
\newsavebox{\subcapboxC}
\begin{document}
\begin{figure}[htp]
\sbox{\subcapboxA}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{}
\end{subfigure}%
}
\sbox{\subcapboxB}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth,height=1.3\textwidth]{example-image-b}
\caption{}
\end{subfigure}%
}
\sbox{\subcapboxC}{%
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-c}
\caption{}
\end{subfigure}%
}
% Now we stack the boxes in the desired way
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxA} \\[2ex]
\usebox{\subcapboxC}
\end{tabular}\hfill
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxB}
\end{tabular}
\caption{The global caption text}
\end{figure}
\end{document}
有些文档类不支持使用caption
包(revtex4-2
和其他包),因此您需要使用subfig
。以下是相应的代码。
\documentclass{article}
\usepackage[caption=false]{subfig}
\usepackage{graphicx}
\newsavebox{\subcapboxA}
\newsavebox{\subcapboxB}
\newsavebox{\subcapboxC}
\begin{document}
\begin{figure}[htp]
\sbox{\subcapboxA}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth]{example-image-a}%
}%
}
\sbox{\subcapboxB}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth,height=0.6\textwidth]{example-image-b}%
}%
}
\sbox{\subcapboxC}{%
\subfloat[]{%
\includegraphics[width=0.45\textwidth]{example-image-c}%
}%
}
% Now we stack the boxes in the desired way
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxA} \\[2ex]
\usebox{\subcapboxC}
\end{tabular}\hfill
\begin{tabular}{@{}c@{}}
\usebox{\subcapboxB}
\end{tabular}
\caption{The global caption text}
\end{figure}
\end{document}
答案3
像这样:
\documentclass{book}
\usepackage{graphicx}
\usepackage{lipsum,mwe}
\begin{document}
\lipsum[1]\\
\begin{table}[h!]
\begin{center}
\caption{Table with 3 graphs}
\begin{tabular}{l l}
\parbox{2in}{\includegraphics[width=2in,height=1in]{seno.pdf}\\ (a) sinus graph\\ \includegraphics[width=2in,height=1in]{coseno.pdf}\\(b) cosinus graph} &\parbox{2in}{\includegraphics[width=2in,height=2.2in]{tangente.pdf}\\ (c) tangent graph}\\
\end{tabular}
\end{center}
\end{table}
\end{document}
输出: