Using theabspage from the 'perpage' package
After two compilations of the following example with pdflatex
:
documentclass{article}
usepackage{lipsum}
usepackage{perpage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~theabspage, theabspage, theabspage, theabspage, arabic{abspage}.
end{document}
I obtain this:
However, I would have expected to see the number 2 printed twice at the top of page 2, after the second compilation run. Am I having wrong expectations, or somehow misusing theabspage
?
In a kind of desperate attempt, I've also tried to put AddAbsoluteCounter{page}
in the preamble, same result.
My TeX distribution is TeX Live as shipped in current Debian unstable (texlive-base
version 2018.20190227-2) and the log file written by pdfTeX says perpage 2014/10/25 2.0
.
page-numbering perpage
|
show 5 more comments
After two compilations of the following example with pdflatex
:
documentclass{article}
usepackage{lipsum}
usepackage{perpage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~theabspage, theabspage, theabspage, theabspage, arabic{abspage}.
end{document}
I obtain this:
However, I would have expected to see the number 2 printed twice at the top of page 2, after the second compilation run. Am I having wrong expectations, or somehow misusing theabspage
?
In a kind of desperate attempt, I've also tried to put AddAbsoluteCounter{page}
in the preamble, same result.
My TeX distribution is TeX Live as shipped in current Debian unstable (texlive-base
version 2018.20190227-2) and the log file written by pdfTeX says perpage 2014/10/25 2.0
.
page-numbering perpage
1
Presumablyabspage
has the same issue as the normalpage
counter: texfaq.org/FAQ-wrongpn
– moewe
yesterday
@moewe Thanks for your comment! I believe I know what happens with thepage
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading theperpage
manual, I expected that after two passes,theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from theperpage
manual (it mentionspage
, what's that? A typo, I guess). So, maybe I just don't understand the purpose oftheabspage
, after all. That was the question. :)
– frougon
yesterday
1
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
1
If I understand the documentation ofperpage
correctly thenabspage
is defined asAddAbsoluteCounter{page}
. AndAddAbsoluteCounter{<counter>}
just defines a counterabs<counter>
that is stepped up each time<counter>
is stepped up. Since it is not reset by resets to<counter>
it holds the absolute/total counter value. Forpage
that seems to imply thatabspage
has the exact same issues aspage
w.r.t. its value in the first paragraph on a new page.theabspage
andpage
could differ if you started your document with Roman page numbers and only later switched to Arabic 1
– moewe
yesterday
1
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter likeabspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of theperpage
package, which resets all kinds of things per page.
– moewe
yesterday
|
show 5 more comments
After two compilations of the following example with pdflatex
:
documentclass{article}
usepackage{lipsum}
usepackage{perpage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~theabspage, theabspage, theabspage, theabspage, arabic{abspage}.
end{document}
I obtain this:
However, I would have expected to see the number 2 printed twice at the top of page 2, after the second compilation run. Am I having wrong expectations, or somehow misusing theabspage
?
In a kind of desperate attempt, I've also tried to put AddAbsoluteCounter{page}
in the preamble, same result.
My TeX distribution is TeX Live as shipped in current Debian unstable (texlive-base
version 2018.20190227-2) and the log file written by pdfTeX says perpage 2014/10/25 2.0
.
page-numbering perpage
After two compilations of the following example with pdflatex
:
documentclass{article}
usepackage{lipsum}
usepackage{perpage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~theabspage, theabspage, theabspage, theabspage, arabic{abspage}.
end{document}
I obtain this:
However, I would have expected to see the number 2 printed twice at the top of page 2, after the second compilation run. Am I having wrong expectations, or somehow misusing theabspage
?
In a kind of desperate attempt, I've also tried to put AddAbsoluteCounter{page}
in the preamble, same result.
My TeX distribution is TeX Live as shipped in current Debian unstable (texlive-base
version 2018.20190227-2) and the log file written by pdfTeX says perpage 2014/10/25 2.0
.
page-numbering perpage
page-numbering perpage
asked yesterday
frougonfrougon
850711
850711
1
Presumablyabspage
has the same issue as the normalpage
counter: texfaq.org/FAQ-wrongpn
– moewe
yesterday
@moewe Thanks for your comment! I believe I know what happens with thepage
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading theperpage
manual, I expected that after two passes,theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from theperpage
manual (it mentionspage
, what's that? A typo, I guess). So, maybe I just don't understand the purpose oftheabspage
, after all. That was the question. :)
– frougon
yesterday
1
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
1
If I understand the documentation ofperpage
correctly thenabspage
is defined asAddAbsoluteCounter{page}
. AndAddAbsoluteCounter{<counter>}
just defines a counterabs<counter>
that is stepped up each time<counter>
is stepped up. Since it is not reset by resets to<counter>
it holds the absolute/total counter value. Forpage
that seems to imply thatabspage
has the exact same issues aspage
w.r.t. its value in the first paragraph on a new page.theabspage
andpage
could differ if you started your document with Roman page numbers and only later switched to Arabic 1
– moewe
yesterday
1
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter likeabspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of theperpage
package, which resets all kinds of things per page.
– moewe
yesterday
|
show 5 more comments
1
Presumablyabspage
has the same issue as the normalpage
counter: texfaq.org/FAQ-wrongpn
– moewe
yesterday
@moewe Thanks for your comment! I believe I know what happens with thepage
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading theperpage
manual, I expected that after two passes,theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from theperpage
manual (it mentionspage
, what's that? A typo, I guess). So, maybe I just don't understand the purpose oftheabspage
, after all. That was the question. :)
– frougon
yesterday
1
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
1
If I understand the documentation ofperpage
correctly thenabspage
is defined asAddAbsoluteCounter{page}
. AndAddAbsoluteCounter{<counter>}
just defines a counterabs<counter>
that is stepped up each time<counter>
is stepped up. Since it is not reset by resets to<counter>
it holds the absolute/total counter value. Forpage
that seems to imply thatabspage
has the exact same issues aspage
w.r.t. its value in the first paragraph on a new page.theabspage
andpage
could differ if you started your document with Roman page numbers and only later switched to Arabic 1
– moewe
yesterday
1
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter likeabspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of theperpage
package, which resets all kinds of things per page.
– moewe
yesterday
1
1
Presumably
abspage
has the same issue as the normal page
counter: texfaq.org/FAQ-wrongpn– moewe
yesterday
Presumably
abspage
has the same issue as the normal page
counter: texfaq.org/FAQ-wrongpn– moewe
yesterday
@moewe Thanks for your comment! I believe I know what happens with the
page
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading the perpage
manual, I expected that after two passes, theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from the perpage
manual (it mentions page
, what's that? A typo, I guess). So, maybe I just don't understand the purpose of theabspage
, after all. That was the question. :)– frougon
yesterday
@moewe Thanks for your comment! I believe I know what happens with the
page
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading the perpage
manual, I expected that after two passes, theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from the perpage
manual (it mentions page
, what's that? A typo, I guess). So, maybe I just don't understand the purpose of theabspage
, after all. That was the question. :)– frougon
yesterday
1
1
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
1
1
If I understand the documentation of
perpage
correctly then abspage
is defined as AddAbsoluteCounter{page}
. And AddAbsoluteCounter{<counter>}
just defines a counter abs<counter>
that is stepped up each time <counter>
is stepped up. Since it is not reset by resets to <counter>
it holds the absolute/total counter value. For page
that seems to imply that abspage
has the exact same issues as page
w.r.t. its value in the first paragraph on a new page. theabspage
and page
could differ if you started your document with Roman page numbers and only later switched to Arabic 1– moewe
yesterday
If I understand the documentation of
perpage
correctly then abspage
is defined as AddAbsoluteCounter{page}
. And AddAbsoluteCounter{<counter>}
just defines a counter abs<counter>
that is stepped up each time <counter>
is stepped up. Since it is not reset by resets to <counter>
it holds the absolute/total counter value. For page
that seems to imply that abspage
has the exact same issues as page
w.r.t. its value in the first paragraph on a new page. theabspage
and page
could differ if you started your document with Roman page numbers and only later switched to Arabic 1– moewe
yesterday
1
1
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter like
abspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of the perpage
package, which resets all kinds of things per page.– moewe
yesterday
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter like
abspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of the perpage
package, which resets all kinds of things per page.– moewe
yesterday
|
show 5 more comments
1 Answer
1
active
oldest
votes
You can get the absolute page number e.g. with the zref package:
documentclass{article}
usepackage{lipsum}
usepackage{zref-user,zref-abspage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~zlabel{A}zref[abspage]{A}, zlabel{B}zref[abspage]{B}, zlabel{C}zref[abspage]{C}, zlabel{D}zref[abspage]{D}, zlabel{E}zref[abspage]{E}.
end{document}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483665%2fusing-theabspage-from-the-perpage-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can get the absolute page number e.g. with the zref package:
documentclass{article}
usepackage{lipsum}
usepackage{zref-user,zref-abspage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~zlabel{A}zref[abspage]{A}, zlabel{B}zref[abspage]{B}, zlabel{C}zref[abspage]{C}, zlabel{D}zref[abspage]{D}, zlabel{E}zref[abspage]{E}.
end{document}
add a comment |
You can get the absolute page number e.g. with the zref package:
documentclass{article}
usepackage{lipsum}
usepackage{zref-user,zref-abspage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~zlabel{A}zref[abspage]{A}, zlabel{B}zref[abspage]{B}, zlabel{C}zref[abspage]{C}, zlabel{D}zref[abspage]{D}, zlabel{E}zref[abspage]{E}.
end{document}
add a comment |
You can get the absolute page number e.g. with the zref package:
documentclass{article}
usepackage{lipsum}
usepackage{zref-user,zref-abspage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~zlabel{A}zref[abspage]{A}, zlabel{B}zref[abspage]{B}, zlabel{C}zref[abspage]{C}, zlabel{D}zref[abspage]{D}, zlabel{E}zref[abspage]{E}.
end{document}
You can get the absolute page number e.g. with the zref package:
documentclass{article}
usepackage{lipsum}
usepackage{zref-user,zref-abspage}
begin{document}
lipsum[1-5]
lipsum[6][2]
Page~zlabel{A}zref[abspage]{A}, zlabel{B}zref[abspage]{B}, zlabel{C}zref[abspage]{C}, zlabel{D}zref[abspage]{D}, zlabel{E}zref[abspage]{E}.
end{document}
answered yesterday
Ulrike FischerUlrike Fischer
198k9306692
198k9306692
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483665%2fusing-theabspage-from-the-perpage-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Presumably
abspage
has the same issue as the normalpage
counter: texfaq.org/FAQ-wrongpn– moewe
yesterday
@moewe Thanks for your comment! I believe I know what happens with the
page
counter, how paragraphs and pages are broken, etc. (read the TeXbook 'till chapter 27). From reading theperpage
manual, I expected that after two passes,theabspage
would be up-to-date, but I'm not sure I really understand its textual definition from theperpage
manual (it mentionspage
, what's that? A typo, I guess). So, maybe I just don't understand the purpose oftheabspage
, after all. That was the question. :)– frougon
yesterday
1
no you can't use theabspage like this, and the perpage package is for other counters, e.g. to get footnote references by pages.
– Ulrike Fischer
yesterday
1
If I understand the documentation of
perpage
correctly thenabspage
is defined asAddAbsoluteCounter{page}
. AndAddAbsoluteCounter{<counter>}
just defines a counterabs<counter>
that is stepped up each time<counter>
is stepped up. Since it is not reset by resets to<counter>
it holds the absolute/total counter value. Forpage
that seems to imply thatabspage
has the exact same issues aspage
w.r.t. its value in the first paragraph on a new page.theabspage
andpage
could differ if you started your document with Roman page numbers and only later switched to Arabic 1– moewe
yesterday
1
If you want to call this negative page numbers, then yes. It is not that unusual for people to want to reset their page numbers at certain points, so a robust and truly unique counter like
abspage
can be useful. This is especially useful for other objects where it is much more common to reset counters (like footnote counters per chapter or the like) particularly in the context of theperpage
package, which resets all kinds of things per page.– moewe
yesterday