[Tex/LaTex] How to siunitx be used with mathematics environment notation

mathematicssiunitxunits

How can mathematics environment notation be used with units provided by siunitx? Let's way I want to have some code like the following:

\SI{10^{-28}}{m^{2}}

Is it possible to use this mathematics style of notation with siunitx (not the siunitx 10e-28 type of notation)? Is the following a valid alternative?

${10^{-28}}$\,\si{m^{2}}

How could a mathematics style equation be used with siunitx, something like the following?

${a^{b}}$\,\si{m^{2}}

Best Answer

You can turn off the number parse and the 'font control' with something like

\documentclass{article}
\usepackage{siunitx}
\begin{document}

\SI[parse-numbers = false, number-math-rm = \ensuremath]{a^{b}}{\metre}

\end{document}

However, I wonder about the meaning here: it's hard for me to see how you can have a physical quantity expressed in that form!