% wtk_cmmds.sty, assorted macros useful to W. Trevor King (mostly for physics)
%
-% Copyright (C) 2009-2010 W. Trevor King <wking@drexel.edu>
+% Copyright (C) 2009-2012 W. Trevor King <wking@tremily.us>
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{wtk_cmmds}[2010/10/14 0.2 wtk_cmmds]
+\ProvidesPackage{wtk_cmmds}[2012/04/11 0.3 wtk_cmmds]
\RequirePackage{relsize} % for \smaller
\RequirePackage{amsmath} % for \text{}
\newtheorem{lem}{Lemma}
% define a few physics shortcuts
-\newcommand{\U}[1]{\text{ #1}} % units shortcut
+\newcommand{\U}[1]{\textnormal{\ \bareU{#1}}} % units shortcut
+\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
+\newcommand{\celsius}{\dg\text{C}} % degrees Celsius
+\newcommand{\farenheit}{\dg\text{F}} % degrees Farenheit
\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}} % make vectors bold
\newcommand{\Ohm}{\ensuremath{\Omega}} % units of resistance
% #1th order partial derivative of #3 with respect to #2
\newcommand{\npderiv}[3]{\ensuremath{\frac{\partial^{#1}{#3}}{\partial{#2}^{#1}}}}
+% floor operator, for example \floor(2.7) = 2.
+\newcommand{\floor}{\operatorname{floor}}
+
% parenthesis, for example (some stuff] would be \p({some stuff}]
\newcommand{\p}[3]{\left#1 #2 \right#3}