siunitx: Revising the units

Working on siunitx version 2, I’ve been carefully back over the SI units. So the core code now defines everything that is listed in the various tables, plus \percent (seems pretty sensible) and the US spellings \meter and \liter (realism). Most of the units are easy enough to give a macro name to, but the speed of light (\clight) and reduced Planck constant (\planckbar) are possibly a bit odd. The minutes and seconds of arcs (\arcminute and \arcsecond) obviously need different names from the same units for time, and I hope make sense.

More awkward are the things beyond the SI units. I’m revising the abbreviations and so on, to bring more order to how everything is done. The real problems are the more specialist units that need to be defined (realism again), but that are clear non-SI. In my own area (chemistry) we tend to use “molar” (moles per cubic decimetre) a lot, and so that is in. In the same way, there are some other areas that I’ve had good feedback on and know what is needed. However, there are also some odds and ends that I’m less sure on. High-energy physics seems to have a lot of units in the hepunits package, but I don’t know how many are really needed. Similarly, there are some older units for radiation does (roentgen’s and rad’s) that I don’t really know what to do with.

I’m keen to get any ideas about the current direction. There will probably be another snapshot of the code and documentation in a couple of weeks, which will add a lot more of these awkward units. So take a look and make suggestions, either at the snapshots or at the development code.

9 thoughts on “siunitx: Revising the units

  1. I use siunitx because it offers a way to typeset units consistently. So I am not sure it is good idea to include all kinds of units because it seems they are countless. For example in computer networks, Tbp/s Gbp/s etc. are widely used. If I am too lazy to look it up in the manual I will just do:

    newunitTbps{Tbp/s} …

    Leo

  2. Hello Leo,

    You are of course right that there is an almost endless supply of possibles. That said, it is useful to have some things set up. One obvious one is abbreviations (things like Hz, nm, mmol, etc.), which are useful I think. I’m less sure about the “prefixed” units which I inherited from older packages. I tend to think millimetre is not really much gain over millimetre. I do need to check these things work, however!

    Joseph

  3. newunitTbps{terabitpersecond}

    But I was merely trying to say that it is very easy to define new units even if one does not know much about what is in siunitx.

    BTW, is there any difference between the following two definitions:

    newunitTb{terabit}
    newunitTb{Tb}

  4. Hello Leo,

    The difference would appear if you asked siunitx to convert prefixes to numbers. It can do the first version, but not the second.

    Joseph

  5. Hi Joseph,
    I am wondering how/whether it would be possible to typeset hour/min/secs in the way siunitx does with arc.
    This is to be used in the context of astronomy where angles are expressed in such a way…
    Just to give you a visual clue of what I would like to achieve see the following example (using the euro package):

    Any suggestions is welcome.
    Thanks in advance
    Bye
    Enrico

    documentclass[a4paper]{report}

    newcommanddegr[1]{hbox{$#1^circ$}}
    newcommandarcmin[1]{hbox{$#1^prime$}}
    deffarcs{hbox{$.!!^{primeprime}$}}
    deffdg{hbox{$.!!^circ$}}
    newcommandphour[1]{hbox{$#1^{rm h}$}}
    newcommandpmin[1]{hbox{$#1^{rm m}$}}
    deffsec{hbox{.!!^{rm s}$}}

    defarcsec{hbox{$^{primeprime}$}}
    defutw{smash{rlap{lower5pthbox{$sim$}}}}
    defudtw{smash{rlap{lower6pthbox{$approx$}}}}
    deffd{hbox{$.!!^{rm d}$}}
    deffarcm{hbox{$.mkern-4mu^prime$}}
    deffp{hbox{$.!!^{scriptscriptstylerm p}$}}

    usepackage{euro}
    newcommand*fracdegs[1]{{%
    EUROFORMAT{main}{in}%
    EUROFORMAT{in}{val}%
    EUROFORMAT{EUR}{form{,}{,fdg}{}round{-10}}%
    EURO{EUR}{#1}}}

    newcommand*degminsecs[3]{{%
    EUROFORMAT{main}{in}%
    EUROFORMAT{in}{val}%
    EUROFORMAT{EUR}{form{,}{,farcs}{}round{-10}}%
    ensuremath{%
    degr{#1},arcmin{#2},EURO{EUR}{#3}}}}

    newcommand*hms[3]{{%
    EUROFORMAT{main}{in}%
    EUROFORMAT{in}{val}%
    EUROFORMAT{EUR}{form{,}{,fsec}{}round{-10}}%
    ensuremath{%
    phour{#1},pmin{#2},EURO{EUR}{#3}}}}

    begin{document}
    fracdegs{23.456789}

    degminsecs{23}{45}{8.56789}

    hms{23}{45}{8.56789}

    end{document}

Leave a Reply