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.)

Jan Hlavacek
  • 19,242

1 Answers1

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}
Alan Munn
  • 218,180