2

In chemistry, one often has to use decimal exponents: 10^{-4.6} for the value of a reaction constant. I'm usually using siunitx to type numbers in scientific notation with \num{4e5} for instance. However recent versions don't allow decimal exponents anymore. I'm now left with many files filled with commands like \num{1e-5.6} that don't compile anymore.

What other package would parse numbers with decimal exponents ?

3
  • you can always use the option for siunitx v2 compatibility Feb 23, 2022 at 8:00
  • This has come up with a couple of people and I'm thinking about it: my issue is that the point of an exponent for a quantity is in-part that it links to SI prefixes. That only works for integer exponents. Can you give a fuller example which shows the use case with units, etc.?
    – Joseph Wright
    Feb 23, 2022 at 8:03
  • Personnally, I don't need decimal exponents for the \SI command, only for the \num command where there is no problems with units.
    – wilk
    Feb 25, 2022 at 14:50

1 Answer 1

2

You could write a macro yourself, assuming that you don't have any complicated use cases. Of course, you won't have access to any of the other nice features of siunitx.

\documentclass{article}

\makeatletter
  \newcommand\dexp[1]{\@dexp#1\@stop}
  \def\@dexp#1e#2\@stop{%
    \ifx\relax#1\relax\else
      #1 \cdot
    \fi
    10^{#2}%
  }
\makeatother

\begin{document}

\(\dexp{e1.2}\)

\(\dexp{3e4.5}\)

\end{document}

MWE output

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .