我有两个图形 A 和 B,且 A 大于 B。我该怎么做才能使两个图形的中心处于同一高度?
\begin{figure}[]
\begin{center}
\subcaptionbox{\label{sfig:texta}}{\includegraphics[width=1.0cm]{A}}
\subcaptionbox{\label{sfig:textb}}{\includegraphics[width=1.0cm]{B}}
\end{center}
\caption{...}
\label{fig:1}
\end{figure}
答案1
使用minipage
s、subfigure
环境(来自subcaption
包)和 a tabular
:
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\captionsetup[subfigure]{labelformat=parens}
\centering
\begin{tabular}{@{}p{1cm}p{1cm}@{}}
\begin{minipage}[c]{1cm}
\centering
\includegraphics[width=1.0cm]{example-image-a}
\end{minipage} &
\begin{minipage}[c]{1cm}
\includegraphics[width=1.0cm,height=4cm]{example-image-b}
\end{minipage} \\
\begin{subfigure}[t]{1cm}
\subcaption{}
\label{sfig:testa}
\end{subfigure} &
\begin{subfigure}[t]{1cm}
\subcaption{}
\label{sfig:testb}
\end{subfigure}
\end{tabular}
\caption{...}
\label{fig:1}
\end{figure}
\end{document}