Spacing between units in siunitx

siunitx

I am using the siunitx package and the documentation is a bit mind-blowing.

I'm using it with no options and no sisetup.

There is zero spacing my units. I have tried to add sisetup with inter-unit-product = \, but there is no change. I believe this is meant to be the default anyway.

Here is an example.

Example of badly spaced units

For example, I use \unit{\J \kg^{-1} \K^{-1}} to typeset the corresponding unit.

Any help in getting some spacing between these units is welcome. Thanks.

Best Answer

The package has two ways of reading units. First, you can give all units as commands:

\unit\unit{\J\per\kg\per\K}

This is parsed, and is used to construct the output with controllable formatting. Second, you can use 'literal' mode, where things are given by yu and typeset 'as is', e.g.

\unit\unit{J.kg^{-1}.K^{-1}}

In this mode, inter-unit spaces are indicated by . or ~.

You have mixed the two, using unit macros but some literal formatting. That forces the literal mode, but as you have no inter-unit spaces indicated, you get none. Either add . between units

\unit\unit{\J.\kg^{-1}.\K^{-1}}

or swtich to full macro-based units.