# Use eso-pic to set pictures on most pages

I understand that the eso-pic package can be used to add pictures to every page, or to a single page.

Ideal behaviour: eso-pic adds pictures to every page, but I can "switch off" the picture for some pages with a \thispagestyle{empty} (or something else similarly convenient).

MWE

\documentclass{report}

\pagenumbering{gobble}
\usepackage{eso-pic,color}

\AtPageLowerLeft{%
\color{red}%
\rule{\pdfpagewidth}{2cm}%
}
}

\begin{document}

This is my nice title page.

I don't want a colour footer here.

\clearpage

I understand that eso-pic makes it easy to add pictures to every page, or a

\clearpage

Doing the good good science

\clearpage

For whatever reason (full page figure, table, whatever), I don't want a footer
here either.

\end{document}


Thoughts

I understand that the internal \ESO@HookIBG stores all the picture commands to be used, and that I can clear its contents with \ClearShipoutPictureBG. I figured I could remove the pictures for a single page as:

1. capture \ESO@HookIBG contents (\let?)
2. call \ClearShipoutPictureBG
3. page content
4. restore \ESO@HookIBG from the capture of 1.

But I'm unsure how to actually implement this (and how I could make it's usage more convenient by hooking it into a \thispagestyle{empty} or something similar.)

• How do you decide whether a page has a picture or not? – Bernard 2 days ago
• Currently? I don't have a hard-and-fast rule. For the document I'm working on I don't want a picture on the title page, and I have some landscape pages where I don't want a picture. – jwalton 2 days ago

With a new (current) latex you could try something like this

\documentclass{report}

\pagenumbering{gobble}
\usepackage{eso-pic}
\usepackage{color}

\newif\ifmyfooter
\global\myfootertrue
\AtPageLowerLeft{%
\ifmyfooter
\color{red}%
\rule{\pdfpagewidth}{2cm}%
\fi
\global\myfootertrue
}
}

\DeclareHookRule {shipout/background}{mylabel}{before}{eso-pic}
\begin{document}

This is my nice title page.

I don't want a colour footer here.

\clearpage

I understand that eso-pic makes it easy to add pictures to every page, or a