Floatrow:多行标题与后续浮动重叠

Floatrow:多行标题与后续浮动重叠

我正在尝试使用以下方法创建两个具有自己标题和一个共同标题的子图浮行。但是,如果包含两个子图的图的标题覆盖多行,则不会调整大小,从而导致其与后续内容重叠。我将重叠的标题设为红色,以便更加明显。

我如何让 floatrow 考虑多​​行标题(即消除重叠)?

重叠标题

\documentclass{muthesis}

\usepackage{floatrow}
\usepackage{caption}
\usepackage[demo]{graphicx}
\usepackage{xcolor}

\usepackage{lipsum}

\DeclareCaptionSubType[alph]{figure}
\captionsetup[subfigure]{labelformat=brace,textfont=md,labelfont=up,labelsep=space}

\floatsetup[figure]{valign=t,heightadjust=all,subfloatrowsep=qquad}

\begin{document}
\begin{figure}
    \ffigbox[\linewidth]{%
        \begin{subfloatrow}[2]%
            \ffigbox[\linewidth]{%
                \includegraphics[width=\linewidth,height=1em]{}%
                \caption{Send}%
                \label{fig:a}%
            }{}%
            \ffigbox[\linewidth]{%
                \includegraphics[width=\linewidth,height=2em]{}%
                \caption{Receive}%
                \label{fig:b}%
            }{}%
        \end{subfloatrow}%
        \caption{ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus.  }%
        \label{fig:subfig}%
    }{}%
\end{figure}

\begin{table}
    \ttabbox{%
        \begin{tabular}{ll}
            a&b\\
        \end{tabular}%
        \caption{\color{red}Overlapped}%
        \label{tab:a}%
    }{}
\end{table}

\lipsum
\end{document}

答案1

heightadjust=all需要更改为heightadjust=object初始浮动设置内部。

在此处输入图片描述

\documentclass{muthesis}

\usepackage{caption}
\usepackage{floatrow}

\usepackage[demo]{graphicx}
\usepackage{xcolor}

\usepackage{lipsum}

\DeclareCaptionSubType[alph]{figure}
\captionsetup[subfigure]{labelformat=brace,textfont=md,labelfont=up,labelsep=space}

\floatsetup[figure]{valign=t,heightadjust=object,subfloatrowsep=qquad}

\begin{document}
\begin{figure}
    \ffigbox[\linewidth]{%
        \begin{subfloatrow}[2]%
            \ffigbox[\linewidth]{%
                \includegraphics[width=\linewidth]{monkey-selfie}%
                \caption{Send}%
                \label{fig:a}%
            }{}%
            \ffigbox[\linewidth]{%
                \includegraphics[width=\linewidth]{sc-teacher}%
                \caption{Receive}%
                \label{fig:b}%
            }{}%
        \end{subfloatrow}%
        \caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus.  }%
        \label{fig:subfig}%
    }{}%
\end{figure}



\begin{table}[h]
    \ttabbox{%
        \begin{tabular}{ll}
            a&b\\
        \end{tabular}%
        \caption{\color{red}Overlapped}%
        \label{tab:a}%
    }{}
\end{table}

\lipsum
\end{document}

相关内容