5

I have some problem with the following code.

\documentclass{minimal}
\usepackage{fontspec,luatextra,unicode-math}
\usepackage{icomma}
\usepackage[noload=abbr]{siunitx}
\sisetup{decimalsymbol=comma, detect-all}
\let\nbu\SI

\setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}

\begin{document}
\nbu{7.8}{m} or $7,8 = \nbu{7.8}{m} = \mathscr{A}$ in math mode.\par
\end{document}

enter image description here

I don't want \itshape for the m. With the following code, the result is good, but I don't want to put the \setmathfont{} inside the document environment (but in sty file). How is it possible ?

\documentclass{minimal}
\usepackage{fontspec,luatextra,unicode-math}
\usepackage{icomma}
\usepackage[noload=abbr]{siunitx}
\sisetup{decimalsymbol=comma, detect-all}
\let\nbu\SI

\begin{document}
\setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}
\nbu{7.8}{m} or $7,8 = \nbu{7.8}{m} = \mathscr{A}$ in math mode.\par
\end{document}

enter image description here

Thanks to all.

3

1 Answer 1

5

It seems that siunitx is missing some kind of "default" font for the cases except \mathscr and \mathscrbf:

\documentclass{minimal}
\usepackage{fontspec,luatextra,unicode-math}
\usepackage[noload=abbr]{siunitx}
\sisetup{decimalsymbol=comma, detect-all,debug}
\let\nbu\SI

\setmathfont{latinmodern-math.otf}
\setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}

\begin{document}
\nbu{7.8}{m} or $7,8 = \nbu{7.8}{m} = \mathscr{A}$ in math mode.\par
\end{document}

Result

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .