I am using NCM (NewComputerModern) as my main font.
Because I do not like the \mathcal{…}
provided by unicode-math
in the Euler font instead of the Latin Modern
oder Computer Modern
style.
I think that I am switching to Computer Modern Symbol
(cmsy
) with
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
I got the cmd from here.
This causes the \hat{…}
cmd to be slightly off-center if you compare it without unicode-math
in Latin Modern Math
.
The first is with the Euler Font. I think the spacing of the mathcal
letters is being used to set the hat
symbol which causes it to be slightly off-center (I could be wrong though).
How do I get the "correct" position?
This is how it should look like (although the hat symbol has a weird width in this one):
MWE:
\documentclass{scrartcl}
\usepackage{unicode-math}
\setmainfont{NewCM10-Book.otf}
\setmathfont[CharacterVariant=1]{NewCMMath-Book.otf}
\setmathfont[range={scr,bfscr}]{XITS Math}
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
\begin{document}
$\hat{\mathcal{J}} \hat{\mathcal{K}} $
\end{document}
Best Answer
I think that I may have found a "better" solution than what I was using before.
I am assuming (but really just guessing) that with
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
internally the font-shape and width of the characters by the other font was used which caused the misaligned\hat{…}
for\mathcal{J}
and\mathcal{K}
.After testing and trying I came to look up what
cmsy
is actually called as a file that is installed.It turns out that the file is called
cmsy10
(actually ranging from 5 to 10; socmsy5
,cmsy6
, …).So now to the fixed MWE: