我有一个图形,它有几个子图形,每个子图形都有自己的标题。我正在使用 subfloatrow 对齐子浮点数。如何使标题至少扩展到图形的宽度?目前它们非常窄。
\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb,amsthm,latexsym,graphicx}
\usepackage{subfig,keyval,caption}
\usepackage[]{floatrow}
\floatsetup[table]{style=plaintop}
\floatsetup[figure]{floatrowsep=qquad, valign=c}
\floatsetup[subfigure]{subfloatrowsep=qquad, heightadjust=object, valign=c}
\usepackage{tikz}
\begin{document}
\begin{figure}[htbp]
\begin{center}
\ffigbox{
\begin{subfloatrow*}[3]
\subfloat[A very very very very very veryvery very veryvery very very long subcaption]
{\begin{tikzpicture}
\draw (0,0) rectangle(5,5);
\end{tikzpicture}}
\subfloat[A very very very very very veryvery very veryvery very very long subcaption that is even longer than the first]
{\begin{tikzpicture}
\draw (0,0) rectangle(4,6);
\end{tikzpicture}}
\subfloat[And we're now talking about the third subfigure blah blah]
{\begin{tikzpicture}
\draw (0,0) rectangle(2,1);
\end{tikzpicture}}
\end{subfloatrow*}}{
\caption{And here's the caption to the main figure that seems to be working ok}
\label{tournaments}}
\end{center}
\end{figure}
\end{document}
答案1
在环境中,不要使用,subfloatrow
而是用来包围您的子图并传递给可选参数(这将为您提供宽度等于子图宽度的标题;如果需要,可以使用更高的值)。\subfloat
\ffigbox
\FBwidth
\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb,amsthm,latexsym,graphicx}
\usepackage{subfig,keyval,caption}
\usepackage[]{floatrow}
\floatsetup[table]{style=plaintop}
\floatsetup[figure]{floatrowsep=qquad,valign=c}
\floatsetup[subfigure]{subfloatrowsep=qquad, heightadjust=object,valign=c}
\usepackage{tikz}
\DeclareCaptionSubType[alph]{figure}
\captionsetup[subfigure]{labelformat=brace,textfont=md,labelfont=up}
\begin{document}
\begin{figure}[htbp]
\centering
\ffigbox{%
\begin{subfloatrow}[3]
\ffigbox[\FBwidth]{\caption{A very very very very very veryvery very veryvery very very long subcaption}}
{\begin{tikzpicture}
\draw (0,0) rectangle(5,5);
\end{tikzpicture}}
\ffigbox[\FBwidth]{\caption{A very very very very very veryvery very veryvery very very long subcaption that is even longer than the first}}
{\begin{tikzpicture}
\draw (0,0) rectangle(4,6);
\end{tikzpicture}}
\ffigbox[\FBwidth]{\caption{And we're now talking about the third subfigure blah blah}}
{\begin{tikzpicture}
\draw (0,0) rectangle(2,1);
\end{tikzpicture}}
\end{subfloatrow}%
}%
{\caption{And here's the caption to the main figure that seems to be working ok}
\label{tournaments}}
\end{figure}
\end{document}
由于第三个图非常窄,因此标题的排版很差;可以考虑对子图标题使用不规则样式,或者为这种窄子图的标题提供更多空间,或者尽量不要使用这种窄子图。