将两张图片并排居中对齐

将两张图片并排居中对齐

我有这个代码:

\begin{figure}[H]
\centerline{
\hspace*{-0cm}
\subfloat[2D MOT]{\includegraphics[scale = 0.05]{"2D-MOT".jpg}  }    %
    \qquad
    \subfloat[Differential pumping section]{\includegraphics[scale = 0.075]{"2D-MOTcoils".jpg}  } %
}
\caption{\textbf{Figure \ref*{fig:realMOT} }: The assembled 2D-MOT. Once cured, the glue turned orange. Showing single core copper wire for quad coils, blue offset coils}
\label{fig:realMOT}%
\end{figure}

其结果如下:

在此处输入图片描述

我希望这两个图形的中心对齐。

我看过其他答案,它们都涉及subfigureminipage其他包。
有没有一种简单的方法来包含vspace 只是对于其中一个子浮点数?

答案1

在此处输入图片描述

\documentclass{article}
\usepackage[demo,
            export]{adjustbox}
\usepackage{subfig}
\usepackage[labelfont=bf]{caption}

\begin{document}
    \begin{figure}[htb]
\centering
\subfloat[2D MOT]{\includegraphics[height=2cm,valign=c]{"2D-MOT".jpg}  }    %
    \qquad
\subfloat[Differential pumping section]{\includegraphics[height=3cm,valign=c]{"2D-MOTcoils".jpg}}
\caption{The assembled 2D-MOT. Once cured, the glue turned orange. Showing single core copper wire for quad coils, blue offset coils}
\label{fig:realMOT}%
    \end{figure}
\noindent   or
    \begin{figure}[htb]
\centering
    \begin{tabular}{cc}
\subfloat{\includegraphics[height=2cm,valign=c]{"2D-MOT".jpg}}
    &
\subfloat{\includegraphics[height=3cm,valign=c]{"2D-MOTcoils".jpg}} \\
\subfloat[2D MOT]{\rule{0.4\linewidth}{0pt}}
    &
\subfloat[Differential pumping section]{\rule{0.4\linewidth}{0pt}}
    \end{tabular}
\caption{The assembled 2D-MOT. Once cured, the glue turned orange. Showing single core copper wire for quad coils, blue offset coils}
\label{fig:realMOT}%
    \end{figure}
\end{document}

相关内容