允许浮动脚在图形下方左对齐,但延伸到右侧

允许浮动脚在图形下方左对齐,但延伸到右侧

根据我上一个问题的答案, 我可以使用以下示例将 my\caption和 my设置为单独的宽度:\floatfoot标题和 floatfoot 与 floatrow 的宽度不同

\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{siunitx}
\usepackage{caption}

\begin{document}

\begin{figure}
\RawCaption%
    {\caption{Selected Interatomic Distances of Protons in $\beta$-Pinene Normal Lactone}%
     \label{fig:noeDistances}}\vskip\captionskip
\floatbox[{\captop}]{figure}[\FBwidth]
    {}
    {\includegraphics{nOeDistances}
    \floatfoot{\textsuperscript{1}All distances reported are in \si{\angstrom}.%
    \\ \textsuperscript{2}Selected carbon numbering is given in cyan.}}
\end{figure}

\end{document}

但是,我发现在这种情况下,第二个脚注会换行,因为图形宽度非常小。我想要实现的结果是,它将\floatfoot与图形左对齐,但能够延伸到图形的右侧。

我确实尝试过将 的宽度设置\floatbox为大于\FBwidth使用calc包的值,然后使用\FBwidth*\real{1.5},但这会将一半的额外空间放在浮动的两侧。导致\floatfoot不再左对齐。

我还考虑过手动计算图像的宽度,然后自己设置边距,例如:

\def\mygraphic{\includegraphics{nOeDistances}}
\newlength\graphicwidth
\setlength\graphicwidth{\widthof{\mygraphic}}
\newlength\leftMarg
\newlength\rightMarg
\setlength\leftMarg{\textwidth-\graphicwidth/2}
\setlength\rightMarg{0pt}

但我对其还不够熟悉,无法完成这个想法。

答案1

这是一个我不太喜欢的解决方案,但是(正如我在评论中所说)我会发布它,因为没有其他人提供更好的方法。

这个想法是将宽度设置\floatbox为大于然后\FBwidth手动(这是我不喜欢的部分)纠正\floatfoot材料的对齐。

\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{siunitx}
\usepackage{caption}

% a length to store the current \FBwidh value for latter use
\newlength\mylena

\begin{document}

\begin{figure}
\RawCaption%
    {\caption{Selected Interatomic Distances of Protons in $\beta$-Pinene Normal Lactone}%
     \label{fig:noeDistances}}\vskip\captionskip
\floatbox[{\captop}]{figure}[1.4\FBwidth\setlength\mylena\FBwidth]
    {}
    {\includegraphics{nOeDistances}
    \floatfoot{\hspace*{0.15\mylena}\textsuperscript{1}All distances reported are in \si{\angstrom}.%
    \hfill\null\\\hspace*{0.15\mylena}\textsuperscript{2}Selected carbon numbering is given in cyan.}}
\end{figure}

\end{document}

在此处输入图片描述

相关内容