我试图在 2×2 的表中对齐 3 个子图,其中第二列是跨越两行的多行。
通常\multirow
将其内容垂直居中,但是子图不会发生这种情况。
这是生成上一个图像的代码。
\documentclass[]{article}
\usepackage[margin=1in]{geometry}
\usepackage[subrefformat=parens,labelformat=parens]{subcaption} %% provides subfigure
\usepackage{tabularx} %% tabularx and multirow so that we can do nice subfigure layouts
\usepackage{multirow}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\begin{tabular}{c|c}
\begin{subfigure}{0.3\linewidth}
\begin{center}
\includegraphics[width=1.9in, height=1.9in]{logo}
\caption{}
\end{center}
\end{subfigure} & \multirow{2}{.5\textwidth}{
\begin{subfigure}{0.3\linewidth}
\begin{center}
\includegraphics[width=3.9in, height=3.9in]{logo}
\caption{}
\end{center}
\end{subfigure}
} \\
\cline{1-1}
\begin{subfigure}{0.3\linewidth}
\begin{center}
\includegraphics[width=1.9in, height=1.9in]{logo}
\caption{}
\end{center}
\end{subfigure} & \\
\end{tabular}
\end{figure}
\end{document}
答案1
那样吗?您可以引用子图,在第一个参数中添加标签,其中\subcaptionbox
包含标题文本和标签:\documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[margin=1in, showframe]{geometry} \usepackage{caption} \usepackage[subrefformat=parens,labelformat=parens]{subcaption} %% 提供子图 \usepackage{multirow} \usepackage{cleveref} \usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\centering\setlength\tabcolsep{1.25em}
\begin{tabular}{c|c}
\subcaptionbox{\vspace*{2ex}\label{1st-fig}}{\includegraphics[width=1.9in, height=1.9in]{logo}} & %
\multirow{2}{*}[\dimexpr1.9in-\baselineskip-0.5\abovecaptionskip-0.8ex\relax]{\subcaptionbox{label{3rd-fig}}{\includegraphics[width=3.9in, height=3.9in]{logo}}}
\\
\cline{1-1}
\subcaptionbox{\label{2nd-fig}}{\includegraphics[width=1.9in, height=1.9in]{logo}}
&
\end{tabular}
\caption{Some figures}
\end{figure}
We see in \cref{1st-fig} …
\end{document}