I am not able to make this command be deterministic. The weird behaviour I get with PDFLaTeX is explained in the comments of the following MWE. I checked for conflicts with package afterpage, also maybe via multicol, in my original document and after reading the warning in background's documentation, but it didn't help. What can I do?
\documentclass[oneside,a4paper]{book}%
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[pages=all]{background}
\backgroundsetup{opacity=0.7,contents={\Huge MY BACKGROUND}}
\begin{document}
\thispagestyle{plain}%
%
\BgThispage{}\BgThispage{}\BgThispage{} %Shorthand to enhance opacity just here.
TITLE-PAGE
\clearpage\thispagestyle{empty}
\NoBgThispage{}
\thispagestyle{empty}
A first BgLess page.
\clearpage\thispagestyle{empty}
%\NoBgThispage{} %THIS COMMAND WILL MAKE ALL THE FOLLOWING PAGES MISS THE BACKGROUND.
\textbf{No BG here, please, but yes afterwards. Shouldn't it be as easy as in the previous page?}
\clearpage\thispagestyle{empty}
%\BgThispage% Even this command will be bypassed.
\clearpage
%\NoBgThispage{} %Again, this will affect every remaining page.
TOC page.
\clearpage%
\lipsum[1-10]
\vfill{}Why is BG missing here?
\end{document}
\NoBgThispagetwice you loose the background. – Ulrike Fischer May 17 '23 at 21:47