siunitx icon indicating copy to clipboard operation
siunitx copied to clipboard

\per\molar is not inverting the units correctly

Open biditism opened this issue 3 years ago • 3 comments

\molar gives the unit correctly as mol dm-3 but using \per\molar only inverts the mole and not the cubic decimeter i.e. the output is mol-1 dm-3 where actually it should be mol-1 dm3.

biditism avatar Jan 24 '22 06:01 biditism

You don't say how you define \molar, but assuming \DeclareSIUnit\molar{\mole\per\cubic\deci\metre}, your output is exactly as expected. Units don't 'group': \molar is simply replaced by \mole\per\cubic\deci\metre, they the \per you've added applies only to the \mole.

josephwright avatar Jan 24 '22 08:01 josephwright

Thank you. I thought \molar was a pre-defined unit as I had not defined it myself. I now realize that it is defined by chemmacros. Is it possible to define the units so that they are grouped?

biditism avatar Jan 24 '22 16:01 biditism

At present no, I can log it as a feature request, but I'm worried it might be confusing overall.

josephwright avatar Jan 24 '22 19:01 josephwright