fontspec
fontspec copied to clipboard
Set mode for fonts used in math
trafficstars
Description
Currently fontspec sets the current text fonts as default fonts for \mathrm (...). Since the current
text fonts typically uses the node or harf shaper in LuaLaTeX this uses such fonts in math mode which
doesn't actually work since math mode is not processed by these shapers.
Can fontspec (at least for LuaTeX) automatically set \mathrm (...) to equivalent fonts with mode=base?
Check/indicate
- [ ] Relevant for XeTeX
- [x] Relevant for LuaTeX
- [x] Issue tracker has been searched for similar issues?
- [ ] Links to <tex.stackexchange.com> discussion if appropriate
Minimal example demonstrating the issue
\documentclass{article}
\usepackage{fontspec}
\setmainfont{texgyrepagella}
\begin{document}
$\mathrm{H}H$
\typeout{\string\mathrm: \fontname\textfont0}
\end{document}
shows that \mathrm has mode=node instead of mode=base.