由於某種原因,我無法使用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}