My document is 39 pages long. However, the total page number (after numerous processing) is 36. I thus have page 1/36, 2/36, ... 36/36, as well as 37/36, 38/36, and 39/36.
Page 36 matches with the end of my text: the end of page 36 and pages 37 to 39 are filled with (floating) tables only.
If I add enough content in order to have regular text displayed after all floating tables, the numbering becomes right, i.e., the total page number equals 39.
I have tried to add \null
after the last floating table, but it has no effect.
The total number of pages is computed via the \@totpages
variable that is defined as following in the .cls
file I use. (This class is the template of the journal I want to publish in, based on the article
class.)
\def\@totpages{0}
\AtEndDocument{\immediate\write\@auxout{\string\gdef\string\@totpages{\thepage}}}
Question: How to force the total of page number to be compute after the last float being printed?
article
, and loadsmorefloats
, as well asstfloats
floats packages.\thepage/\@totpages
where\@totpages
is computed as following: first\def\@totpages{0}
and then\AtEndDocument{\immediate\write\@auxout{\string\gdef\string\@totpages{\thepage}}}
(all these commands are in class definition)\RequirePackage{lastpage}
+\def\@totpages{\pageref{LastPage}}
does the job! Would you mind writing an answer I could accept? (My next issue is to let my modifications be accepted by journal editor!)