23

I am just working on a document (a series of exercises for one of my classes), which uses both the SI and US customary unit systems (different exercises use different systems). I am trying to typeset the units in a consistent way. I am using the excellent siunitx package, and add the US units manually, however, it feels sort of strange to write things like \DeclareSIUnit\inch{in}. Does anybody have any good way of handling a situation like this?

(I could just use ConTeXt, but I want to take advantage of the beamer class.)

3
  • 6
    If you're uncomfortable with the command names, why not \let\DeclareUSUnit\DeclareSIUnit and \let\US\SI and then you can declare and typset the US units with those commands. We can call this the therapeutic solution. :-)
    – Alan Munn
    Jan 24, 2012 at 3:46
  • @AlanMunn: I like that! :) Jan 24, 2012 at 3:51
  • Ok, I'll add it as an actual answer.
    – Alan Munn
    Jan 24, 2012 at 3:53

1 Answer 1

22

Since the only real problem with the siunitx solution is the clash of names, it's simple enough to just create duplicate versions of the siunitx commands so that the semantics match the content:

\documentclass{article}
\usepackage{siunitx}
\let\DeclareUSUnit\DeclareSIUnit
\let\US\SI
\DeclareUSUnit\inch{in}
\begin{document}

\US{1}{\inch} is \SI{2.54}{\cm}
\end{document}
4
  • 1
    OK, I have done that, and I feel much better now! Thank you. Jan 24, 2012 at 4:02
  • 2
    It's called \DeclareSIUnit because \DeclareUnit is too generic (biblatex also uses 'units'), not to put people off creating non-standard units :-)
    – Joseph Wright
    Jul 18, 2012 at 20:53
  • 2
    But I still have to declare every English unit I want to use. Is there no package with the US system?
    – Jeff
    Nov 9, 2015 at 1:54
  • 2
    @Jeff - The package is called siunitx for a reason...
    – Mico
    Nov 13, 2017 at 6:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .