Given a set of page styles, for example plain
and butter
, in the memoir class how can get the page number and count for that given style?
This seems like something that would already have been solved, but I cannot seem to find a solution that someone else has already worked out.
A simple example:
\documentclass{memoir}
\copypagestyle{butter}{plain}
\begin{document}
\pagestyle{plain}
Page \thepage{} of \thelastpage. % should be "1 of 2" but is "1 of 1"
\newpage
Page \thepage{} of \thelastpage. % should be "2 of 2" but is "1 of 1"
\newpage
\pagestyle{butter}
\setcounter{page}{1} % reset page to 1
Page \thepage{} of \thelastpage. % correctly "1 of 1"
\end{document}
I gather the lastpage
counter uses the last page of the document, being 1 in this case because we reset it.
How could one go about getting the page count of plain
pages?
In the degenerate case where one wanted to ignore the butter
pages in the total page count, and there are two styles, is there a simple way one could one get the count of plain
pages? (aside perhaps from putting the butter
pages before the plain
ones)