Math & ScienceNumber List and its final Separator

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
muchalh
Posts: 12
Joined: Fri Aug 14, 2009 4:51 am

Number List and its final Separator

Post by muchalh »

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:

Code: Select all

\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:

Code: Select all

\num{3.23} (dd, \emph{J} = \SIlist[list-units=single,list-final-separator = {, }]{3.9;0.9}{\Hz}, 1H)
I get the following result (with "and" instead of a comma):
3.23 (dd, J = 3.9 and 0.9 Hz, 1H)
A list of three or more values works OK:

Code: Select all

\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.

Minimal demo file attached.
siunitx version 2013/02/01 v2.5p.
Win7, MiKTex 2.9


Also posted on {TeX} SX.


Edit:
Problem already solved. That was quick, Joseph. Thank you.
You need to use list-pair-separator={, } when two numbers are listed.
Attachments
demo.tex
Minimal demo file
(1.19 KiB) Downloaded 328 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
Post Reply