#Access Context of last page number of content from earlier in the document

15 messages · Page 1 of 1 (latest)

untold skiff
#

I have a document where I create the footer with something similar to the following:

set page(
  numbering: "1",
  footer: footerComponent(
    [
      Page
      #counter(page).display(
          "1 of",
          both: false
        )
      #last_content_page
    ]
    )
  )


content_body 
let last_content_page = context(counter(page).get()).at(0)

content_body is all of the content, and I want my footer to show the last page number of the content part of the document. I can get the last_content_page number with let last_content_page = context(counter(page).get()).at(0) but I can obviously not access it where I would need it, any ideas ?

hardy trout
untold skiff
#

I get what I want with:

set page(
  numbering: "1",
  footer: footerComponent(
    [
      Page
      #counter(page).display(
          "1 of",
        )
      #context(counter(page).at(<at_the_end>)).at(0)
    ]
    )
  )

content_body 
[ugha bugha I am at the end <at_the_end>]

But I do not want extra content after my content_body

#

How can I make a lable that is just connected to the current page and not an object ?

#

if I understood correctly a label cannot exist with nothing attached to

hardy trout
untold skiff
#

uhhh fancy, since when does this exist

hardy trout
#

You can attach a label to it

hardy trout
untold skiff
#

solved, awesome 😄

#

ah this was all made contextual in .11 that's why this did not work before

uncut frigate
#

Why not just counter(page).final().at(0)?

#

The last page totally would not be part of the "content part"?

untold skiff
#

the part afterwards also uses the page counter

#

I think what you mentioned is also what the counter.display(both: true) uses. But that will get the amount of pages of my first+second part, so the number was always wrong