latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
123 stars 34 forks source link

\selectfont in math mode raises an error with onchar #281

Closed jbezos closed 4 months ago

jbezos commented 4 months ago

Actually, I’m not sure using \selectfont in math mode is a good idea, but no error is raised by default and so it should be in this case, too.

\documentclass{article}

\usepackage[english]{babel}
\babelprovide[onchar=ids fonts]{greek}
\babelfont{rm}{FreeSerif}

\begin{document}
$\selectfont$
\end{document}

The error is:

! LaTeX Error: Command \rmfamily invalid in math mode.