This question is based on this answer. As it can be seen from this example below, the header "Abstract" is pushed to the bottom of the previous page when the abstract is longer than one page. I would require that the header is at the top of the page (just before the following content starts) when the following content is more than one page long. How can I achieve that?
\documentclass[oneside]{book}
\usepackage{xparse}
\usepackage[english]{babel}
\usepackage{blindtext}
\providecommand{\abstractname}{Abstract}
\providecommand{\acknowledgmentname}{Acknowledgment}
\ExplSyntaxOn
\NewDocumentEnvironment{abstract}{O{0}O{\c_pushpen_thesis_emptypage_tl}}
{
\xxxx_thesis_commonenv_start:n { \abstractname }
}
{
\xxxx_thesis_commonenv_end:nn { #1 } { #2 }
}
\NewDocumentEnvironment{acknowledgment}{O{0}O{\c_pushpen_thesis_emptypage_tl}}
{
\xxxx_thesis_commonenv_start:n { \acknowledgmentname }
}
{
\xxxx_thesis_commonenv_end:nn { #1 } { #2 }
}
\cs_new_protected:Nn \xxxx_thesis_commonenv_start:n
{
\clearpage
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
\setlength{\parskip}{0pt}% Why? It should always be zero!
\huge\itshape #1
\end{center}
\par\bigskip
}
\cs_new_protected:Nn \xxxx_thesis_commonenv_end:nn
{
\par\vspace*{\fill}
\clearpage
\prg_replicate:nn { #1 } % do #1 times the following
{
\vspace*{\fill}\thispagestyle{empty}
{\centering #2\par}
\vspace*{\fill}
\clearpage
}
}
\tl_const:Nn \c_pushpen_thesis_emptypage_tl
{
This~page~intentionally~left~blank
}
\ExplSyntaxOff
\begin{document}
\begin{abstract}[2][Nothing here]
This is the text of the abstract.
This is the text of the abstract.
This is the text of the abstract.
This is the text of the abstract.
More than one paragraph, too!
More than one paragraph, too!
More than one paragraph, too!
More than one paragraph, too!
More than one paragraph, too!
\blindtext[10]
\end{abstract}
\begin{acknowledgment}
The author is grateful to his cat
for not walking on the keyboard
while jiofoaijo dwjoioa ewdiroenwe
\end{acknowledgment}
\chapter{This is where everything begins}
Some text.
\end{document}