summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mattens
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-09-24 17:10:33 +0000
committerNorbert Preining <preining@logic.at>2009-09-24 17:10:33 +0000
commit6b3e4f3f58c3a0728870967c9372697025a4478e (patch)
tree6170501be47579706e89b00bb441176c0ea4b6f4 /Master/texmf-dist/tex/latex/mattens
parentb9860d220e7bce989933e1d38ba086a3b90f0a4f (diff)
add mattens package
git-svn-id: svn://tug.org/texlive/trunk@15445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mattens')
-rw-r--r--Master/texmf-dist/tex/latex/mattens/mattens.sty267
1 files changed, 267 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mattens/mattens.sty b/Master/texmf-dist/tex/latex/mattens/mattens.sty
new file mode 100644
index 00000000000..1086b580627
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/mattens/mattens.sty
@@ -0,0 +1,267 @@
+%%
+%% This is file `mattens.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mattens.dtx (with options: `package')
+%%
+%% The mattens package
+%% Copyright (C) 2001--2004 by Danie Els <dnjels@sun.ac.za>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX
+%% version 1999/12/01 or later.
+%%
+%% \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}[2004/01/28 v1.2 Matrix/Tensors (DNJ Els)]
+\newcommand*{\MT@SymbStrt}{}
+\newcommand*{\SetSymbStrut}[1]{\renewcommand*{\MT@SymbStrt}{#1}}
+\SetSymbStrut{\relax}
+\DeclareOption{mathstrut}{\SetSymbStrut{\mathstrut}}
+\newcommand*{\MT@SymbFnt}{}
+\newcommand*{\SetSymbFont}[1]{\renewcommand*{\MT@SymbFnt}{#1}}
+\SetSymbFont{\boldsymbol}
+\DeclareOption{noformat}{\SetSymbFont{\relax}}
+\DeclareOption*{%
+ \PackageWarning{mattens}{Unknown option ‘\CurrentOption’}}
+\ProcessOptions\relax
+\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}}}
+\AtBeginDocument{%
+ \@ifl@aded{def}{pdftex}%
+ {\newcommand*{\xusebox}[1]{\mathord{{\usebox{#1}}}}}%
+ {\let\xusebox\usebox}%
+}
+\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}
+\newmuskip\MT@SubSkip
+\newmuskip\MT@SupSkip
+\newcommand*{\MT@accent}{}
+\newcommand*{\MT@cmd}{}
+\newcommand*{\MT@@cmd}{}
+\newcommand*{\MT@bold}{}
+\DeclareRobustCommand*{\aS}{%
+ \let\MT@cmd=\MT@OverAandB%
+ \let\MT@@cmd=\MT@Overarrow%
+ \MT@SupSkip=\MT@Askip%
+ \MT@SubSkip=\MT@SBskip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\bS}{%
+ \let\MT@cmd=\MT@OverAandB%
+ \let\MT@@cmd=\MT@Overline%
+ \MT@SupSkip=\MT@Bskip%
+ \MT@SubSkip=\MT@SBskip%
+ \MT@Tensor}%
+\DeclareRobustCommand*{\Sa}{%
+ \let\MT@cmd=\MT@UnderAandB%
+ \let\MT@@cmd=\MT@Underarrow%
+ \MT@SupSkip=\MT@SPskip%
+ \MT@SubSkip=\MT@Askip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\Sb}{%
+ \let\MT@cmd=\MT@UnderAandB%
+ \let\MT@@cmd=\MT@Underline%
+ \MT@SupSkip=\MT@SPskip%
+ \MT@SubSkip=\MT@Bskip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\bSb}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@bSb%
+ \MT@SupSkip=\MT@Bskip%
+ \MT@SubSkip=\MT@Bskip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\aSb}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@aSb%
+ \MT@SupSkip=\MT@Askip%
+ \MT@SubSkip=\MT@Bskip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\bSa}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@bSa%
+ \MT@SupSkip=\MT@Bskip%
+ \MT@SubSkip=\MT@Askip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\aSa}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@aSa%
+ \MT@SupSkip=\MT@Askip%
+ \MT@SubSkip=\MT@Askip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\bCSb}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@bCSb%
+ \MT@SupSkip=\MT@Bskip%
+ \MT@SubSkip=\MT@Bskip%
+ \MT@Tensor}
+\DeclareRobustCommand*{\aCSa}{%
+ \let\MT@cmd=\MT@DoubleAandB%
+ \let\MT@@cmd=\MT@@aCSa%
+ \MT@SupSkip=\MT@Askip%
+ \MT@SubSkip=\MT@Askip%
+ \MT@Tensor}
+\newcommand*{\MT@Tensor}{%
+ \@ifstar{\let\MT@bold=\@firstofone\MT@@Tensor}
+ {\let\MT@bold=\MT@SymbFnt\MT@@Tensor}}
+\newcommand*{\MT@@Tensor}[2][\@firstofone]{%
+ \let\MT@accent=#1\relax%
+ \MT@GetScripts{#2}}
+\newcommand*\MT@GetScripts[1]{%
+ \@ifnextchar'%
+ {\MT@GetPrimes{#1}{\prime}}%
+ {\MT@UnprimedScripts{#1}}}
+\newcommand*\MT@GetPrimes[3]{%
+ \@ifnextchar'%
+ {\MT@GetPrimes{#1}{#2\prime}}%
+ {\@ifnextchar^%
+ {\MT@GetPrimedSuper{#1}{#2}}%
+ {\@ifnextchar_%
+ {\MT@GetPrimedSub{#1}{#2}}%
+ {\MT@SetScripts{#1}{#2}{\@empty}}%
+ }%
+ }%
+ }
+\def\MT@GetPrimedSuper#1#2^#3{%
+ \@ifnextchar_{\MT@GetPrimedSub{#1}{#2#3}}%
+ {\MT@SetScripts{#1}{#2#3}{\@empty}}}
+\def\MT@GetPrimedSub#1#2_#3{%
+ \MT@SetScripts{#1}{#2}{#3}}
+\newcommand*\MT@UnprimedScripts[1]{%
+ \@ifnextchar^%
+ {\MT@GetSuper{#1}}%
+ {\@ifnextchar_%
+ {\MT@GetSub{#1}}%
+ {\MT@SetScripts{#1}{\@empty}{\@empty}}%
+ }%
+ }
+\def\MT@GetSuper#1^#2{%
+ \@ifnextchar_{\MT@GetSuperSub{#1}{#2}}%
+ {\MT@SetScripts{#1}{#2}{\@empty}}}
+\def\MT@GetSub#1_#2{%
+ \@ifnextchar^{\MT@GetSubSuper{#1}{#2}}%
+ {\MT@SetScripts{#1}{\@empty}{#2}}}
+\def\MT@GetSuperSub#1#2_#3{%
+ \MT@SetScripts{#1}{#2}{#3}}
+\def\MT@GetSubSuper#1#2^#3{%
+ \MT@SetScripts{#1}{#3}{#2}}
+\newcommand*{\MT@SetSup}{}
+\newcommand*{\MT@SetSub}{}
+\newcommand*{\MT@SetSubS}{}
+\newcommand*\MT@SetScripts[3]{%
+ \let\MT@SetSup\relax%
+ \let\MT@SetSub\relax%
+ \let\MT@SetSubS\relax%
+ \ifx\@empty#2\@empty\else
+ \def\MT@SetSup{^{\mskip\MT@SupSkip\relax#2}}%
+ \fi
+ \ifx\@empty#3\@empty\else
+ \def\MT@SetSub{_{\mskip\MT@SubSkip\relax#3}}%
+ \def\MT@SetSubS{^{}_{\mskip\MT@SubSkip\relax#3}}%
+ \fi
+ \ensuremath{\MT@cmd{#1}}}
+\newcommand*{\MT@Symb}[1]{\MT@SymbStrt\MT@bold#1}
+\newcommand*{\MT@SymbC}[1]{%
+ \MT@SymbStrt\widetilde{%
+ \MT@bold#1}}
+\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\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\relax\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{\usebox\MT@Abox}{\usebox\MT@Sbox}%
+ \else%
+ \leavevmode\rlap{\usebox\MT@Sbox}{\usebox\MT@Abox}%
+ \fi}
+\newcommand*{\MT@UnderAandB}{%
+ \mathpalette\MT@@UnderAandB}
+\newcommand*{\MT@@UnderAandB}[2]{%
+ \sbox{\MT@Tbox}{$\m@th#1\MT@accent{\MT@Symb{#2}}$}%
+ \setbox\MT@SPbox\null%
+ \wd\MT@SPbox\wd\MT@Tbox%
+ \sbox{\MT@Tbox}{$\m@th#1\MT@Symb{#2}$}%
+ \ht\MT@SPbox\ht\MT@Tbox%
+ \dp\MT@SPbox\dp\MT@Tbox%
+ \sbox{\MT@APbox}{$\m@th\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\relax\MT@accent{\MT@Symb{#2}}\MT@SetSup$}%
+ \sbox{\MT@Abox}{$\m@th#1\xusebox{\MT@APbox}\MT@SetSub$}%
+ \ifdim\wd\MT@Abox<\wd\MT@Sbox%
+ \leavevmode\rlap{\usebox\MT@Abox}{\usebox\MT@Sbox}%
+ \else%
+ \leavevmode\rlap{\usebox\MT@Sbox}{\usebox\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}
+\endinput
+%%
+%% End of file `mattens.sty'.