# Siunitx without unit macros

The siunitx manual states in Ch. 3:

The unit system can interpret units given as text to be used directly or as macro- based units. In the latter case, different formatting is possible.

To give units directly as text works for simple cases like \SI{4}{kg}, but I didn't find any further documentation of how the syntax is parsed if one wants to give units directly as text and not as macros.

For example one might wish that \SI{4}{m/s^2} gives the same result as \SI{4}{\m\per\second\squared}. Using \SI{4}{\frac{m}{s^2}} seems to give the correct result, but I am not sure, if this is a correct way to use it. So is there any further documentation or explanation of how to give units more diretly without using the units macros?

• If you don't want to use the unit macros, the most important rule is that a . is used to separate units: \si{kg.m.s^{-1}}. Apr 25, 2017 at 15:47
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Sep 7, 2017 at 12:04

The is no parsing when 'literal' unit input is used. Instead, a small number of substitutions/adjustments are made:

• . and ~ represent inter-unit products
• ^ can be used for superscripts
• _ can be used for subscripts
• Text is printed upright
• Superscripts can be handled using the 'unit' or 'number' font setting

With the standard settings, siunitx sets units in math mode and so uses \mathrm. This will allow \frac as it's math mode syntax. If you use mode = text then _ and ^ still work (due to the substitutions) but things like \frac will not.

The 'literal' unit mode is essentially the same as that in sistyle.

• More or less a re-hash of the manual, page 6 in the current release. Apr 25, 2017 at 15:55