使用 floatsetup 在双面文档中左移的图形和标题

使用 floatsetup 在双面文档中左移的图形和标题

我正在使用包scrbook中的类和配置浮点数floatrow。在双面文档中,奇数页上的浮点数会向左移动 2pt。

如何使浮动元素与偶数页对齐?

例子:

\documentclass[a4paper, twoside, 10pt]{scrbook}
\usepackage{showframe}
\usepackage{floatrow,graphicx}

\floatsetup[figure]{  
margins=hangoutside,
capposition=beside,
capbesideposition={top,outside},
floatwidth=\textwidth,
capbesidewidth=\marginparwidth,
facing=yes,
objectset=centering
}


\begin{document}
\begin{figure}[h!]  
\includegraphics[draft]{file.pdf}
\caption{my shifted caption (left)}
\end{figure}
\newpage
\begin{figure}[h!]
\includegraphics[draft]{file.pdf}
\caption{my caption (right)}
\end{figure}
\end{document}

答案1

图形与其标题之间的距离必须设置为\marginparsep。默认值为\columnsep

\documentclass[a4paper, twoside, 10pt]{scrbook}
\usepackage{showframe}
\usepackage{floatrow,graphicx}

\DeclareFloatSeparators{marginparsep}{\hskip\marginparsep} % <--------------

\floatsetup[figure]{  
margins=hangoutside,
capposition=beside,
capbesideposition={top,outside},
floatwidth=\textwidth,
capbesidewidth=\marginparwidth,
facing=yes,
objectset=centering,
capbesidesep = marginparsep  % <------------------
}


\begin{document}
\begin{figure}[h!]  
\includegraphics[draft]{file.pdf}
\caption{my shifted caption (left)}
\end{figure}
\newpage
\begin{figure}[h!]
\includegraphics[draft]{file.pdf}
\caption{my caption (right)}
\end{figure}
\end{document}

相关内容