The problem is as follows.
In a memoir
document, I defined the page geometry:
\usepackage{geometry}
\geometry{
paperwidth=5.25in,
paperheight=8in,
textwidth=95mm,
textheight=150mm,
outer=17mm
}
\setlength{\stockwidth}{5.25in}
\setlength{\stockheight}{8in}
\addtolength{\headheight}{5pt}
Then I defined an environment to put a piece of text dead centre on a page:
\newenvironment{quotepage}[1]%
{\newpage\newgeometry{margin=0pt}%
\thispagestyle{empty}%
\bgroup\centering%
\noindent\par\mbox{}\vspace*{-\baselineskip}\vfill%
\begin{minipage}{#1}%
\setlength{\parskip}{0.6\baselineskip}%
\setlength{\parindent}{0pt}%
}{\end{minipage}%
\vfill\egroup%
\restoregeometry}
When using this environment,
\begin{quotepage}{0.7\linewidth}
\itshape
What is the Noble Truth of Suffering? ...
Saṃyutta Nikāya 56.11, Dhammacakkappavattana Sutta
\end{quotepage}
The next page (the one after \restoregeometry
was called) will begin with good header and textwidth, but the page content runs way off the page at the bottom. The page after that has good header, footer, text width, height and all.
However, this doesn't happen if I don't use an environment. If I just copy-paste the code which the environment should insert, the page after \restoregeometry
is good, and so are the rest.
Very puzzling. Something is going wrong with how I defined the environment, but I can't figure it out. Can someone see the problem?