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.

I'm having a hard time figuring out the LaTeX commands to define new units of year and century in siunitx.

I'd like to write \SI{3}{\cm\per\year} and have it show: 3 cm yr-1, or \SI{42}{\micro\meter\per\century} become 4.2E-5 m/century

share|improve this question
    
You can just write \SI{3}{\cm\per yr}, pehaps you could add a little more detail to your question? –  Seamus Nov 26 '10 at 21:58
1  
I should point out that you won't get the second of your two examples to work. siunitx can convert prefixes into powers, but does not then attempt to update the number to account for this. I guess I can add this as a feature request for v2.2. –  Joseph Wright Nov 26 '10 at 22:18

1 Answer 1

up vote 11 down vote accepted

In your preamble

\DeclareSIUnit\century{century}
\DeclareSIUnit\year{yr}

See the siunitx manual (v2.1 series), Section 4.5, page 12.

share|improve this answer
    
I have added \DeclareSIUnit\annum{a}, but it does not seem to have any effect. How to I find out what version I'm using? –  mankoff Dec 1 '10 at 17:49
    
Add \listfiles to your source and look in the log. I'd be interested to see an example of this: perhaps you can post one here. –  Joseph Wright Dec 1 '10 at 18:01
    
OK, I'm using v1.0i (2008/08/14), probably because my LaTeX is via OS X fink install texlive which is v 2008. I presume an example is no longer necessary. –  mankoff Dec 1 '10 at 18:24
    
Okay, in that case you want \newunit\annum{a}. (I'd also note that it is generally recommended to use MacTeX or vanilla TeX Live on OS X, rather than using one of the ports, as you get a much more up to date system.) –  Joseph Wright Dec 1 '10 at 19:12

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.