My MWE:
\documentclass[twoside]{book}%
\usepackage{tikzducks}% Delivers figures for testing purposes
\usepackage{lipsum}% Delivers blind text
\newcounter{totalnumberold}
\newcounter{topnumberold}
\newcounter{bottomnumberold}
\newcommand\adaptplacement{%
\setcounter{totalnumber}{1}
\setcounter{topnumber}{1}
\setcounter{bottomnumber}{1}
\renewcommand{\topfraction}{.99}
\renewcommand{\bottomfraction}{.99}
\renewcommand{\textfraction}{.01}
\renewcommand\floatpagefraction{1.0}% This makes it nearly impossible to generate a page of floats
}%
\begin{document}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
% Control:
\typeout{Before group:}
\typeout{topfraction: \topfraction , bottomfraction: \bottomfraction , textfraction: \textfraction , floatpagefraction: \floatpagefraction}%
\typeout{totalnumber: \arabic{totalnumber} , topnumber: \arabic{topnumber}, bottomnumber: \arabic{bottomnumber}}%
{%
\adaptplacement
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
% Control:
\typeout{Inside group:}
\typeout{topfraction: \topfraction , bottomfraction: \bottomfraction , textfraction: \textfraction , floatpagefraction: \floatpagefraction}%
\typeout{totalnumber: \arabic{totalnumber} , topnumber: \arabic{topnumber}, bottomnumber: \arabic{bottomnumber}}%
}%
% Control:
\typeout{After group:}
\typeout{topfraction: \topfraction , bottomfraction: \bottomfraction , textfraction: \textfraction , floatpagefraction: \floatpagefraction}%
\typeout{totalnumber: \arabic{totalnumber} , topnumber: \arabic{topnumber}, bottomnumber: \arabic{bottomnumber}}%
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{A duck}
\end{figure}
\lipsum
\end{document}
I have 9 floating figures and I try to position them such, that the third and the fourth should appear alone on a text page, while the others before and after should appear in bigger numbers per text page.
As one can see after compiling, that doesn't work: There are two groups of placement parameters: counters and macros, which behave differently.
The macros are only valid inside the group of the third and fourth figures, which I marked by brackets {}. One can control that via the \typeout inside the logfile. The behavior even doesn't change, if I make much use of \global.
On the other hand, counters are generally changed globally, so they stay changed even after leaving the group, as the \typeout into the logfile shows. But they only achieve their aim for the eighth and ninth figures -- not for the third and fourth, as intended.
So my question: How can I change placement macros and counters especially and only for the two figures, while leaving the parameters of the other figures unchanged?

\setcountervalues are global so affect following pages. the\renewcommandare local so have no effect unless a page break happens within the group – David Carlisle Jun 23 '23 at 21:03[htbp!]option and or use\vspaceor other mechanisms to modify the box size – David Carlisle Jun 23 '23 at 21:14topnumbertotalnumberorbottomnumberas many times as you want anywere in text, as long as you keep in mind that set one of these counters affect not only next floats , but also to previous floats that end in the same page. – Fran Jun 24 '23 at 18:45[htbp!]although I prefer avoidhas far a posible for a better layout) and only in the final version worry about really very bad placed floats, and the is usually enough to move them some paragraphs or o using a restrictive options, but as little as possible. – Fran Jun 26 '23 at 20:56\extrafloatsan also\FloatBarrierof placeins, or just\clearpagecould help a if you have a bulk of floats. – Fran Jun 26 '23 at 21:03Generally, I use [tbp] or [htbp], I would need the trick with two pages with only one float just for panoramas, which up to now I printed with \afterpage.
– ThorstenL Jun 27 '23 at 20:16por not using options al all) in order to place every float as soon as possible. If you avoid significant delays of floats in all the document, force in some couple of pages two top floats should not be a big issue. – Fran Jun 28 '23 at 00:53