Closed kmccurley closed 2 months ago
Why do we need this from Python? Why not use the lastpage package to get the total page number? (see: https://mirror.koddos.net/CTAN/macros/latex/contrib/lastpage/lastpage.pdf)
Apparently we load the totpages
package, which is incompatible with lastpage
. The hyperxmp
package used to load totpages
, but that no longer seems to be true, although the hyperxmp documentation refers to totpages as a way to generate \pdfpagerange
automatically.
One way to solve this is to do it the way the authorarchive
package does it:
\@ifpackageloaded{totpages}{%
\def\IACR@lastpage{TotPages}
}{%
\RequirePackage{lastpage}
\def\IACR@lastpage{LastPage}
}
Then we could write \IACR@lastpage to the meta file.
Yes, this makes perfect sense.
As mentioned in a separate issue for the iacrcc style, page numbers for a bibliographic record of a paper will always be of the form 1-x. The value of x needs to be extracted from the compiled PDF, and we don't currently extract this into the metadata. I intend to add this as part of the compilation of the final version, probably using some code to parse the PDF and extract the number of pages.
There are several ways to do this from python:
pdfplumber
. There is code that uses this in the tests for iacrcc.pdfinfo
.