Why is my footer `((..) => ..,)` instead of the page number?

Hello @PaulS! The ((..) => ..,) you see comes from your footer.

You can read the topic Why is the value I receive from context always content? to understand context expressions.

This topic “How to use context instead of a callback function in locate function calls? - #2 by quachpas” adresses your issue directly.

Without looking any further, I can suggest the following:

#set page(
    paper: "a4",
    numbering: "1",
    footer: context {
      let page-number = counter(page).at(here()).first()
      let match-list = query(selector(<turn-on-page-numbering>).before(here()))
      if match-list == () { return none }
      align(center, str(page-number))
    },
  )

I also took the opportunity to rename your topic to “Why is my footer ((..) => ..,) instead of the page number?”, if that’s wrong please modify it!
Good titles are questions you would ask your friend about Typst.

2 Likes