is there a simple way to add some content at the end of pages similarly to \AtEndDocument (for example something like \AtThisPageEnd) ?
I looked at everyhook and everypage, but it doesn't look that it's possible to do it with these packages.
Does someone have an idea ?
Edit: To be more precise, I try to change the layout for some page using the geometry package. I manage to make it work when the textwidth is constant. The problem comes when it is not, see this example
\documentclass [a4paper]{article}
\usepackage [showframe]{geometry}
\usepackage {atbegshi}
\usepackage {lipsum}
\title{The Title}
\author{Me}
\date{\today}
\geometry{
paperwidth=18cm,
paperheight=18cm,
textwidth=9cm,
}
\makeatletter
\gdef\setGeometryPage
{
\ifnum\thepage=2
\global\let\setGeometryPage =\relax
\expandafter \@gobble % gobble clearpage
\newgeometry
{
textwidth=12cm,
}%
\fi
\aftergroup\setGeometryPage
}
\AtBeginShipout{
\AtBeginShipoutUpperLeft{
\setGeometryPage
}
}
\makeatother
\begin{document}
\maketitle
\section{First section}
\lipsum[1]
This part is the transition with the next page.
This part is the transition with the next page.
This part is the
%\clearpage\noindent
transition
\lipsum[1-2]
\end{document}
![Geometry change on page 2, but margin kept to be the one of the first page till end of block [1]](../../images/9a64a7b7c85e425216eb1ef7e36c2b27.webp)
A workaround (not very nice) is to add the \clearpage\noindent at the end of the first page (see example comment).
(NB: I'd like to set the layout only with the geometry package here)

\thispagestyle{zzz}and then specify your text in the page foot of the zzz style. – David Carlisle Feb 16 '16 at 16:53\vfillcommand and write whatever you want after it. – Mario S. E. Feb 16 '16 at 17:51\clearpage, which forces a page break, at the page break sounds like chasing one’s tail. Or your intent is to flush the queue of floats “at” some page break, without manually deciding exactly where that break should occur? – GuM Feb 16 '16 at 20:30