![两张并排且高度相同的带有 keyfloat 的图像](https://linux22.com/image/435635/%E4%B8%A4%E5%BC%A0%E5%B9%B6%E6%8E%92%E4%B8%94%E9%AB%98%E5%BA%A6%E7%9B%B8%E5%90%8C%E7%9A%84%E5%B8%A6%E6%9C%89%20keyfloat%20%E7%9A%84%E5%9B%BE%E5%83%8F.png)
我最近发现了出色的 keyfloat 包,它允许在图像排列方面具有极大的灵活性,但我无法获得一个看似简单的结果,即将两个并排的图形调整为相同的高度。在以下 MWE 中,我尝试了不同类型的调整大小(按线宽、按比例、按高度),但结果并不令人满意:
\documentclass{article}
\usepackage{mwe}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage[font=small]{caption}% without small font option results are worse
\usepackage{lipsum}
\usepackage{keyfloat}
\usepackage{xcolor}
\pagecolor{yellow!12}
\begin{document}
\begin{multicols}{2}
\section*{Introduction}
\lipsum[3][1-4]
\begin{keyfloats}[H]{2}
\keyfig{lw=1,c={Side by side figures, left.}}{example-image-a}
\keyfig{lw=1,c={Side by side figures, right.}}{example-image-10x16}
\vspace{1ex}
\end{keyfloats}
\lipsum[3][1-11]
\begin{keyfloats}[H]{2}
\keyfig{lw=1.4,c={Side by side figures, left.}}{example-image-a}
\keyfig{lw=0.66,c={Side by side figures, right.}}{example-image-10x16}
\vspace{1ex}
\end{keyfloats}
\lipsum[3][1-11]
\begin{keyfloats}[H]{2}
\keyfig{s=0.32,c={Side by side figures, left.}}{example-image-a}
\keyfig{s=0.23,c={Side by side figures, right.}}{example-image-10x16}
\vspace{1ex}
\end{keyfloats}
\lipsum[3][1-4]
\begin{keyfloats}[H]{2}
\keyfig{h=7.6em,c={Side by side figures, left.}}{example-image-a}
\keyfig{h=7.6em,c={Side by side figures, right.}}{example-image-10x16}
\vspace{1ex}
\end{keyfloats}
\lipsum[3][1-4]
\end{multicols}
\end{document}
正如所见,问题在于最右边的图像右侧存在间隙。
是否有可能修复这种行为,或者这是 keyfloat 包的功能/限制?
而且,如果没有启用font=small
该包的选项,结果会更糟。caption