I have the following MWE where to get the desired output I need to issue two \restoregeometry commands in order to ensure the second page doesn't spill of the bottom and so that the first page adheres to the requested margins. Issuing this command twice seems erroneous/bad practice.
There are some related questions and answers:
- No page number after afterpage
- Using \restoregeometry in environment, next page runs off the page bottom
- \restoregeometry from inside afterpage
MWE
\documentclass[11pt, a4paper, twoside]{extarticle}
\usepackage{afterpage}
\usepackage{lipsum}
\usepackage[top=40mm, right=50mm, bottom=40mm, left=50mm]{geometry}
\begin{document}
% Making a nice cover page (no page number desired).
\thispagestyle{empty}
\afterpage{
\pagestyle{empty}
\newgeometry{left = 10mm, right = 10mm, top = 10mm, bottom = 10mm} % Very close to the page edge.
\centering
\textbf{\Huge Some cover page material}\\[5em]
\vfill \lipsum
\restoregeometry
%\aftergroup\restoregeometry % Do I need this?
}
\restoregeometry
\clearpage
\section{Something else}
\lipsum
\end{document}
OUTPUT
However, my suspicion is that I don't understand what is going on here correctly, and that there is more than likely a better practice to achieve what I want.
NB - While this example is somewhat trivial, I use these two packages for similar projects, so would rather void solutions which might drift towards "don't use these packages" (or similar). I tend to use this as a more elaborate \maketitle.

\afterpageredundant? The\clearpageis after the\afterpage(which so happens to be followed by section, although this can likely be expected). The reasoning behind the afterpage was to allow some page(s) to have a custom margin separate to the main document. It is true I also happen to know where the explicit page breaks are. – oliversm Jul 09 '18 at 16:29