From f4e35cdc3ed4180acadc8d9e10c8229e61c11af9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 24 Jun 2012 04:21:34 -0400 Subject: [PATCH] Rename \U to \unit in wtk_cmmds.sty. I ran into a collision while working on my thesis: ! LaTeX Error: Command \U already defined. Or name \end... illegal, see p.192 of the manual. ... ! LaTeX Error: Command \U unavailable in encoding OT1. Debugging with `\show\U`, I got: > \U=macro: ->\PU-cmd \U \PU\U . which seems to be something relating to fonts. The new implementation still defines \U, but only if nobody else has beaten us to the punch. If they have, but you want \U to mean "unit", you can add \renewcommand{\U}[1]{\unit{#1}} after both the colliding package and wtk_cmmds.sty have been imported. This might break the other package, but hopefully they won't be relying on such a collidable name for critical internal functionality. --- wtk_cmmds.sty | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wtk_cmmds.sty b/wtk_cmmds.sty index b249634..70d8f4a 100644 --- a/wtk_cmmds.sty +++ b/wtk_cmmds.sty @@ -36,7 +36,8 @@ \newtheorem{lem}{Lemma} % define a few physics shortcuts -\newcommand{\U}[1]{\textnormal{\ \bareU{#1}}} % units shortcut +\newcommand{\unit}[1]{\textnormal{\ \bareU{#1}}} % units shortcut +\providecommand{\U}[1]{\unit{#1}} \newcommand{\bareU}[1]{\textnormal{#1}} % units without preceding value \newcommand{\E}[1]{\ensuremath{\cdot 10 ^{#1}}} % exponent shortcut \newcommand{\dg}{\ensuremath{^{\circ}}} % degree symbol ^o -- 2.26.2