Tagesarchiv: Juni 28, 2012

Latex and SI-Units

Everybody knows the Problem: You are writing a formula, calculate something and then you end up with numbers – and some weird units. What to do? Until now, I always started something like
\frac{\mathrm{kg}*\mathrm{m}}{\mathrm{s}^2}. Thanks a lot! But today, I stumpled over the siunitx package. This makes it easier for you to attach units to numbers – both in text- and mathmode. The above SI-Unit would look like this:
Or, if you prefer it shorter:
You can even define your own units in the preamble:
Now I can write, that
The Monty Pythons' famous 16 Tons weight will smash you to the ground with a force of approx. \SI{156960.0}{\koeartsforce} - assumed you are standing on the surface of planet earth..

(Sorry Newton, I know this unit was actually dedicated to you!).

So, if you like doing things right go and check it out! You can find (german) introductory slides by suedraum.de at http://www.suedraum.de/latex/stammtisch/werte_und_einheiten_siunitx_2.pdf (they have other cool LaTeX stuff, check it out!), siunitx on ctan.org and – last but not least, on your local system:
texdoc siunitx.

If you have a tip on how to enable auto-discovery of SI-Units – I would be thankful for that as well!


Hinterlasse einen Kommentar

Eingeordnet unter diverses, news