% 
% This is the file 'me-tools.sty', copyright 1998 Richard Kaszeta
%
% Report errors to kaszeta@me.umn.edu
%
% This package provides a few useful macros for typesetting mechanical
% engineering related documents in latex2e, such as better fraction
% handling macros, handling of units, and nondimensional constants
% used in both text and math.
%
% Important:
% If you modify this file for personal use, you are *not* allowed to
% redistribute it unless you do all of the following (unless you
% obtain written permission from myself):
%
% 1. You must rename the file before you make any changes to it.
% 2. You must leave the copyright above intact.
% 3. You must change the error report address above so I don't get
%    email about files not maintained by me.
% 4. You must either distribute this original file with the changed
%    version or provide a .diff file
%
% Distribution of modified copies of this file without meeting these
% requirements is a violation of US Copyright Code.
%
% Otherwise, feel free to distribute unchanged copies of this file.
%
% What this package does:
%   Provides various macros for nondimensional numbers such as the
%     Reynolds, Peclet, Stanton, Prandtl, and Nusselt Numbers.
%   Provides generalized macros for total, regular, and partial
%     derivatives, raised to arbitrary powers.
%
% Recent Changes:
%   Removed unit handling macros, as the new 'units' package handles
%    this better, but unfortunately has a different syntax.  The
%    units macros are split off into a separate package, me-units (v1.0)
%   Formatting of the unit and nondim labels can be set with the
%    \unitstyle and \nondimstyle macros, respectively. (v0.9)
%   Provided a general macro for adding new nondimensional numbers,
%     and used this macro to define the existing ones (v0.9)
%   Removed ``extended'' macros for Nondimensional Numbers, as they
%     are often incorrect for specific cases and seldom used. (v0.9)
%   Added \degrees back in, but with \providecommand so it doesn't
%     interfere with other packages which may set it (v0.9)
%   Removed [] notation for Nondimensional numbers, as it interferes
%     with users trying to use the standard _ ^ notation (v0.75)
%   Added \GO, \SC, and \SH macros (v0.6)
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{me-tools}
              [1998/07/10 ME Tools Package v1.0]
% Initial Code
% Declaration of Options
% Execution of Options
\ProcessOptions
% Package and Class Loading
\RequirePackage{xspace}   % for conditional spaces
% Main Code

% Predefine \nondimstyle
\newcommand{\nondimstyle}{\mathit}

% Define a general macro for making non-dimensional numbers
\newcommand{\newnondim}[2]{\def#1{\ensuremath{\nondimstyle{#2}}\xspace}}

% Non-dimensional constants
\newnondim{\RE}{Re}
\newnondim{\PR}{Pr}
\newnondim{\NU}{Nu}
\newnondim{\ST}{St}
\newnondim{\FO}{Fo}
\newnondim{\BI}{Bi}
\newnondim{\EC}{Ec}
\newnondim{\GR}{Gr}
\newnondim{\RA}{Ra}
\newnondim{\WE}{We}
\newnondim{\PE}{Pe}
\newnondim{\GO}{G\!\ddot{o}}
\newnondim{\SC}{Sc}
\newnondim{\SH}{Sh}

% Degrees units.  \provided since other packages may have defined them
\providecommand{\degreesC}{\ensuremath{^\circ\mathrm{C}}\xspace}
\providecommand{\degreesF}{\ensuremath{^\circ\mathrm{F}}\xspace}
\providecommand{\degreesR}{\ensuremath{^\circ\mathrm{R}}\xspace}
\providecommand{\degrees}{\ensuremath{^\circ}\xspace}

% Extended fraction operators
%
% \abs{} for absolute value bars
% \absfrac{}{} for a fraction with absolute value bars
% \ddfrac{}{} for differential fractions
% \ppfrac{}{} for partial differentials

\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\absfrac}[2]{\left|\frac{#1}{#2}\right|}
\newcommand{\ddfrac}[3][]{\frac{d^{#1}#2}{d{#3}^{#1}}}
\newcommand{\DDfrac}[3][]{\frac{D^{#1}#2}{D{#3}^{#1}}}
\newcommand{\ppfrac}[3][]{\frac{\partial^{#1}#2}{\partial{#3}^{#1}}}
