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.
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:
\newunit\Tbps{Tbp/s} …
Leo
leo
28 Nov 09 at 7:53 pm
Sorry it should be Tb/s Gb/s and so
\newunit\Tbps{Tb/s}
\newunit\Gbps{Gb/s}
leo
28 Nov 09 at 7:56 pm
sorry. It should be Tb/s and Gb/s and the definition should be
\newunit\Tbps{Tb/s} and \newunit\Gbps{Gb/s}
leo
28 Nov 09 at 7:57 pm
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 \milli\metre. I do need to check these things work, however!
Joseph
Joseph Wright
29 Nov 09 at 10:14 am
BTW, it would be \newunit\Tbps{\tera\byte\per\second}, I hope!
Joseph Wright
29 Nov 09 at 4:52 pm
\newunit\Tbps{\tera\bit\per\second}
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:
\newunit\Tb{\tera\bit}
\newunit\Tb{Tb}
leo
29 Nov 09 at 9:00 pm
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
Joseph Wright
29 Nov 09 at 9:18 pm
Thanks for that.
leo
30 Nov 09 at 12:09 am
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}
\newcommand\degr[1]{\hbox{$#1^\circ$}}
\newcommand\arcmin[1]{\hbox{$#1^\prime$}}
\def\farcs{\hbox{$.\!\!^{\prime\prime}$}}
\def\fdg{\hbox{$.\!\!^\circ$}}
\newcommand\phour[1]{\hbox{$#1^{\rm h}$}}
\newcommand\pmin[1]{\hbox{$#1^{\rm m}$}}
\def\fsec{\hbox{.\!\!^{\rm s}$}}
\def\arcsec{\hbox{$^{\prime\prime}$}}
\def\utw{\smash{\rlap{\lower5pt\hbox{$\sim$}}}}
\def\udtw{\smash{\rlap{\lower6pt\hbox{$\approx$}}}}
\def\fd{\hbox{$.\!\!^{\rm d}$}}
\def\farcm{\hbox{$.\mkern-4mu^\prime$}}
\def\fp{\hbox{$.\!\!^{\scriptscriptstyle\rm 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}
e.spin
20 Feb 10 at 2:15 pm