siunitx icon indicating copy to clipboard operation
siunitx copied to clipboard

Always evaluate \raiseto and \tothe input

Open josephwright opened this issue 2 years ago • 2 comments

Comes up from https://tex.stackexchange.com/questions/693582/bug-in-siunitx/693608. Currently, \tothe assumes that the input is a simple value. This means if no further maths takes place, it is simply printed even if a complex value. However, adding \per forces evaluation and a potentially a confusing error. There should be finer control of this: likely such a change would need to go with a way to convert decimals to fractions.

josephwright avatar Aug 16 '23 05:08 josephwright

There is another use case where mathmatical expressions in \tothe is desired. In chemical kinetics, the unit of rate constant is usually written as \unit{\mole\tothe{1 - \alpha}\liter\tothe{\alpha - 1}\per\second}, where \alpha is the overall reaction order. When we don't know the reaction order in advance (for example, when we are faced with a completely new reaction and we want to determine its kinetic properties by multivariate fitting), such expressions will be useful. However, if we turn off parse-units, \per will be printed as a slash whatever per-mode is, which may cause inconsistency.

lhy7889678 avatar Aug 20 '23 04:08 lhy7889678

I think we also need https://github.com/josephwright/siunitx/issues/683 sorting - so bigint first!

josephwright avatar Dec 03 '24 17:12 josephwright