Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to use units like

kg/kg of air

or

kg of water/kg of air

How can I do it with siunitx?

share|improve this question
1  
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
2  
@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
1  
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
add comment

1 Answer

up vote 12 down vote accepted

Updated answer

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}

Original answer

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}
share|improve this answer
1  
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
    
@Arafinwe Thanks for the reminder about this question: I've edited the answer! –  Joseph Wright Sep 23 '12 at 8:05
    
@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
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.