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.

First and foremost, thanks to Joseph Wright for developing and maintaining siunitx package.

I have a problem with \SIlist macro. The desired result:

3.23 (dd, J = 3.9, 0.9 Hz, 1H).

and I'm using this code:

\num{3.23} (dd, \emph{J} = 3.9, \SI{0.9}{\Hz}, 1H).

It works fine but I thought I could use \SIlist macro and eventually automate things a bit:

\num{3.23} (dd, \emph{J} = \SIlist[list-units=single,list-final-separator = {, }]
{3.9;0.9}{\Hz}, 1H)

I get the following result:

3.23 (dd, J = 3.9 and 0.9 Hz, 1H)

A list of three or more values works OK:

\num{3.23} (ddd, \emph{J} = \SIlist[list-units=single,list-final-separator = {, }]
{3.9;0.9;0.1}{\Hz}, 1H)

3.23 (dd, J = 3.9, 0.9, 0.1 Hz, 1H)

Any ideas? Thank you.

siunitx version 2013/02/01 v2.5p.
Win7, MiKTex 2.9

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You want list-pair-separator:

\documentclass{article}
\usepackage{siunitx}
\begin{document}

\SIlist[list-units=single,list-final-separator = {, }, list-pair-separator= {, }]
  {3.9;0.9}{\Hz}

\end{document}

I'd probably use \sisetup to do this globally.

share|improve this answer
    
Thank you, Joseph. What is the best placement for global option (after \begin{document}? –  Hubert Muchalski Feb 19 '13 at 18:27
    
@HubertMuchalski In the preamble (before \begin{document}) would be my preference. –  Joseph Wright Feb 19 '13 at 18:40

Have had exactly the same question, funny. This is what I am using in my preamble to set most things right for chemists work with siunitx ;)

\sisetup{
    detect-family,
    alsoload        = synchem,
    list-units      = single,
    range-units     = single,
    range-phrase    = --,
    list-pair-separator= {, },
    list-separator  = {,},
    list-final-separator = {,},
    per-mode        = fraction,
    exponent-product = \cdot
    }
share|improve this answer
1  
alsoload is a version 1 option: it's deprecated in v2 and you really should define any non-standard units yourself [I'm a chemist too, and I define things like \Molar :-)] Also, some of your settings are 'personal choice', rather than answering the question. –  Joseph Wright Feb 20 '13 at 16:41
    
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or select your code and hit Ctrl+K. –  Claudio Fiandrino Feb 20 '13 at 16:59

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.