#Page numbering issue + comma issue

11 messages · Page 1 of 1 (latest)

plush badge
#

One issue and one thing I'd like to make tidier:

  • The header prints "Page 2" in the upper right, for both pages 1 and 2, and I'm not sure why?
  • Immediately after data.party.name, I have to leave out any whitespace before #if, else the comma gets separated by one space. Is there any other way to keep the comma immediately after the party name?
#set page(
  paper: "us-legal",
  header: context [
    #set text(8pt)
    #smallcaps[
      #const.title between #data.me.name and #data.party.name#if data.party.on_behalf != "" [, on behalf of #data.party.on_behalf]
      #h(1fr)
      #counter(page).display("Page 1 of 1", both: true)
    ]
  ],
)

#pagebreak()
stone salmon
#

"page" contains an "a" so thats why the latter happens

#

a is then used as the count

#

if you look at the second page it actually says "Pbge" instead

stone salmon
#

(a, b) => "Page {a} of {b}".replace("{a}", str(a)).replace("{b}", str(b)) may be what you want instead

plush badge
#

Huh... thanks

#

I'll probably just go Page #counter...

wicked cairn
#

no need for extra formatting libs

#

#counter(page).display((page, total) => [Page #page of #total], both: true)

#

works just fine