Change my email address from drexel.edu to tremily.us.
[problempack.git] / wtk_cmmds.sty
index 3b741c1b5cd4eb3b35cf759f492e52d7ccf5e5a8..b249634d22ba3312fb6362e1a9140d0a6c72066c 100644 (file)
@@ -1,7 +1,28 @@
+% wtk_cmmds.sty, assorted macros useful to W. Trevor King (mostly for physics)
+%
+% 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
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License along
+% with this program; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{wtk_cmmds}[2012/04/11 0.3 wtk_cmmds]
+
 \RequirePackage{relsize} % for \smaller
 \RequirePackage{amsmath} % for \text{}
 
-% Author, Copyright junk
+% Author, Copyright stuff
 \newcommand{\copytitle}{
   \begin{center}
     Copyright \copyright\ \today\ by W.\ Trevor King\\
 \newtheorem{cor}[thm]{Corollary}
 \newtheorem{lem}{Lemma}
 
-\newcommand{\U}[1]{\text{ #1}}                 % units shortcut
+% define a few physics shortcuts
+\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
@@ -41,6 +66,9 @@
 % #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}