子浮点行中的子浮点之间的空间不一致

子浮点行中的子浮点之间的空间不一致

subfloatrows 中的第二个和第三个子浮点之间存在不一致的空间。我不明白它来自哪里以及如何删除它。(OMFSM,MWE 可能需要很长时间才能组装!)

\documentclass{memoir}

\usepackage{mwe}
\usepackage{duckuments}
\usepackage{caption}
\usepackage{subcaption}

\usepackage{floatrow}

%% http://texblog.org/2014/12/04/continuous-figuretable-numbering-in-latex/
%% functionality from chngcntr included in memoir class
\counterwithout{figure}{chapter}
\counterwithout{section}{chapter}

\usepackage{cleveref}

\begin{document}

\blindduck

\newcommand{\figh}{21mm}
\begin{figure}[h]
    \centering     %% centering the subfloatrow doesn't work.
    \RawFloats     %% without it, no main caption. No idea why.
    \begin{subfloatrow}
        \ffigbox[\FBwidth]{%
            \subcaption{sf1}\label{fig:sf1}
        }{%
            \includegraphics[height=\figh]{example-image-10x16}
        }%
        \ffigbox[\FBwidth]{%
            \subcaption{sf2}\label{fig:sf2}
        }{%
            \includegraphics[height=\figh]{example-image-9x16}
        }%
        \ffigbox[\FBwidth]{%
            \subcaption{sf3}\label{fig:sf3}
        }{%
            \includegraphics[height=\figh]{example-image-golden-upright}
        }%
        \ffigbox[\FBwidth]{%
            \subcaption{sf4}\label{fig:sf4}
        }{%
            \includegraphics[height=\figh]{example-image-1x1}
        }%
        \ffigbox[\FBwidth]{%
            \subcaption{sf5}\label{fig:sf5}
        }{%
            \includegraphics[height=\figh]{example-image-a4}
        }%
    \end{subfloatrow}
    \caption{A long caption. Six different images included in the \textsc{mwe} package: \cref{fig:sf1} a 10 by 16 image, \cref{fig:sf2} a 9 by 16 image, \cref{fig:sf3} an image with the golden ratio, \cref{fig:sf4} an example square, \cref{fig:sf5} a downscaled image of an A4 page.}
\end{figure}

\blindduck

\end{document}

在此处输入图片描述

答案1

我倾向于认为是 中的一个错误floatrow。如果我删除第一个子浮点数,则错误的空格又会出现在剩余的第二个和第三个子浮点数之间。注释掉新的第一项时,该行为会重复:

在此处输入图片描述

请注意删除代码中的虚假空格后,正确的输入应该是

    \ffigbox[\FBwidth]{%
        \subcaption{sf1}\label{fig:sf1}% <--- HERE
    }{%
        \includegraphics[height=\figh]{example-image-10x16}% <--- HERE
    }

其他人也同样如此。

我认为使用subcaption工具会更好,同时考虑到加载floatrowmemoir引发错误。该错误与类无关,其行为与完全相同book

\documentclass{memoir}

\usepackage{duckuments}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{cleveref}

%% http://texblog.org/2014/12/04/continuous-figuretable-numbering-in-latex/
%% functionality from chngcntr included in memoir class
\counterwithout{figure}{chapter}
\counterwithout{section}{chapter}

\begin{document}

\blindduck

\begin{figure}[h]

\newcommand{\figh}{21mm}

\centering     %% centering the subfloatrow doesn't work.

\subcaptionbox{sf1\label{fig:sf1}}{%
  \includegraphics[height=\figh]{example-image-10x16}%
}\qquad
\subcaptionbox{sf2\label{fig:sf2}}{%
  \includegraphics[height=\figh]{example-image-9x16}%
}\qquad
\subcaptionbox{sf3\label{fig:sf3}}{%
  \includegraphics[height=\figh]{example-image-golden-upright}%
}\qquad
\subcaptionbox{sf4\label{fig:sf4}}{%
  \includegraphics[height=\figh]{example-image-1x1}%
}\qquad
\subcaptionbox{sf5\label{fig:sf5}}{%
  \includegraphics[height=\figh]{example-image-a4}
}

\caption{A long caption. Six different images included in the 
  \textsc{mwe} package: \cref{fig:sf1} a 10 by 16 image, \cref{fig:sf2} 
  a 9 by 16 image, \cref{fig:sf3} an image with the golden ratio, 
  \cref{fig:sf4} an example square, \cref{fig:sf5} a downscaled 
  image of an A4 page.}

\end{figure}

\blindduck

\end{document}

在此处输入图片描述

相关内容