afterpage 与 geometry 包中的 restoregeometry 发生冲突

afterpage 与 geometry 包中的 restoregeometry 发生冲突

我正在写论文,并使用了几何学包来控制文本主体的大小,以便它遵循 KOMA-script 文档中描述的“良好”排版实践。

我的许多图形都是全页浮动图形,其高度高于文本高度。因此,我一直在使用 newgeometry/restoregeometry 和后页命令来调整页面布局并确保图形适当地放置在文档中。

这样做很好,只是在紧接着图表的页面上,文本“延伸”到了底部边缘。我在下面提供了 MWE。请注意第四页的格式不正确。(我使用的是 pdfLaTeX)。

有人知道如何纠正这种行为吗?(或者有其他方法来实现相同的布局?)

在我看来好像 restoregeometry 命令没有被正确执行。

\documentclass{scrbook}
\usepackage{calc}
\usepackage[showframe]{geometry}

% Calculate type area for page 
\geometry{ bindingoffset = 8mm, 
           heightrounded = true, 
           body = {125mm, 125mm * 16 / 9},
           marginratio = {9:16, 9:16},
           marginparsep = 5mm,
           marginparwidth = 30mm,
           headsep = 10mm,
           headheight = 10mm,
           footskip = 15mm }

\KOMAoptions{fontsize = 11pt}
% Chapters open on right.
\KOMAoptions{open = right}
% \cleardoublepage command uses the empty page style
\KOMAoptions{cleardoublepage = empty}
% Don't typeset the Chapter and Appendix prefixes
\KOMAoptions{chapterprefix = false}
\KOMAoptions{appendixprefix = false}
% We also avoid having running heads and page numbers on float pages by using the  floatpage
% package to make float pages use the empty page style.
\usepackage{floatpag}
\floatpagestyle{empty}
\rotfloatpagestyle{empty}

% For dummy text
\usepackage{lipsum}
% 
\usepackage{afterpage}

% For good control of floats
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\floatsetup{facing=yes, 
            capbesideposition={outside,center},
            footnoterule=none}
\floatsetup[table]{style=plaintop}
\floatsetup[subfigure]{style=plain}
% Allow floats to hang into the outer margin
\DeclareMarginSet{minhangoutside}{%
\setfloatmargins*{\relax}
    {\hfill\hskip-\marginparwidth\hskip-\marginparsep}%
}
\floatsetup[figure]{margins=minhangoutside}

% For control of caption formatting
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{font=normal,
              format=hang,
              labelfont=normal,
              labelsep=colon}

% End Preamble
%
%------------------------------------------------------------------------
\begin{document}

\chapter{First Chapter}
%
\section{First Section}%
\lipsum%

% Add a full page figure. I want the preceeding page to be full of text so
% use the afterpage command. Also as the figure is taller than the page height 
% I use the newgeometry/savegeometry/restoregeometry commands.
%
\afterpage{%
\newgeometry{bindingoffset = 8mm, 
             body = {125mm, 125mm * 16 / 9 + 10mm + 15mm}, 
             headsep = 0mm, 
             footskip = 0mm}%
\savegeometry{extraheight}
%
\begin{figure}[pc]%
\centering%
\ffigbox%
        {\includegraphics*[width=160mm,height=20mm]{}%
        \vspace*{1ex}%

        \begin{subfloatrow}%
            \ffigbox[\FBwidth]%
                    {\includegraphics*[width=160mm,height=96.0mm]{}}%
                    {\caption{First sub-figure}}%
        \end{subfloatrow}%
        \vspace*{1ex}%

        \begin{subfloatrow}%
            \ffigbox[\FBwidth]%
                    {\includegraphics*[width=160mm,height=96.0mm]{}}%
                    {\caption{Second sub-figure }}%
        \end{subfloatrow}}%
        {\caption{Main caption of the figure. In reality this runs to two lines long so I'm just filling in space here with meaningless text.}}%
\end{figure} 
%
\restoregeometry%
}
%
% Next section
\section{Second Section}%
\lipsum%
%
\section{Third Section}%
\lipsum%

\end{document}

答案1

我认为您不需要 afterpage 和 restoregeometry。使用负空间来移动图形并避免过多的框消息。例如

\section{First Section}%
\lipsum%

\begin{figure}[pc]%
\vspace{-2cm}%move up
\begin{minipage}[t][\dimexpr \textheight + 3cm]{\textwidth}
\centering%

\makebox[\linewidth]{\rule{1.1\textwidth}{\textheight}}
\caption{Main caption of the figure. In reality this runs to two lines long so I'm just filling in space here with meaningless text.}%

\end{minipage}
\vspace{-3cm}%avoid "float to large"
\end{figure}

相关内容