How can I use non math font in equations?

Hi there, is there any way to use non-math fonts within equations? I am trying to use TeX Gyre Chorus as the mathcal font, However, Chorus is a non math font, so I cannot use show math.equation: set text(font: "TeX Gyre Chorus") to overwrite the font settings. I can only do this with

#let cal(it) = {
  text(
    font: "TeX Gyre Chorus",
    box(it),
  )
}

But there are still some problems, like the kerning looks weird, there is no h space around the content like how equations usually do. Is there some good ways to solve this?

Hi. The whole point of the math mode is to work great with math formulas. Hence, a math font is used that has unique features. It shouldn’t be surprising that forcefully using different font makes it look bad around math stuff.

$x cal(y)() = cal(z)$

#let cal(it) = math.class("normal", $text(font: "TeX Gyre Chorus", it) med$)

$x cal(y)() = cal(z)$

image

2 Likes

Thanks for your solution, it did work. I have a little question. Is there some special reason for the “med” spacing instead of thin or 1mu = 1/18 em?

No, use whatever space/spacing you like. It looks close enough for the example.