How to write an arc or curve over letters?

I want it ike this
image
But I use math.overparen, I only have this:
image
It’s too long and high.

Well, I don’t know if there’s better robust solution, but borrowing some Spacing (H) Function – Typst Documentation works for simple cases.

#let arc(base, left: 0.4em, right: 0.2em) = {
  h(left)
  math.overparen({
    h(-left)
    base
    h(-right)
  })
  h(right)
}

$ arc(A P) arc(B L) $

There is the Accent Function – Typst Documentation

$accent(A B, \u{0311})$

$accent("AB", \u{0311})$

There may be a better Unicode character, such as “◌͡◌” U+0361 Combining Double Inverted Breve Unicode Character but it doesn’t seem to work…

2 Likes

I think it’s just missing in the default math font (New Computer Modern Math). It’s present in STIX Two Math:

#show math.equation: set text(font: "STIX Two Math")
$ accent(A B, \u{0361}) $

image

1 Like

Also

$accent(A B, \u{2312})$
#show math.equation: set text(font: "STIX Two Math")
$accent(A B, \u{23DC})$

2 Likes