josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
350 stars 25 forks source link

Literal unit printing always selects current mode #729

Closed josephwright closed 2 months ago

josephwright commented 2 months ago

Raised in https://github.com/josephwright/siunitx/issues/728 - at present the standard settings use \ifmmode ... \else ... \fi for various unit symbols and fail to protect from expansion in literal mode (where \protected@edef is applied). This should be fixed by shifting to \TextOrMath or similar.