Bug when combining \sqrt with scientific notation and number-mode=match, with workaround
bamford opened this issue · 2 comments
I have been trying to typeset \qty
, similar to \qty{3e10}{m^{-1}}
, in a document that uses \sisetup{number-mode=match}
.
Using parse-numbers=false
almost works:
\sisetup{number-mode=match}
The number is not \qty{3e10}{m^{-1}}, but rather \qty[parse-numbers=false]{\sqrt{3}\times10^{10}}{m^{-1}}.
produces:
which somehow typesets the
Presumably this is unintended behaviour, that someone with knowledge of the internals of siunitx may be able to fix.
After some experimentation I found that adding the number-mode=math
option and wrapping the number in \text{}
produes the desired output, although I’m not sure why! So, this is a workaround:
\sisetup{number-mode=match}
The number is not \qty{3e10}{m^{-1}}, but rather \qty[number-mode=math, parse-numbers=false]{\text{\sqrt{3}\times10^{10}}}{m^{-1}}.
I'm using LuaLaTeX with TeX Live 2023 on Overleaf.
I've corrected the behaviour here: you get everything in math mode - that is the documented approach when not parsing numbers.
That was fast! Many thanks @josephwright.