关于这个布局已经存在一些问题:
然而,他们似乎都没有考虑对齐子标题。
(1)一种解决方法是添加空行。
(2) 我试图正确解决这个问题。对于两个或多个图形相邻的简单布局,可以使用\subcaptionbox
包中的命令subcaption.sty
。
我已经使用 minipages 中的命令进行了自己的尝试\subcaptionbox
。据我所知,图像 2 的子标题只有一个小问题,即如果它像其他子标题一样跨越第二行,则不会居中。如果您从此子标题中删除第二行,此问题就会消失
\documentclass[draft]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{mwe}
\newsavebox{\bigimage}
\begin{document}
\begin{figure}
\sbox{\bigimage}{%
\subcaptionbox
{large image}
[0.5\linewidth]
{\includegraphics[width=\linewidth,height=350pt]{example-image-c}}%
}
\begin{minipage}[b][\ht\bigimage]{0.5\linewidth}
\subcaptionbox{small image 1}[\linewidth]{\includegraphics[width=\linewidth]{example-image-a}}
\vfill
\subcaptionbox{small image 2\\ with a second caption line}[\linewidth]{\includegraphics[width=\linewidth]{example-image-b}}
\end{minipage}%
\begin{minipage}[b][\ht\bigimage]{0.5\linewidth}
\usebox{\bigimage}
\end{minipage}
\caption{caption for figure}
\label{fig:figure}
\end{figure}
\end{document}
更新
我刚刚注意到第二个问题,与子标题的编号有关。图 1 应该有 (a)、图 2 (b) 和图 3 (c)。
答案1
包裹stackengine
\documentclass[draft]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{stackengine}
\usepackage{mwe}
\begin{document}
\captionsetup[subfigure]{justification=centering}
\begin{figure}
\centering
\def\figa{\includegraphics[width=0.4999\linewidth]{example-image-a}}
\def\figb{\includegraphics[width=0.4999\linewidth]{example-image-a}}
\def\figc{\includegraphics[width=0.4999\linewidth,height=350pt]{example-image-c}}
\def\capa{subfig a caption}
\def\capb{subfig b caption\\ which may be longer}
\def\capc{subfig c caption}
\savestack{\capfiga}{\subcaptionbox{\capa\label{fg:a}}{\figa}}
\savestack{\capfigb}{\subcaptionbox{\capb\label{fg:b}}{\figb}}
\savestack{\capfigc}{\subcaptionbox{\capc\label{fg:c}}{\figc}}
\def\hgap{0ex}
\stackon%
[\heightof{\figc}-\heightof{\figb}-\heightof{\capfiga}-\depthof{\capfiga}]%
{\capfigb}{\capfiga}\hspace{\hgap}\capfigc%
\caption{This is my figure\label{fg:}}
\end{figure}
\end{document}
答案2
带有保存箱
\documentclass[draft]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup[subfigure]{justification=centering}
\usepackage{mwe}
\newsavebox{\topleftimage}
\newsavebox{\bottomleftimage}
\newsavebox{\bigimage}
\begin{document}
\begin{figure}
\sbox{\topleftimage}{%
\subcaptionbox
{small image 1}
[0.5\linewidth]
{\includegraphics[width=\linewidth]{example-image-a}}%
}
\sbox{\bottomleftimage}{%
\subcaptionbox
{small image 2\\ with a second caption line}
[0.5\linewidth]
{\includegraphics[width=\linewidth]{example-image-b}}%
}
\sbox{\bigimage}{%
\subcaptionbox
{large image}
[0.5\linewidth]
{\includegraphics[width=\linewidth,height=350pt]{example-image-c}}%
}
\begin{minipage}[b][\ht\bigimage]{0.5\linewidth}
\usebox{\topleftimage}
\vfill
\usebox{\bottomleftimage}
\end{minipage}%
\begin{minipage}[b][\ht\bigimage]{0.5\linewidth}
\usebox{\bigimage}
\end{minipage}
\caption{caption for figure}
\label{fig:figure}
\end{figure}
\end{document}