效果是这样的,子图 (a) 的标题比子图 (b) 高出一截: 想要达到差不多这么个效果:
想要达到差不多这么个效果: 刘海洋回复:在可能的情况下,那样用现成的 floatrow 宏包是最方便的。如果条件不允许,才需要看下面的内容。子图的内容居中但子标题不居中,那么我直观地想到两种思路:
刘海洋回复:在可能的情况下,那样用现成的 floatrow 宏包是最方便的。如果条件不允许,才需要看下面的内容。子图的内容居中但子标题不居中,那么我直观地想到两种思路:
- 让两个子图的内容物高度一致,然后让这个内容物里面图形垂直居中。 
- 把两个子图和子图标题分别放进 2x2 的表格中,这样很容易控制垂直对齐。 
前一种方式写起来比较直接,只是需要手工指定子图内容物的高度(floatrow 宏包是通过计算,在第二次编译时得到这个高度的)。后一种方式是控制对齐的「正统」方式,但要在此基础上控制子标题样式、间距之类,则可能麻烦一点。
\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\DeclareCaptionSubType[alph]{figure}
\floatsetup[subfigure]{style=plain,heightadjust=object}
\begin{document}
\begin{figure}[!htb]
\ffigbox[\FBwidth]{%
\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{dummy 1}}{\rule{3cm}{4cm}}
\ffigbox[\FBwidth]{\caption{dummy 2}}{\rule{4cm}{3cm}}%
\end{subfloatrow}}
{\caption{dummy}}
\end{figure}
\end{document}\documentclass{article}
\usepackage{tikz}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!ht]
  \centering
  \begin{subfigure}{.4\linewidth}
    \parbox[][4cm][c]{\linewidth}{% 手工指定高度、内容对齐
      \centering
      \tikz\draw circle(1);}
    \subcaption{small}
  \end{subfigure}
  \begin{subfigure}{.4\linewidth}
    \parbox[][4cm][c]{\linewidth}{% 手工指定高度、内容对齐
      \centering
      \tikz\draw circle(2);}
    \subcaption{large}
  \end{subfigure}
  \caption{circle}
\end{figure}
\end{document}                        
                        
                    
 
                 
                

发表评论 取消回复