summaryrefslogtreecommitdiff
path: root/library/src
diff options
context:
space:
mode:
authorDavid Voigt <40773635+dvdvgt@users.noreply.github.com>2023-03-25 13:35:32 +0100
committerGitHub <noreply@github.com>2023-03-25 13:35:32 +0100
commit65456208916451c165efb8e3d6ac5870a04cac4e (patch)
tree54a0020369dd29292302b5a161f97146a2511d97 /library/src
parent766d1be72b046c1ee0db2602d8573b206fa81fe5 (diff)
change page numbering for outline (#284)
Diffstat (limited to 'library/src')
-rw-r--r--library/src/meta/outline.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/src/meta/outline.rs b/library/src/meta/outline.rs
index 002d757e..38eb3a17 100644
--- a/library/src/meta/outline.rs
+++ b/library/src/meta/outline.rs
@@ -1,4 +1,4 @@
-use super::{Counter, HeadingElem, LocalName};
+use super::{Counter, CounterKey, HeadingElem, LocalName};
use crate::layout::{BoxElem, HElem, HideElem, ParbreakElem, RepeatElem};
use crate::prelude::*;
use crate::text::{LinebreakElem, SpaceElem, TextElem};
@@ -160,7 +160,10 @@ impl Show for OutlineElem {
}
// Add the page number and linebreak.
- let page = vt.introspector.page(location);
+ let page = Counter::new(CounterKey::Page)
+ // query the page counter state at location of heading
+ .at(vt, location)?
+ .first();
let end = TextElem::packed(eco_format!("{page}"));
seq.push(end.linked(Destination::Location(location)));
seq.push(LinebreakElem::new().pack());