自定义页眉/页脚和填充文本在“空白”左侧页面上的位置

自定义页眉/页脚和填充文本在“空白”左侧页面上的位置

我想要的是:

我的报告标题页有自定义边距,以符合文档的格式指南。我使用软件包来实现这一点,并使用标题页geometry命令。\newgeometry{}

之后,我希望整个文档都使用自定义fancyhdr页眉和页脚。即使是默认参数创建的左侧空白页也openright必须进行编号,包括紧接在标题之后的第一个空白页(第 2 页)。

我还希望左侧空白页上有“此页有意留为空白“或类似的东西(很可能是一个装饰符号);为此,我使用描述的解决方案这里

我的问题:

文档中间左侧空白页上的所有操作均按预期进行(例如,下面最小工作示例中的第 4 页)。但是,标题后面的第 2 页有两个问题:

  • 填充文本未居中
  • 缺少页码

使用该包,showframe我可以看到标题页的自定义几何形状未应用于空白页 2,因此看起来可能不是页眉/页脚偏移并推到页面外面的情况。

更正左页 自定义几何标题页后的左页不正确

这是我的最小工作示例:

\documentclass{book}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{showframe}

% HEADERS AND FOOTERS
\usepackage{fancyhdr} 
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[RO, LE]{\thepage}
\pagestyle{fancy} %for regular pages
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0pt}\fancyfoot[RO, LE]{\thepage}} % for the first page of new chapters

% CSUTOM "BLANK" LEFT-HAND PAGES
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\vspace*{\fill}
\begin{center}
This page intentionally left blank
\end{center}
\vspace{\fill}
%\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother


\begin{document}

\begin{titlepage}
\newgeometry{left=2.5cm, right=2.5cm, top=2cm, bottom=2cm}
This is the title page with custom margins.
\end{titlepage}

\chapter*{First chapter}
\lipsum[1-2]

\chapter*{Second chapter}
\lipsum[10-12]

\end{document}

答案1

您需要在扉页之后恢复原始几何形状。

\begin{titlepage}
    \newgeometry{left=2.5cm, right=2.5cm, top=2cm, bottom=2cm}
    This is the title page with custom margins.
\end{titlepage}
\restoregeometry % added <<<<<<<<

A

相关内容