I use babel
with lualatex
to write documents in our native language Hebrew, and I encountered a strange issue. Despite the fact I defined a custom font for Hebrew only, when I use roman style in math mode, for example, \mathrm{kg}
, it uses the Hebrew font instead of the default English font:
\documentclass[a4paper, 12pt]{extarticle}
\usepackage[bidi=basic, layout=tabular]{babel}
\babelprovide[main, import, alph=letters, Alph=letters]{hebrew}
\babelprovide[import]{english}
\babelfont[hebrew]{rm}{Calibri}
\babelfont[hebrew]{sf}{Calibri}
\begin{document}
\[ kg \qquad \mathrm{kg} \]
\end{document}
The result is:
and I want to use the default English font for math expressions. Commenting out the
babel
setup (since this example doesn't involve any Hebrew) gives the desired result:
Notice that regular italic math is unaffected and rendered correctly in both cases.
How can I configure babel
to use the default fonts for English, especially in math mode (I don't want any Hebrew involved in math most of the time)?
no-math
to the class deceleration options, e.g.\documentclass[a4paper, 12pt, no-math]{extarticle}
.fontspec
package so doing\PassOptionsToPackage{no-math}{fontspec}
is a more correct solution in my opinion. If you could explain the reason behind this behavior, I'd appreciate it.