我想使用minipage
命令将 2 个图像并排放置。其中一张图片的标题比另一张图片长,并且占用多行。这会导致图像水平对齐。如何重新对齐 2 个图像及其相应的标题(较长的标题比较短的标题低)
\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}
\begin{document}
\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{example-image-a} % first figure itself
\caption{first figure}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{example-image-b} % second figure itself
\caption{second figure blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla,}
\end{minipage}
\end{figure}
\lipsum[1]
\end{document}
答案1
您可以使用以下软件包轻松完成此floatrow
操作:
\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{floatrow}
\begin{document}
\lipsum[11]
\begin{figure}
\centering
\renewcommand{\floatrowsep}{\hskip 4em}
\begin{floatrow}
\ffigbox[\FBwidth]{\includegraphics[width=0.40\textwidth]{example-image-a}}% first figure itself
{\caption{first figure}\label{fig-a}}
\ffigbox[\FBwidth]{\includegraphics[width=0.40\textwidth]{example-image-b}} % second figure itself
{\caption{second figure blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla, blabla,}\label{fig-b}}
\end{floatrow}
\end{figure}
\end{document}
答案2
好的,我刚刚找到了答案:
替换 2:
\begin{minipage}{0.45\textwidth}
经过
\begin{minipage}[t]{0.45\textwidth}