It would be nice if there were a better way to create the layout than just cut-and-paste, but once it's defined then the length of the definition can easily be hidden in a style file. pgfmorepages is built on pgfpages which uses xkeyval for its key handling and as far as I can tell, xkeyval doesn't allow for grouping keys into a single style in the manner of pgfkeys which would make this easier.
Anyway, this is - I think - the 24 on 6 layout you're after. I've defined a meta page style which figures out which physical page a logical page should end up on, where it should be, and what rotation. This reads in the number of physical and logical pages in the signature so to change it to 8 on 4 then you just change the lines that set the physical and logical pages of the layout (I'd also change the name, of course).
\documentclass{article}
%\url{https://tex.stackexchange.com/q/660686/86}
%Adapted from \url{https://tex.stackexchange.com/q/638802/86}
%Adapted from \url{http://tex.stackexchange.com/q/279042/86}
\usepackage{pgfmorepages}
\makeatletter
\newcommand\setsignaturepage[1]{%
% Figure out which page it is on
\pgfmathtruncatemacro\signaturepage{%
2((\pgf@physicalpages-1)/2 - abs(floor( (#1-1)/4) - (\pgf@physicalpages-1)/2))
+
1.5 - abs(mod(#1-1,4) - 1.5)
+
1
}%
% Figure out the rotation angle
\pgfmathtruncatemacro\signatureangle{%
90(mod(#1+1,4) - mod(#1+1,2))
}%
% Figure out which side of the page it's on
\pgfmathsetmacro\signaturex{%
#1 > (\pgf@logicalpages/2) ? .25 : .75
}%
% Figure out whether it is at the top or bottom of the page
\pgfmathsetmacro\signaturey{%
.25 + .25*(mod(#1+1,4) - mod(#1+1,2))
}%
% Put all that together into a single page definition
\edef\signatureonpage{%
\noexpand\pgfpagesphysicalpage{\signaturepage}{}%
\noexpand\pgfpageslogicalpageoptions{#1}{%
rotation=\signatureangle,%
center=\noexpand\pgfpoint{\signaturex\noexpand\pgfphysicalwidth}{\signaturey\noexpand\pgfphysicalheight}%
}%
}%
\signatureonpage
}
\pgfpagesdeclarelayout{24 on 6, book format}
{%
\edef\pgfpageoptionheight{\the\paperheight}
\edef\pgfpageoptionwidth{\the\paperwidth}
\def\pgfpageoptionborder{0pt}
\def\pgfpageoptionfirstshipout{1}
}%
{%
\pgfpagesphysicalpageoptions
{%
logical pages=24,%
physical pages=6,%
physical height=\pgfpageoptionheight,%
physical width=\pgfpageoptionwidth,%
current logical shipout=\pgfpageoptionfirstshipout%
}
\pgfpagessetdefaults{%
border shrink=\noexpand\pgfpageoptionborder,%
resized width=.5\noexpand\pgfphysicalwidth,%
resized height=.5\noexpand\pgfphysicalheight,%
}
\newcount\pgf@mp@pg
\pgf@mp@pg=0
\loop
\advance\pgf@mp@pg by 1
\setsignaturepage{\the\pgf@mp@pg}
\ifnum\pgf@mp@pg < \pgf@logicalpages \repeat
}
\makeatother
\pgfpagesuselayout{24 on 6, book format}
\newcommand\dopage{%
\noindent\resizebox{.99\linewidth}{!}{Page \thepage}
\newpage}
\begin{document}
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\end{document}
\makeatletterand\makeatotherinto your document (or stick it in a separate file and\includeit in your preamble) to define the layout and then the line\pgfpagesuselayoutinvokes it. You can use it as-is without needing to understand how it is constructed. My comments are as much for me when I look back at this in a few months time after someone else asks a similar question. – Andrew Stacey Oct 15 '22 at 19:19pgfpagesandpgfmorepages, is the package manual sufficient. Do you have a blog or tutorial that you can share? I think learning how to make my books print ready is very important for me. Thanks for all your help. – vrgovinda Oct 17 '22 at 04:47pgfpagesis covered in the PGF/TikZ manual, so that's probably the best place to start.pgfmorepagesis built on top of that, so understandingpgfpagesis important to understanding that. But how much you need to understand depends on whether you just want to use it or want to design your own layouts. If just use an existing layout (including ones like this one in this answer) then you don't need to understand much. – Andrew Stacey Oct 17 '22 at 21:29