summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mh/mathtools.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/mh/mathtools.sty')
-rw-r--r--Master/texmf-dist/tex/latex/mh/mathtools.sty130
1 files changed, 119 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty
index 10551be4cd1..3254c896fdc 100644
--- a/Master/texmf-dist/tex/latex/mh/mathtools.sty
+++ b/Master/texmf-dist/tex/latex/mh/mathtools.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2002-2010 by Morten Hoegholm <mh.ctan@gmail.com>
+%% Copyright (C) 2002-2011 by Morten Hoegholm <mh.ctan@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -20,16 +20,17 @@
%%
%% This work has the LPPL maintenance status "maintained".
%%
-%% This Current Maintainer of this work is Morten Hoegholm.
+%% This Current Maintainer of this work is Morten Hoegholm,
+%% Lars Madsen, Will Robertson and Joseph Wright.
%%
%% This work consists of the main source file mathtools.dtx
%% and the derived files
%% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv.
%%
\ProvidesPackage{mathtools}%
- [2010/07/21 v1.08b mathematical typesetting tools (MH)]
+ [2011/02/12 v1.10 mathematical typesetting tools]
\RequirePackage{keyval,calc}
-\RequirePackage{mhsetup}[2007/12/03]
+\RequirePackage{mhsetup}[2010/01/21]
\MHInternalSyntaxOn
\def\MT_options_name:{mathtools}
\newcommand*\mathtoolsset[1]{\setkeys{\MT_options_name:}{#1}}
@@ -347,9 +348,11 @@
\providecommand*\rparen{)}
\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
+\providecommand\ordinarycolon{:}
\begingroup
\catcode`\:=\active
\lowercase{\endgroup
+\def\MT_activate_colon{%
\ifnum\mathcode`\:=32768\relax
\let\ordinarycolon= :%
\else
@@ -357,6 +360,7 @@
\fi
\let :\vcentcolon
}
+}
\MH_new_boolean:n {center_colon}
\define@key{\MT_options_name:}{centercolon}[true]{
\@ifundefined{MT_active_colon_#1:}
@@ -366,6 +370,7 @@
{ \@nameuse{MT_active_colon_#1:} }
}
\def\MT_active_colon_true: {
+ \MT_activate_colon
\MH_if_boolean:nF {center_colon}{
\MH_set_boolean_T:n {center_colon}
\edef\MT_active_colon_false:
@@ -654,13 +659,20 @@
{\MT_start_cases:nnnn {#2}{#3}{#4}{#5}}
{\MH_end_cases:\right#6}
}
-\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.}
-\newcases{dcases*}{\quad}{$\m@th\displaystyle{##}$\hfil}{{##}\hfil}{\lbrace}{.}
-\newcases{rcases}{\quad}{$\m@th{##}$\hfil}{$\m@th{##}$\hfil}{.}{\rbrace}
-\newcases{rcases*}{\quad}{$\m@th{##}$\hfil}{{##}\hfil}{.}{\rbrace}
-\newcases{drcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{.}{\rbrace}
-\newcases{drcases*}{\quad}{$\m@th\displaystyle{##}$\hfil}{{##}\hfil}{.}{\rbrace}
-\newcases{cases*}{\quad}{$\m@th{##}$\hfil}{{##}\hfil}{\lbrace}{.}
+\newcases{dcases}{\quad}{%
+ $\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.}
+\newcases{dcases*}{\quad}{%
+ $\m@th\displaystyle{##}$\hfil}{{##}\hfil}{\lbrace}{.}
+\newcases{rcases}{\quad}{%
+ $\m@th{##}$\hfil}{$\m@th{##}$\hfil}{.}{\rbrace}
+\newcases{rcases*}{\quad}{%
+ $\m@th{##}$\hfil}{{##}\hfil}{.}{\rbrace}
+\newcases{drcases}{\quad}{%
+ $\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{.}{\rbrace}
+\newcases{drcases*}{\quad}{%
+ $\m@th\displaystyle{##}$\hfil}{{##}\hfil}{.}{\rbrace}
+\newcases{cases*}{\quad}{%
+ $\m@th{##}$\hfil}{{##}\hfil}{\lbrace}{.}
\def\MT_matrix_begin:N #1{%
\hskip -\arraycolsep
\MH_let:NwN \@ifnextchar \MH_nospace_ifnextchar:Nnn
@@ -685,6 +697,53 @@
\newenvironment{Vmatrix*}[1][c]
{\left\lVert\MT_matrix_begin:N #1}
{\MT_matrix_end:\right\lVert}
+\def\MT_smallmatrix_begin:N #1{%
+ \Let@\restore@math@cr\default@tag
+ \baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
+ \csname MT_smallmatrix_#1_begin:\endcsname
+}
+\def\MT_smallmatrix_end:{\crcr\egroup\egroup\MT_smallmatrix_inner_space:}
+\def\MT_smallmatrix_l_begin:{\null\MT_smallmatrix_inner_space:\vcenter\bgroup
+ \ialign\bgroup$\m@th\scriptstyle##$\hfil&&\thickspace
+ $\m@th\scriptstyle##$\hfil\crcr
+}
+\def\MT_smallmatrix_c_begin:{\null\MT_smallmatrix_inner_space:\vcenter\bgroup
+ \ialign\bgroup\hfil$\m@th\scriptstyle##$\hfil&&\thickspace\hfil
+ $\m@th\scriptstyle##$\hfil\crcr
+}
+\def\MT_smallmatrix_r_begin:{\null\MT_smallmatrix_inner_space:\vcenter\bgroup
+ \ialign\bgroup\hfil$\m@th\scriptstyle##$&&\thickspace\hfil
+ $\m@th\scriptstyle##$\crcr
+}
+\newenvironment{smallmatrix*}[1][\MT_smallmatrix_default_align:]
+ {\MT_smallmatrix_begin:N #1}
+ {\MT_smallmatrix_end:}
+\def\MT_fenced_sm_generator:nnn #1#2#3{%
+ \@ifundefined{#1}{%
+ \newenvironment{#1}
+ {\mathopen{}\mathclose\bgroup\left#2\MT_smallmatrix_begin:N c}%
+ {\MT_smallmatrix_end:\aftergroup\egroup\right#3}%
+ }{}%
+ \@ifundefined{#1*}{%
+ \newenvironment{#1*}[1][\MT_smallmatrix_default_align:]%
+ {\mathopen{}\mathclose\bgroup\left#2\MT_smallmatrix_begin:N ##1}%
+ {\MT_smallmatrix_end:\aftergroup\egroup\right#3}%
+ }{}%
+}
+\MT_fenced_sm_generator:nnn{psmallmatrix}()
+\MT_fenced_sm_generator:nnn{bsmallmatrix}[]
+\MT_fenced_sm_generator:nnn{Bsmallmatrix}\lbrace\rbrace
+\MT_fenced_sm_generator:nnn{vsmallmatrix}\lvert\rvert
+\MT_fenced_sm_generator:nnn{Vsmallmatrix}\lVert\rVert
+\define@key{\MT_options_name:}
+ {smallmatrix-align}{\def\MT_smallmatrix_default_align:{#1}}
+\define@key{\MT_options_name:}
+ {smallmatrix-inner-space}{\def\MT_smallmatrix_inner_space:{#1}}
+\setkeys{\MT_options_name:}{
+ smallmatrix-align=c,
+ smallmatrix-inner-space=\,
+}
+
\MHPrecedingSpacesOn
\newcommand*\smashoperator[2][lr]{
\def\MT_smop_use:NNNNN {\@nameuse{MT_smop_smash_#1:NNNNN}}
@@ -879,7 +938,56 @@
}%
\if#1 &&\quad #2\else #2\quad\fi
\\\noalign{\nobreak\vskip-\lineskip}}
+
\MHInternalSyntaxOn
+\newcommand\vdotswithin[1]{%
+ {\mathmakebox[\widthof{\ensuremath{{}#1{}}}][c]{{\vdots}}}}
+\newlength\origjot
+\setlength\origjot{\jot}
+\newdimen\l_MT_shortvdotswithinadjustabove_dim
+\newdimen\l_MT_shortvdotswithinadjustbelow_dim
+\define@key{\MT_options_name:}
+ {shortvdotsadjustabove}{\setlength\l_MT_shortvdotswithinadjustabove_dim{#1}}
+\define@key{\MT_options_name:}
+ {shortvdotsadjustbelow}{\setlength\l_MT_shortvdotswithinadjustbelow_dim{#1}}
+\setkeys{\MT_options_name:}{
+ shortvdotsadjustabove=2.15\origjot,
+ shortvdotsadjustbelow=\origjot
+}
+\def\shortvdotswithin{\relax
+ \@ifstar{\MT_svwi_aux:nn{00}}{\MT_svwi_aux:nn{01}}}
+\def\MT_svwi_aux:nn #1#2{
+ \MTFlushSpaceAbove
+ \if#1 \vdotswithin{#2}& \else &\vdotswithin{#2} \fi
+ \MTFlushSpaceBelow
+}
+\def\MT_remove_tag_unless_inner:n #1{%
+ \begingroup
+ \def\etb@tempa##1|#1|##2\MT@END{\endgroup
+ \ifx\@empty##2\@empty\notag\fi}%
+ \expandafter\etb@tempa\expandafter|alignedat|aligned|split|#1|\MT@END}
+\newcommand\MTFlushSpaceAbove{
+ \expandafter\MT_remove_tag_unless_inner:n\expandafter{\@currenvir}
+ \\
+ \noalign{%
+ \nobreak\vskip-\baselineskip\vskip-\lineskip%
+ \vskip-\l_MT_shortvdotswithinadjustabove_dim
+ \vskip-\origjot
+ \vskip\jot
+ }%
+ \noalign{
+ \expandafter\MT_remove_tag_unless_inner:n\expandafter{\@currenvir}
+ }
+}
+\newcommand\MTFlushSpaceBelow{
+ \\\noalign{%
+ \nobreak\vskip-\lineskip
+ \vskip-\l_MT_shortvdotswithinadjustbelow_dim
+ \vskip-\origjot
+ \vskip\jot
+ }
+}
+
\def\MH_nrotarrow:NN #1#2{%
\setbox0=\hbox{$\m@th#1\uparrow$}\dimen0=\dp0
\setbox0=\hbox{%