I use New Computer Modern Math as my text and math font.
Italic commands doesn’t work!
_a_
or #emph[“a”] provide normal font, but, of course $a$ provide italic font.
I use New Computer Modern Math as my text and math font.
Italic commands doesn’t work!
_a_
or #emph[“a”] provide normal font, but, of course $a$ provide italic font.
Don’t use a math font for normal text. That will cause many issues like this that are not the fault of typst. Instead, just use New Computer Modern
for text and New Computer Modern Math
for math (which is the default anyway).
Specifically, math fonts use different symbol tables so to speak. As such, the normal text functions like emph
or strong
won’t work as they expect the “normal” letters or symbols. You can still have italic or strong text in math explicitly through their respective math functions: math.italic
or math.bold
.
Thank you for your answer.
Reason I’m doing it is I want to have the same appears
$1$ and 1
or
$…$ and …
Do you know other methods to this?
However, your explanations doesn’t hold because strong works in text mode! Only italic doesn’t work.
Luckily, NewCM does contain all alphabetic characters in bold. However, that doesn’t change @xkevio’s statement. You should not use maths fonts in text.
#show math.equation: set text(font: "New Computer Modern Math")
#set text(font: "New Computer Modern")
1 *1* _1_ $1$
Typst actually ships multiple weights of NCM Math, so strong
does in fact work as expected. You still shouldn’t use it as your text font though.