%%
%% This is file `mattens.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mattens.dtx  (with options: `package')
%% 
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mattens}[2001/12/09 v1.0 DNJ Els]
\RequirePackage{amsmath}
\newcommand{\MT@Overarrow}[2]{\overarrow@{\rightarrowfill@}{#1}{#2}}
\newcommand{\MT@Underarrow}[2]{\underarrow@{\rightarrowfill@}{#1}{#2}}
\newcommand{\MT@Overline}[2]{{#1\overline{#2}}}
\newcommand{\MT@Underline}[2]{{#1\underline{#2}}}
\newcommand{\xusebox}[1]{%
  \setbox\z@\null%
  \ht\z@\ht#1%
  \dp\z@\dp#1%
  \begingroup%
     \usebox{#1}%
  \endgroup%
  \box\z@}
\newcommand*{\MT@SymbStrt}{}
\newcommand*{\SetSymbStrut}[1]{\renewcommand*{\MT@SymbStrt}{#1}}
\SetSymbStrut{\relax}
\DeclareOption{mathstrut}{\SetSymbStrut{\mathstrut}}
\newcommand*{\MT@SymbFnt}{\relax}
\newcommand*{\SetSymbFont}[1]{\renewcommand*{\MT@SymbFnt}{#1}}
\SetSymbFont{\boldsymbol}
\DeclareOption{noformat}{\SetSymbFont{\relax}}
\DeclareOption*{%
    \PackageWarning{mattens}{Unknown option ‘\CurrentOption’}}
\ProcessOptions\relax
\newmuskip{\MT@Askip}
\newmuskip{\MT@Bskip}
\newmuskip{\MT@SPskip}
\newmuskip{\MT@SBskip}
\newcommand*{\SetArrowSkip}[1]{\MT@Askip#1}
\newcommand*{\SetBarSkip}[1]{\MT@Bskip#1}
\newcommand*{\SetSymSuPSkip}[1]{\MT@SPskip#1}
\newcommand*{\SetSymSuBSkip}[1]{\MT@SBskip#1}
\SetArrowSkip{0mu}
\SetBarSkip{1mu}
\SetSymSuBSkip{0mu}
\SetSymSuPSkip{0mu}
\newcommand*{\MT@accent}{}
\newcommand*{\MT@cmd}{}
\newcommand*{\MT@@cmd}{}
\newmuskip\MT@SuBskip
\newmuskip\MT@SuPskip
\newif\ifMT@bold
\MT@boldfalse
\DeclareRobustCommand*{\aS}{%
   \@ifstar{\MT@boldfalse\@aS}{\MT@boldtrue\@aS}}
\newcommand*{\@aS}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@OverAandB%
   \let\MT@@cmd=\MT@Overarrow%
   \MT@SuPskip=\MT@Askip%
   \MT@SuBskip=\MT@SBskip%
   \MT@GetScrpts{#2}}%
\DeclareRobustCommand*{\bS}{%
   \@ifstar{\MT@boldfalse\@bS}{\MT@boldtrue\@bS}}
\newcommand*{\@bS}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@OverAandB%
   \let\MT@@cmd=\MT@Overline%
   \MT@SuPskip=\MT@Bskip%
   \MT@SuBskip=\MT@SBskip%
   \MT@GetScrpts{#2}}%
\DeclareRobustCommand*{\Sa}{%
   \@ifstar{\MT@boldfalse\@Sa}{\MT@boldtrue\@Sa}}
\newcommand*{\@Sa}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@UnderAandB%
   \let\MT@@cmd=\MT@Underarrow%
   \MT@SuPskip=\MT@SPskip%
   \MT@SuBskip=\MT@Askip%
   \MT@GetScrpts{#2}}%
\DeclareRobustCommand*{\Sb}{%
   \@ifstar{\MT@boldfalse\@Sb}{\MT@boldtrue\@Sb}}
\newcommand*{\@Sb}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@UnderAandB%
   \let\MT@@cmd=\MT@Underline%
   \MT@SuPskip=\MT@SPskip%
   \MT@SuBskip=\MT@Bskip%
   \MT@GetScrpts{#2}}%
\DeclareRobustCommand*{\bSb}{%
   \@ifstar{\MT@boldfalse\@bSb}{\MT@boldtrue\@bSb}}
\newcommand*{\@bSb}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@bSb%
   \MT@SuPskip=\MT@Bskip%
   \MT@SuBskip=\MT@Bskip%
   \MT@GetScrpts{#2}}
\DeclareRobustCommand*{\aSb}{%
   \@ifstar{\MT@boldfalse\@aSb}{\MT@boldtrue\@aSb}}
\newcommand*{\@aSb}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@aSb%
   \MT@SuPskip=\MT@Askip%
   \MT@SuBskip=\MT@Bskip%
   \MT@GetScrpts{#2}}
\DeclareRobustCommand*{\bSa}{%
   \@ifstar{\MT@boldfalse\@bSa}{\MT@boldtrue\@bSa}}
\newcommand*{\@bSa}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@bSa%
   \MT@SuPskip=\MT@Bskip%
   \MT@SuBskip=\MT@Askip%
   \MT@GetScrpts{#2}}
\DeclareRobustCommand*{\aSa}{%
   \@ifstar{\MT@boldfalse\@aSa}{\MT@boldtrue\@aSa}}
\newcommand*{\@aSa}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@aSa%
   \MT@SuPskip=\MT@Askip%
   \MT@SuBskip=\MT@Askip%
   \MT@GetScrpts{#2}}
\DeclareRobustCommand*{\bCSb}{%
   \@ifstar{\MT@boldfalse\@bCSb}{\MT@boldtrue\@bCSb}}
\newcommand*{\@bCSb}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@bCSb%
   \MT@SuPskip=\MT@Bskip%
   \MT@SuBskip=\MT@Bskip%
   \MT@GetScrpts{#2}}
\DeclareRobustCommand*{\aCSa}{%
   \@ifstar{\MT@boldfalse\@aCSa}{\MT@boldtrue\@aCSa}}
\newcommand*{\@aCSa}[2][\@empty]{%
   \let\MT@accent=#1%
   \let\MT@cmd=\MT@DoubleAandB%
   \let\MT@@cmd=\MT@@aCSa%
   \MT@SuPskip=\MT@Askip%
   \MT@SuBskip=\MT@Askip%
   \MT@GetScrpts{#2}}
\newif\ifMT@@suB
\newif\ifMT@@suP
\newcommand*{\MT@suB}{}
\newcommand*{\MT@suP}{}
\newcommand*{\MT@GetScrpts}[1]{%
    \@ifnextchar^%
        {\MT@GetsuP{#1}}%
        {\@ifnextchar_%
            {\MT@GetsuB{#1}}%
            {\MT@@suBfalse%
             \MT@@suPfalse%
             \ensuremath{\MT@cmd{#1}}}}}
\def\MT@GetsuP#1^#2{%
    \@ifnextchar_%
        {\MT@GetsuPsuB{#1}{#2}}%
        {\MT@@suBfalse%
         \MT@@suPtrue%
         \renewcommand*{\MT@suP}{#2}%
         \ensuremath{\MT@cmd{#1}}}}
\def\MT@GetsuB#1_#2{%
    \@ifnextchar^%
        {\MT@GetsuBsuP{#1}{#2}}%
        {\MT@@suBtrue%
         \MT@@suPfalse%
         \renewcommand*{\MT@suB}{#2}%
         \ensuremath{\MT@cmd{#1}}}}
\def\MT@GetsuPsuB#1#2_#3{%
    \MT@@suBtrue%
    \MT@@suPtrue%
    \renewcommand*{\MT@suB}{#3}%
    \renewcommand*{\MT@suP}{#2}%
    \ensuremath{\MT@cmd{#1}}}
\def\MT@GetsuBsuP#1#2^#3{%
    \MT@@suBtrue%
    \MT@@suPtrue%
    \renewcommand*{\MT@suB}{#2}%
    \renewcommand*{\MT@suP}{#3}%
    \ensuremath{\MT@cmd{#1}}}
\newcommand*{\MT@setsuB}{%
    \ifMT@@suB
        _{\mskip\MT@SuBskip\relax\MT@suB}%
    \fi}
\newcommand*{\MT@setsuBS}{%
    \ifMT@@suB
        ^{}_{\mskip\MT@SuBskip\relax\MT@suB}%
    \fi}
\newcommand*{\MT@setsuP}{%
   \ifMT@@suP
       ^{\mskip\MT@SuPskip\relax\MT@suP}%
   \fi}
\newcommand*{\MT@Symb}[1]{%
   \MT@SymbStrt%
   \ifMT@bold\MT@SymbFnt#1\else#1\fi}
\newcommand*{\MT@SymbC}[1]{%
   \MT@SymbStrt\widetilde{%
   \ifMT@bold\MT@SymbFnt#1\else#1\fi}}
\newsavebox{\MT@Abox}   % for overline/arrow
\newsavebox{\MT@Sbox}   % for symbol
\newsavebox{\MT@Tbox}   % for tempories
\newsavebox{\MT@APbox}  % for overline/arrow phantom
\newsavebox{\MT@SPbox}  % for symbol phantom
\newlength{\MT@SPwdth}  % symbol width
\newlength{\MT@BPwdth}  % Bar width
\newlength{\MT@Wwdth}   % leading whitespace width
\newcommand*{\MT@OverAandB}{%
   \mathpalette\MT@@OverAandB}
\newcommand*{\MT@@OverAandB}[2]{%
      \sbox{\MT@Tbox}{$\m@th#1\MT@Symb{#2}$}%
      \setbox\MT@SPbox\null%
      \ht\MT@SPbox\ht\MT@Tbox%
      \dp\MT@SPbox\dp\MT@Tbox%
      \wd\MT@SPbox\wd\MT@Tbox%
      \sbox{\MT@APbox}{$\m@th#1\MT@@cmd{#1}{\copy\MT@SPbox}$}%
      \setlength{\MT@Wwdth}{\the\wd\MT@APbox}%
      \addtolength{\MT@Wwdth}{-\the\wd\MT@SPbox}%
      \sbox{\MT@Sbox}{$\m@th#1\hskip 0.5\MT@Wwdth\MT@Symb{#2}\MT@setsuBS$}%
      \sbox{\MT@Tbox}{$\m@th#1\MT@accent{\xusebox{\MT@APbox}}$}%
      \ht\MT@Tbox\ht\MT@APbox%
      \dp\MT@Tbox\dp\MT@APbox%
      \sbox{\MT@Abox}{$\m@th#1\xusebox{\MT@Tbox}\MT@setsuP$}%
      \ifdim\wd\MT@Abox<\wd\MT@Sbox%
          \leavevmode\rlap{\xusebox\MT@Abox}{\xusebox\MT@Sbox}%
      \else%
           \leavevmode\rlap{\xusebox\MT@Sbox}{\xusebox\MT@Abox}%
      \fi}
\newcommand*{\MT@UnderAandB}{%
   \mathpalette\MT@@UnderAandB}
\newcommand*{\MT@@UnderAandB}[2]{%
      \sbox{\MT@Tbox}{$\m@th#1\MT@Symb{#2}$}%
      \setbox\MT@SPbox\null%
      \ht\MT@SPbox\ht\MT@Tbox%
      \dp\MT@SPbox\dp\MT@Tbox%
      \wd\MT@SPbox\wd\MT@Tbox%
      \sbox{\MT@APbox}{$\m@th#1\MT@@cmd{#1}{\copy\MT@SPbox}$}%
      \setlength{\MT@Wwdth}{\the\wd\MT@APbox}%
      \addtolength{\MT@Wwdth}{-\the\wd\MT@SPbox}%
      \sbox{\MT@Sbox}{$\m@th#1\hskip 0.5\MT@Wwdth\MT@Symb{#2}\MT@setsuP$}%
      \sbox{\MT@Tbox}{$\m@th#1\MT@accent{\xusebox{\MT@APbox}}$}%
      \ht\MT@Tbox\ht\MT@APbox%
      \dp\MT@Tbox\dp\MT@APbox%
      \sbox{\MT@Abox}{$\m@th#1\xusebox{\MT@Tbox}\MT@setsuB$}%
      \ifdim\wd\MT@Abox<\wd\MT@Sbox%
         \leavevmode\rlap{\xusebox\MT@Abox}{\xusebox\MT@Sbox}%
      \else%
         \leavevmode\rlap{\xusebox\MT@Sbox}{\xusebox\MT@Abox}%
      \fi}
\newcommand*{\MT@@bSb}[2]{\MT@Overline{#1}{\MT@Underline{#1}{\MT@Symb{#2}}}}
\newcommand*{\MT@@aSb}[2]{\MT@Overarrow{#1}{\MT@Underline{#1}{\MT@Symb{#2}}}}
\newcommand*{\MT@@bSa}[2]{\MT@Overline{#1}{\MT@Underarrow{#1}{\MT@Symb{#2}}}}
\newcommand*{\MT@@aSa}[2]{\MT@Overarrow{#1}{\MT@Underarrow{#1}{\MT@Symb{#2}}}}
\newcommand*{\MT@@bCSb}[2]{\MT@Overline{#1}{\MT@Underline{#1}{\MT@SymbC{#2}}}}
\newcommand*{\MT@@aCSa}[2]{\MT@Overarrow{#1}{\MT@Underarrow{#1}{\MT@SymbC{#2}}}}
\newcommand*{\MT@DoubleAandB}{%
  \mathpalette\MT@@DoubleAandB}
\newcommand*{\MT@@DoubleAandB}[2]{%
      \sbox{\MT@Abox}{$\m@th#1\MT@@cmd{#1}{#2}$}%
      \sbox{\MT@Tbox}{$\m@th#1\MT@accent{\xusebox{\MT@Abox}}$}%
      \ht\MT@Tbox\ht\MT@Abox%
      \dp\MT@Tbox\dp\MT@Abox%
      \xusebox{\MT@Tbox}\MT@setsuP\MT@setsuB}
\newcommand*{\MT@cname}{}    % ->  <cmd>
\newcommand*{\MT@bname}{}    % ->  MTbox@<cmd>
\newcommand*{\MT@bnameuse}{} % ->  \MTbox@<cmd>
\newcommand{\DeclareSBox}[2]{%
     \edef\MT@cname{\expandafter\@gobble\string#1}%
     \edef\MT@bname{MTbox@\MT@cname}%
     \@ifundefined{\MT@cname}{%
          \edef\MT@bnameuse{\csname\MT@bname\endcsname}%
          \expandafter\newbox\MT@bnameuse%
          \global\sbox{\MT@bnameuse}{#2}%
          \protected@xdef#1{\protect\xusebox{\MT@bnameuse}}%
          }%
          {\PackageError{mattens}%
               {Command \space\protect#1\space allready\space defined!}%
               {Use\space a\space different\space name}}}
\newcommand*{\tdot}{\ensuremath{{\cdot}}}                % Center dot
\newcommand*{\trnsp}{\ensuremath{\mathsf{T}}}            % Matrix transpose
\providecommand*{\norm}[1]{\ensuremath{\lVert{#1}\rVert}}% Norm delimiters
\newcommand*{\SB}[1]{\ensuremath{\left[\, #1\right]}}    % Square brackets
\endinput
%%
%% End of file `mattens.sty'.
