子標題垂直對齊

子標題垂直對齊

我正在顯示一些具有不同邊界框的圖形。這些數字似乎是底部對齊的,但我想讓它們垂直對齊。我雖然子標題 自動地照顧這個,但似乎沒有。

這是我的一段程式碼:

\documentclass[final,5p,times]{elsarticle}
\usepackage{subcaption}

\begin{document}

\begin{figure*}[htpb]
\subcaptionbox{Curl-free potential singularities}{\includegraphics[width=.3\textwidth]{figs/Case1/Singularities/rotational_pot_sing}} \hfill
\subcaptionbox{Divergence-free potential singularities}{\includegraphics[width=.3\textwidth]{figs/Case1/Singularities/divergence_pot_sing}} \hfill
\subcaptionbox{Vector field potentials singularities}{\includegraphics[width=.3\textwidth]{figs/Case1/Singularities/vector_field_sing}}
\label{fig:case1_sing}
\end{figure*}

\end{document}

這就是結果:

在此輸入影像描述

我怎樣才能得到想要的結果?

謝謝。

答案1

您可以捕捉框中最高的影像,然後可以使用它來測量您想要/必須升高其他不太高的影像的高度:

在此輸入影像描述

\documentclass[final,5p,times]{elsarticle}
\usepackage{subcaption}

\begin{document}

\begin{figure*}[htpb]
  \setbox9=\hbox{\includegraphics[width=.3\linewidth]{example-image-1x1}}% Capture tallest image in box 9
  \subcaptionbox{Curl-free potential singularities}
    {\raisebox{\dimexpr\ht9-\height}{\includegraphics[width=.3\linewidth]{example-image-a}}} \hfill
  \subcaptionbox{Divergence-free potential singularities}
    {\raisebox{\dimexpr\ht9-\height}{\includegraphics[width=.3\linewidth]{example-image-b}}} \hfill
  \subcaptionbox{Vector field potentials singularities}{\includegraphics[width=.3\linewidth]
    {example-image-1x1}}
\end{figure*}

\end{document}

\ht9表示盒子 9 的高度,而是in\height的高度。<stuff>\raisebox{<height>}{<stuff>}

作為參考參見參考文獻\dimexpr\numexpr

相關內容