Is there a simple way to retrieve an absolute page number from a label, where by absolute I mean counting all pages as integers sequentially starting from the first page of the document, without any resets.
To be more clear, if I have three pages of front-matter with roman numerals, then 10 pages of content with arabic numbers, and I reference the third page of the content, \pageref will return 3, but I want an alternate command that will return 6 since it's the 6th overall page in the document.
Furthermore, I'd like the references returned as a basic integer so they can be used in a control statement or for arithmetic comparisons, e.g. I'd like to be able to do something like the following, where \abspageref is a hypothetical command that counts from the beginning of the document not the last page counter reset, and returns a simple integer with no unit associated:
if{\abspageref{labelA} > \abspageref{labelB}{Some text.}{Some alternate text.}
I realize that's not a correct if then control statement either, it's just to illustrate what I'm trying to do.
Thanks.
Bonus question: why is something like abspageref not a core part of Latex already? It seems like a predictable feature that advanced users would want, and when I search for solutions online, I see a lot of very complicated solutions that I haven't had any success with yet.
\ifnum\zref@extract{#1}{abspage}>\zref@extract{#2}{abspage}+1(notice the +1 at the end), but that doesn't work directly. Thanks. – SSilk Jul 28 '11 at 02:20\numexprfor this:\ifnum\zref@extract{#1}{abspage}>\numexpr\zref@extract{#2}{abspage}+1\relax– Martin Scharrer Jul 28 '11 at 08:58