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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.