由于某种原因,我无法使用subfigure
环境选项对图形进行顶部对齐[t]
。我在互联网上搜索解决方案,发现对于如此简单和普遍的问题,它们相当复杂...简单的解决方案是什么?
\documentclass[11pt]{article}
\usepackage[draft]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[t]{.49\linewidth}
\centering
\includegraphics[width=1\textwidth]{calCurve.pdf}
\caption{Caption 1}
\end{subfigure}%
\begin{subfigure}[t]{.49\linewidth}
\centering
\includegraphics[scale=0.7]{anova.pdf}
\caption{Caption 2}
\end{subfigure}%
\end{figure}
\end{document}
答案1
你可以掷骰子floatrow
:
\documentclass[12pt]{article}
\usepackage{caption,floatrow}
\DeclareCaptionSubType[alph]{figure}
\captionsetup[figure]{labelsep=colon}
\captionsetup[subfigure]{labelformat=brace,labelsep=space,labelfont=bf}
\floatsetup[subfigure]{capposition=bottom,heightadjust=all,valign=t}
\begin{document}
\begin{figure}[htp]
\ffigbox[\FBwidth]
{\begin{subfloatrow}
\ffigbox
{\caption{First subfigure}}%
{\rule{3cm}{3cm}}
\ffigbox
{\caption{Second subfigure with more Text so we have a line break}}%
{\rule{1.5cm}{1.5cm}}
\end{subfloatrow}}
{\caption{Two figures}}
\end{figure}
\end{document}