这个问题是问题的后续
那里接受的解决方案
\documentclass[openright]{scrbook}
\newcommand*{\blankpage}{%
\vspace*{\fill}
\centering This page would be intentionally left blank if we would not wish to inform about that.
\vspace{\fill}}
\makeatletter
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\blankpage
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\begin{document}
Text
\chapter{First chapter}
\end{document}
确实插入空白页警告,但仅此而已\mainmatter
。 \frontmatter
,\appendix
并且\backmatter
没有空白页警告。
有什么方法可以调整此解决方案以便它会为整个文档产生空白页警告?
答案1
使用scrbook
重新定义的命令是\cleardoubleoddstandardpage
\documentclass[openright]{scrbook}
\newcommand*{\blankpage}{%
\par\vspace*{\fill}%
{\centering This page would be intentionally left blank
if we would not wish to inform about that.\par}
\vspace{\fill}%
}
\makeatletter
\renewcommand*{\cleardoubleoddstandardpage}{%
\clearpage
\if@twoside
\ifodd\c@page
\else
\blankpage
\thispagestyle{empty}%
\newpage
\if@twocolumn\hbox{}\newpage\fi
\fi
\fi
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First chapter}
\chapter{Second chapter}
\end{document}
答案2
您可以使用包scrlayer
和 KOMA 选项为这些页面定义特殊的页面样式cleardoublepage=<pagestyle>
\documentclass[open=right]{scrbook}
\newcommand*{\blankpage}{%
\par\vspace*{\fill}%
{\centering This page would be intentionally left blank
if we would not wish to inform about that.\par}
\vspace{\fill}%
}
\usepackage{scrlayer}
\DeclareNewLayer[
foreground,
textarea,
contents=\blankpage
]{blankpage.fg}
\DeclarePageStyleByLayers{blank}{blankpage.fg}
\KOMAoptions{cleardoublepage=blank}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First chapter}
\chapter{Second chapter}
\end{document}
如果通过命令插入空白页\cleardoubleevenpage
或切换到,这也会起作用open=left
。