diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/mh/mathtools.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mathtools.sty | 126 |
1 files changed, 109 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty index 64a293168d2..989ed7e6fd6 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-2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% Copyright (C) 2002-2010 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 @@ -27,8 +27,8 @@ %% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. %% \ProvidesPackage{mathtools}% - [2008/08/01 v1.06 mathematical typesetting tools (MH)] -\RequirePackage{keyval,calc} + [2010/07/11 v1.08 mathematical typesetting tools (MH)] +\RequirePackage{keyval,calc,graphicx} \RequirePackage{mhsetup}[2007/12/03] \MHInternalSyntaxOn \def\MT_options_name:{mathtools} @@ -574,19 +574,55 @@ } } } -\def\MT_start_cases:nnn #1#2#3{ % #1=sep,#2=preamble,#3=delim +\def\MHempty{} +\def\DeclarePairedDelimiterX#1[#2]#3#4#5#6{% + \@ifdefinable{#1}{ + \ifnum#2>8\relax + \PackageError{mathtools}{No~ more~ than~ 8~ arguments}{} + \else + \ifnum#2<1\relax + \PackageError{mathtools}{Macro~ need~ 1~ or~ more~ arguments}{} + \fi + \fi + % store the argument number in a temp counter + \@tempcnta=#2 + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _star:\endcsname + [\@tempcnta] + { + \left#3 #6 \right#4 + } + \advance\@tempcnta by 1 + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname + [\@tempcnta][\MHempty] + { + \mathopen{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 l} #3} + #5 + \mathclose{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 r} #4} + } + \DeclareRobustCommand{#1}{ + \@ifstar + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} + } + } +} +\def\MT_start_cases:nnnn #1#2#3#4{ % #1=sep,#2=lpreamble,#3=rpreamble,#4=delim \RIfM@\else \nonmatherr@{\begin{\@currenvir}} \fi \MH_group_align_safe_begin: - \left#3 + \left#4 \vcenter \bgroup \Let@ \chardef\dspbrk@context\@ne \restore@math@cr \let \math@cr@@\AMS@math@cr@@ \spread@equation \ialign\bgroup - \strut@$\m@th \displaystyle{##}$\hfil \strut@ - #2 + \strut@#2 \strut@ + #3 \crcr } \def\MH_end_cases:{\crcr\egroup @@ -594,18 +630,23 @@ \egroup \MH_group_align_safe_end: } -\newcommand*\newcases[5]{% #1=name, #2=sep, #3=preamble, #4=left, #5=right +\newcommand*\newcases[6]{% #1=name, #2=sep, #3=preamble, #4=left, #5=right \newenvironment{#1} - {\MT_start_cases:nnn {#2}{#3}{#4}} - {\MH_end_cases:\right#5} + {\MT_start_cases:nnnn {#2}{#3}{#4}{#5}} + {\MH_end_cases:\right#6} } -\newcommand*\renewcases[5]{ +\newcommand*\renewcases[6]{ \renewenvironment{#1} - {\MT_start_cases:nnn {#2}{#3}{#4}} - {\MH_end_cases:\right#5} -} -\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.} -\newcases{dcases*}{\quad}{{##}\hfil}{\lbrace}{.} + {\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}{.} \def\MT_matrix_begin:N #1{% \hskip -\arraycolsep \MH_let:NwN \@ifnextchar \MH_nospace_ifnextchar:Nnn @@ -790,6 +831,17 @@ \kern\@tempdima% & \kern-\@tempdima} +\newcommand\Aboxed[1]{\@Aboxed#1\ENDDNE} +\def\@Aboxed#1\ENDDNE{% + \settowidth\@tempdima{$\displaystyle#1{}$}% + \addtolength\@tempdima{\fboxsep}% + \addtolength\@tempdima{\fboxrule}% + \global\@tempdima=\@tempdima + \kern\@tempdima + & + \kern-\@tempdima + \boxed{#1#2} +} \MHInternalSyntaxOff \def\ArrowBetweenLines{\relax \iffalse{\fi\ifnum0=`}\fi @@ -800,7 +852,12 @@ {\ArrowBetweenLines@auxII{#1}[\Updownarrow]}} \def\ArrowBetweenLines@auxII#1[#2]{% \ifnum0=`{\fi \iffalse}\fi - \crcr + \expandafter\in@\expandafter{\@currenvir}% + {alignedat,aligned,gathered}% + \ifin@ \else + \notag + \fi% + \\ \noalign{\nobreak\vskip-\baselineskip\vskip-\lineskip}% \noalign{\expandafter\in@\expandafter{\@currenvir}% {alignedat,aligned,gathered}% @@ -809,6 +866,41 @@ \if#1 &&\quad #2\else #2\quad\fi \\\noalign{\nobreak\vskip-\lineskip}} \MHInternalSyntaxOn +\def\MH_nrotarrow:NN #1#2{% + \setbox0=\hbox{$\m@th#1\uparrow$}\dimen0=\dp0 + \setbox0=\hbox{% + \reflectbox{\rotatebox[origin=c]{90}{$\m@th#1\mkern2.22mu #2$}}}% + \dp0=\dimen0 \box0 \mkern2.3965mu +} +\def\MH_nuparrow: {% + \mathrel{\mathpalette\MH_nrotarrow:NN\nrightarrow} } +\def\MH_ndownarrow: {% + \mathrel{\mathpalette\MH_nrotarrow:NN\nleftarrow} } +\AtBeginDocument{% + \@ifundefined{nrightarrow}{% + \providecommand\nuparrow{% + \PackageError{mathtools}{\string\nuparrow\space~ is~ + constructed~ from~ \string\nrightarrow,~ which~ is~ not~ + provided.~ Please~ load~ the~ amssymb~ package~ or~ similar}{} + }}{ \providecommand\nuparrow{\MH_nuparrow:}} + \@ifundefined{nleftarrow}{% + \providecommand\ndownarrow{% + \PackageError{mathtools}{\string\ndownarrow\space~ is~ + constructed~ from~ \string\nleftarrow,~ which~ is~ not~ + provided.~ Please~ load~ the~ amssymb~ package~ or~ similar}{} + }}{ \providecommand\ndownarrow{\MH_ndownarrow:}} } +\def\MH_bigtimes_scaler:N #1{% + \vcenter{\hbox{#1$\m@th\mkern-2mu\times\mkern-2mu$}}} +\def\MH_bigtimes_inner: { + \mathchoice{\MH_bigtimes_scaler:N \huge} % display style + {\MH_bigtimes_scaler:N \LARGE} % text style + {\MH_bigtimes_scaler:N {}} % script style + {\MH_bigtimes_scaler:N \footnotesize} % script script style +} +\def\MH_csym_bigtimes: {\mathop{\MH_bigtimes_inner:}\displaylimits} +\AtBeginDocument{ + \providecommand\bigtimes{\MH_csym_bigtimes:} +} \def\shortintertext#1{% \ifvmode\else\\\@empty\fi \noalign{% |