答案1
我知道我以前做过这个,但似乎找不到。(后来)我发现它,但这个解决方案更加优雅。
首先,测量左侧子图的高度。创建一个高度相同的小页面,并将其他两个子图放入其中,中间用 隔开\vfill
。只要右侧两个子图的总和小于左侧子图的总和,就可以对齐顶部和底部。[b] 选项将对齐底部标题(最后一个基线)。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\sbox0{\begin{subfigure}[b]{\dimexpr 0.5\textwidth-0.5\columnsep}% measuer height with caption
\includegraphics[width=\linewidth, height=4in]{example-image-a}% some argitrary height
\caption{caption 1}
\end{subfigure}}%
\usebox0\hfill\begin{minipage}[b][\ht0][s]{\wd0}% s=stretch
\begin{subfigure}{\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{caption 2}
\end{subfigure}\par
\vfill% very important
\begin{subfigure}[b]{\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\caption{caption 3}
\end{subfigure}
\end{minipage}
\end{figure}
\end{document}
此版本会缩小一张或多张图像以适应尺寸。虽然这些2\lineskip
术语似乎是临时的,但设置\lineskip=0pt
确实会影响尺寸。
\resizebox
注意和周围的括号\scalebox
。这是为了保护所有盒子寄存器。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{pgfmath}% or tikz
\begin{document}
\begin{figure}
\setlength{\dimen1}{\dimexpr 0.5\textwidth-0.5\columnsep}% default width
\sbox0{\includegraphics[width=\dimen1]{example-image-10x16}}% images
\sbox1{\includegraphics[width=\dimen1]{example-image-b}}%
\sbox2{\includegraphics[width=\dimen1]{example-image-c}}%
\sbox3{\begin{subfigure}[b]{\dimen1}
%\hrule height0pt% baseline here
\caption{caption 1}
\end{subfigure}}% captions
\sbox4{\begin{subfigure}[b]{\dimen1}
%\hrule height0pt% baseline here
\caption{caption 2}
\end{subfigure}}%
\sbox5{\begin{subfigure}[b]{\dimen1}
%\hrule height0pt% baseline here
\caption{caption 3}
\end{subfigure}}% captions
\setlength{\dimen2}{\dimexpr \ht1+\ht2+\ht4+\dp4+\floatsep+2\lineskip}% right height
\ifdim\ht0>\dimen2
\def\scale{1}%
\else
\dimen2=\ht0
\pgfmathsetmacro{\scale}{(\ht0-\ht4-\dp4-\floatsep-2\lineskip)/(\ht1+\ht2)}%
\fi
\begin{minipage}[b]{\dimen1}
\centering
{\resizebox{!}{\dimen2}{\usebox0}}
\usebox3
\end{minipage}\hfill
\begin{minipage}[b]{\dimen1}
\centering
{\scalebox{\scale}{\usebox1}}
\usebox4
\vskip\floatsep
{\scalebox{\scale}{\usebox2}}
\usebox5
\end{minipage}
\caption{Figure caption}
\end{figure}
\end{document}
答案2
这是 TeX 基元的任务\hbox
。\vbox
如果你知道这些基元是如何工作的,那么就没有任何问题了。例如:
\def\figure#1#2{\vbox{\hbox{FIGURE #1}\medskip\hbox{\qquad#2}}}
\hbox to\hsize{\figure 1{(a) caption 1}\hss
\vbox{\figure 2 {(b) caption 2}\bigskip
\figure 3 {(c) caption 3}}}
\bye
当然,文本应该通过创建真实图形来替换。例如,如果您使用 OpTeX 并且有图像,则FIGURE #1
可以使用和。\picw=.45\hsize \inspic{fig-#1.png}
fig-1.png
fig-2.png
fig-3.png
答案3
你好,这是你想要的吗?取自非常好的书
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[htp]
\centering
\begin{tabular}{@{}c@{}}
\subfloat{\includegraphics[width=0.5\linewidth]{example-image-a.png}}\\ (a)
\end{tabular}\qquad % some space
\begin{tabular}{@{}c@{}}
\subfloat{\includegraphics[width=0.3\linewidth]{example-image-b.png}}\\ (b)
\\[0.1cm]
\subfloat{\includegraphics[width=0.3\linewidth]{example-image-c.png}}\\ (c)
\end{tabular}
\caption{Caption.}
\end{figure}
\end{document}