latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
239 stars 28 forks source link

Using \mathversion breaks \SI #538

Open kexplorning opened 4 years ago

kexplorning commented 4 years ago

Description

Using \mathversion will break \SI.

Add info or delete as appropriate:

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}[version = tex]
\setmathfont{latinmodern-math.otf}[version = lm]
\mathversion{lm}

\usepackage{siunitx}

\begin{document}
\SI{1.2e-1}{kg.m^2}
$\SI{1.2e-1}{kg.m^2}$
\end{document}

image

- and \times is missing.

hvoss49 commented 4 years ago

Am 06.03.2020 um 08:31 schrieb kexplorning notifications@github.com:

Description

Using \mathversion will break \SI.

Add info or delete as appropriate:

Relevant for XeTeX Minimal example demonstrating the issue

\documentclass{article} \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}][version = tex] ^^^^^ should be

\setmathfont{texgyrepagella-math.otf}[version = tex]

and then no problem with xelatex/lualatex

\setmathfont{latinmodern-math.otf}[version = lm] \mathversion{lm}

\usepackage{siunitx}

\begin{document} \SI{1.2e-1}{kg.m^2} $\SI{1.2e-1}{kg.m^2}$ \end{document} — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wspr/unicode-math/issues/538?email_source=notifications&email_token=ADCLIP4BYJ4EOTPIZBDNJHLRGCREBA5CNFSM4LC2MPEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ITAQAYA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCLIP274JMSNPEFS2FBCHDRGCREBANCNFSM4LC2MPEA.

kexplorning commented 4 years ago

@hvoss49 Sorry for misspelling, I was in a harry and didn't have a TeX system at that time.

I have fixed the description.

hvoss49 commented 4 years ago

You have to define one active main mathfont, e.g.:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}[version = tex]
\setmathfont{latinmodern-math.otf}[version = lm]
\setmathfont{xitsmath-regular.otf}%  Main math font
\mathversion{lm}
\usepackage{siunitx}
\begin{document}
\SI{1.2e-1}{kg.m^2}
$\SI{1.2e-1}{kg.m^2}$
\end{document}

Bildschirmfoto 2020-03-06 um 13 37 56

kexplorning commented 4 years ago

Thanks, it fixes the problem. But I don't understand why it doesn't influence math typesetting except this.