Why do my two superscripts look as if they had different fonts or styles?

Hi! I’m trying to figure out why my code for author affiliations produces different-looking superscripts, but I don’t know how to debug this

#set text(size: 2em, font: "PT Sans")

#let authors = (
  (
    name: "First",
    affiliation: 1,
  ),
  (
    name: "Second",
    affiliation: (1, 2),
  )
)

#for author in authors {
  let affs = author.affiliation
  if type(affs) == int {
    affs = (str(affs),)
  } else {
    affs = affs.map(str)
  }
  box[#text(weight: "regular")[#author.name#h(1pt)#super[#affs.join(",")]]]
  if author != authors.last() [,#h(0.5em)]
}

Here you can see the first superscript looks bold
Screenshot 2025-08-07 at 4.18.34 PM

Hi!
I’m not sure why this happens, but I guess it’s a bug.

For a quick fix you can inset the following expression:

box[#text(weight: "regular")[#author.name#h(1pt)#super[#text(weight: "regular", affs.join(","))]]]

They look the same if you add this setting:

#set super(typographic: false)

So that will explain what’s happening - at least partially. It depends on the font. The font probably has 1 and 2 in superscript variants, but not a comma, so when asked to super 1,2 typst will disable typographic superscript for that particular one, because one of the glyphs is missing from the font.

We verify the hypothesis by noticing that they look uniform if we remove the comma…

The version of PT Sans that I get (typst webapp) doesn’t even have a 4 or 5 in typographic supscript variant - with that status I would advise to disable typographic supscripts entirely in the document with that font, they are not worth using probably(?)

This doesn’t look exactly the same, but it’s similar to the original:

#set super(typographic: false)
#show super: set text(weight: "bold")
3 Likes