Including 'of' in unit qualifiers with siunitx

I need to use units like

kg/kg of air

or

kg of water/kg of air

How can I do it with siunitx?

-
Jake: Sorry, I learn by examples...siunitx manual contains lot of options...with little examples... I just started using siunitx. Once again sorry Jake –  sandu Jun 8 '12 at 9:29
@sandu -- your claim that the siunitx user guide contains few examples seems odd. The package provides lots of options, but the guide also provides plenty of examples illustrating the available option. –  Mico Jun 8 '12 at 10:52
But still it is hard to understand for a person new to LaTeX. One of the challenges with LaTeX is that there are so many different syntaxes, ‘every package has its own’. –  Sveinung Jun 8 '12 at 11:49
Sveinung: Yes you are correct. It takes time to understand and use different syntaxes...Initially we need help to customize a package to our requirements. –  sandu Jun 9 '12 at 3:58

With the current release of siunitx, the command \of using the qualifier-mode = phrase option covers this case:

\documentclass{article}
\usepackage{siunitx}
\sisetup{per-mode = symbol,qualifier-mode = phrase}
\begin{document}
\SI{10}{\kg\of{water}\per\kg\of{air}}
\end{document}


These look like 'qualifiers'. At present, there is not a mode to include 'of' or similar (perhaps I should add that), so you need a little imagination

\documentclass{article}
\usepackage{siunitx}
\DeclareSIQualifier{\air}{of air}
\DeclareSIQualifier{\water}{of water}
\sisetup{per-mode = symbol,qualifier-mode = space}
\begin{document}
\SI{10}{\kg\water\per\kg\air}
\end{document}


A more 'standard' approach would be something like

\documentclass{article}
\usepackage{siunitx}
\DeclareSIQualifier{\air}{air}
\DeclareSIQualifier{\water}{water}
\begin{document}
\SI{10}{\kg\water\per\kg\air}
\end{document}

-
Thank you...Joseph Wright –  sandu Jun 8 '12 at 9:31
@sandu Just so you know, Mr. Wright went ahead and added it, so there's now a \of command. –  Istvan Chung Sep 22 '12 at 22:54
@JosephWright Hello, I have one request about your package siunitx. When one uses per-mode = symbol, \SI{1e4}{\per\s} returns 10^4/s. According to ISO 80000 this is wrong, it should be written 10^4 s^{-1}. I think it would be a good idea to put an option into your package, which overrides per-mode format for in-line mode and goes into normal mode when unit starts with \per. Thanks and best regards. –  Pygmalion Oct 25 '13 at 20:01
@Pygmalion If you are following the 'rules' you'd never use per-mode = symbol in any case :-) The current output is I'd say the most consistent for the user: per as a symbol means exactly that, so producing an exponent would be confusing for most people. (Note: ISOs are regrettably not freely available, and so I can only go on what I have access to.) –  Joseph Wright Oct 25 '13 at 20:05