From 64fe092a8f3dc062b323f28f52dc82c7be509252 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 1 Mar 2016 23:30:12 +0000
Subject: amsmath (1mar16)

git-svn-id: svn://tug.org/texlive/trunk@39904 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/amsmath/amsmath.sty | 152 +++++++++++++++++-------
 1 file changed, 111 insertions(+), 41 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/amsmath/amsmath.sty')

diff --git a/Master/texmf-dist/tex/latex/amsmath/amsmath.sty b/Master/texmf-dist/tex/latex/amsmath/amsmath.sty
index d9775df47a8..74e85c4c4f9 100644
--- a/Master/texmf-dist/tex/latex/amsmath/amsmath.sty
+++ b/Master/texmf-dist/tex/latex/amsmath/amsmath.sty
@@ -6,18 +6,8 @@
 %%
 %% amsmath.dtx 
 %% 
-%% Copyright 1995, 2000, 2013 American Mathematical Society.
-%% 
-%% American Mathematical Society
-%% Technical Support
-%% Publications Technical Group
-%% 201 Charles Street
-%% Providence, RI 02904
-%% USA
-%% tel: (401) 455-4080
-%%      (800) 321-4267 (USA and Canada only)
-%% fax: (401) 331-3842
-%% email: tech-support@ams.org
+%% Copyright 1995, 1999, 2000, 2013 American Mathematical Society.
+%% Copyright 2016 LaTeX3 Project and American Mathematical Society.
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -29,12 +19,11 @@
 %% 
 %% This work has the LPPL maintenance status `maintained'.
 %% 
-%% The Current Maintainer of this work is the American Mathematical
-%% Society.
+%% The Current Maintainer of this work is the LaTeX3 project.
 %% 
 \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
 [1994/12/01]% LaTeX date must be December 1994 or later
-\ProvidesPackage{amsmath}[2013/01/14 v2.14 AMS math features]
+\ProvidesPackage{amsmath}[2016/02/20 v2.15 AMS math features]
 \edef\@temp{\catcode 96=\number\catcode 96 }
 \catcode\string `\`=12
 \def\do#1{\catcode\number`#1=\number\catcode`#1}
@@ -226,8 +215,10 @@ Foreign command \@backslashchar#1;\MessageBreak
     \or\textstyle\or\scriptstyle\else\scriptscriptstyle\fi\fi}
 \begingroup
 \edef\@tempa{\string\mathchar"}
+\edef\@tempd{\string\Umathchar"}
 \def\@tempb#1"#2\@nil{#1"}
 \edef\@tempc{\expandafter\@tempb\meaning\coprod "\@nil}
+\ifx\@tempc\@tempd\let\@tempc\@tempa\fi
 \ifx\@tempa\@tempc
   \global\let\coprod@\coprod
   \gdef\coprod{\DOTSB\coprod@\slimits@}
@@ -330,6 +321,27 @@ Foreign command \@backslashchar#1;\MessageBreak
 {\uccode`7=`c \uccode`8=`h \uccode`9=`\"
  \uppercase{\gdef\mathch@#1#2#3#4#5#6\mathch@{\gtest@false
   \ifx 7#1\ifx 8#2\ifx 9#5\gtest@true\xdef\meaning@{9#6}\fi\fi\fi}}}
+{\uccode`(=`U \uccode`)=`m
+ \uppercase{\gdef\Umathch@#1#2#3#4"#5"#6\Umathch@{\gtest@false
+  \ifx(#2\ifx)#3\gtest@true
+  \ifcase"#5 \or\or\gdef\thedots@{\dotsb@}\or\gdef\thedots@{\dotsb@}\fi
+  \fi\fi
+  }}}
+\ifx\Umathcharnumdef\@undefined
+\gdef\thecharacter@#1\thecharacter@{}
+\else
+{\uccode`(=`t \uccode`)=`c
+ \uppercase{\gdef\thecharacter@#1#2#3#4#5\thecharacter@{%
+  \ifx(#1\ifx)#4%
+    \@xp\getmathcode@\meaning@\getmathcode@
+  \fi\fi
+}}}
+\def\getmathcode@#1 #2 #3#4\getmathcode@{%
+  \Umathcharnumdef\@tempa\Umathcodenum`#3\relax
+  \edef\meaning@{\meaning\@tempa}%
+  \@xp\Umathch@\meaning@\Umathch@
+}
+\fi
 \newcount\classnum@
 \def\getmathch@#1.#2\getmathch@{\classnum@#1 \divide\classnum@4096
  \ifcase\number\classnum@\or\or\gdef\thedots@{\dotsb@}\or
@@ -369,6 +381,10 @@ Foreign command \@backslashchar#1;\MessageBreak
  \gtest@false\DN@##1\not@{}%
  \ifx 5#1\ifx 6#2\ifx 7#3\ifx 8#4\DN@{\FN@\nextii@}\fi\fi\fi
  \fi\next@}}}
+{\uccode`9=`\l %
+ \uppercase{\gdef\striplong@#1#2#3\relax{%
+  \ifx9#2 \@xp\@xp\@xp\zap@to@space\fi}}}
+\def\zap@to@space#1 {}
 \def\keybin@{\gtest@true
  \ifx\@let@token+\else\ifx\@let@token=\else
  \ifx\@let@token<\else\ifx\@let@token>\else
@@ -390,30 +406,66 @@ Foreign command \@backslashchar#1;\MessageBreak
   \ \FN@\next@}
 \def\mdots@{\FN@\mdots@@}
 \def\mdots@@{\gdef\thedots@{\dotso@}%
- \ifx\@let@token\boldsymbol \gdef\thedots@\boldsymbol{\boldsymboldots@}%
- \else\ifx,\@let@token \gdef\thedots@{\dotsc}%
- \else\ifx\not\@let@token \gdef\thedots@{\dotsb@}%
- \else\keybin@
- \ifgtest@\gdef\thedots@{\dotsb@}%
- \else\xdef\meaning@{\meaning\@let@token..........}%
-   \xdef\meaning@@{\meaning@}%
-  \@xp\math@\meaning@\math@
-  \ifgtest@
-   \@xp\mathch@\meaning@\mathch@
-   \ifgtest@\@xp\getmathch@\meaning@\getmathch@\fi
-  \else\@xp\macro@\meaning@@\macro@
-  \ifgtest@
-   \@xp\not@\meaning@\not@\ifgtest@\gdef\thedots@{\dotsb@}%
-  \else\@xp\DOTS@\meaning@\DOTS@
-  \ifgtest@
-   \ifcase\number\DOTSCASE@\gdef\thedots@{\dotsb@}%
-    \or\gdef\thedots@{\dotsi}\else\fi
-  \else\@xp\math@\meaning@\math@
-  \ifgtest@\@xp\mathbin@\meaning@\mathbin@
-  \ifgtest@\gdef\thedots@{\dotsb@}%
-  \else\@xp\mathrel@\meaning@\mathrel@
-  \ifgtest@\gdef\thedots@{\dotsb@}%
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \ifx\@let@token\boldsymbol
+   \gdef\thedots@\boldsymbol{\boldsymboldots@}%
+ \else
+   \ifx,\@let@token \gdef\thedots@{\dotsc}%
+   \else
+     \ifx\not\@let@token
+       \gdef\thedots@{\dotsb@}%
+     \else
+       \keybin@
+       \ifgtest@ % if \keybin@ test
+         \gdef\thedots@{\dotsb@}%
+       \else
+         \xdef\meaning@{\meaning\@let@token..........}%
+         \xdef\meaning@@{\@xp\striplong@\meaning@\relax\meaning@}%
+         \@xp\math@\meaning@\math@
+         \ifgtest@ % if \mathxxx test
+           \@xp\mathch@\meaning@\mathch@
+           \ifgtest@ % if \mathchar
+             \@xp\getmathch@\meaning@\getmathch@
+           \fi % end if \mathchar
+         \else  % \not \mathxxx
+             \@xp\Umathch@\meaning@"0"\Umathch@
+             \ifgtest@ % if \Umathchar
+             \else % else not \Umathcar
+           \@xp\macro@\meaning@@\macro@
+           \ifgtest@ % if macro test
+             \@xp\not@\meaning@\not@
+             \ifgtest@ % if macro starts \not test
+               \gdef\thedots@{\dotsb@}%
+             \else% else not \not
+               \@xp\DOTS@\meaning@\DOTS@
+               \ifgtest@ % \if DOTS
+                 \ifcase\number\DOTSCASE@ %ifcase dots
+                   \gdef\thedots@{\dotsb@}%
+                 \or\gdef\thedots@{\dotsi}\else
+                 \fi % endifcase dots
+               \else % not macro starts \DOTS
+                 \@xp\math@\meaning@\math@
+                 \ifgtest@ % \if macro starts \mathxxxx
+                   \@xp\mathbin@\meaning@\mathbin@
+                   \ifgtest@ % if macro starts \mathbin
+                     \gdef\thedots@{\dotsb@}%
+                   \else % not macro starting \mathbin
+                     \@xp\mathrel@\meaning@\mathrel@
+                     \ifgtest@ % if macro starts \mathrel
+                       \gdef\thedots@{\dotsb@}%
+                     \fi % endif macro starts \mathrel (no else)
+                   \fi % endif macro starts \mathbin
+                 \fi % endif macro starts with \mathxxx (no else)
+               \fi % endif macro starts \DOTS else
+             \fi % end macro  starting \not \ifgtest@ test (no else)
+             \else
+               \@xp\thecharacter@\meaning@\thecharacter@
+             \fi % end macro \ifgtest@ test (no else)
+           \fi % end if \Umathchar test
+         \fi % end \math@   \ifgtest@
+       \fi % end \keybin@ \ifgtest@ test (no else)
+     \fi % end if \not (no else)
+   \fi % end if comma (no else)
+ \fi % end if boldsymbol (no else)
  \thedots@}
 \def\boldsymboldots@#1{%
   \bold@true\let\@let@token=#1\let\delayed@=#1\mdots@@
@@ -532,6 +584,7 @@ Foreign command \@backslashchar#1;\MessageBreak
 \newbox\Mathstrutbox@
 \setbox\Mathstrutbox@=\hbox{}
 \def\Mathstrut@{\copy\Mathstrutbox@}
+\ifx\Umathcharnumdef\@undefined
 \def\resetMathstrut@{%
   \setbox\z@\hbox{%
     \mathchardef\@tempa\mathcode`\(\relax
@@ -540,6 +593,17 @@ Foreign command \@backslashchar#1;\MessageBreak
   }%
   \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
 }
+\else
+\def\resetMathstrut@{%
+    \begingroup
+    \Umathcharnumdef\@tempa\Umathcodenum`\(\relax
+    \def\@tempb##1"##2"##3"##4\relax{%
+      \endgroup
+      \ht\Mathstrutbox@=\fontcharht\textfont"##3 "##4\relax
+      \dp\Mathstrutbox@=\fontchardp\textfont"##3 "##4\relax}
+    \expandafter\@tempb\meaning\@tempa \relax
+}
+\fi
 \addto@hook\every@math@size{\resetMathstrut@}
 \newbox\strutbox@
 \def\strut@{\copy\strutbox@}
@@ -579,13 +643,19 @@ Foreign command \@backslashchar#1;\MessageBreak
 \def\@tempb#1>#2#3 #4\@nil#5{%
   \@xp\ifx\csname#3\endcsname\mathaccent
     \@tempc#4?"7777\@nil#5%
+  \else
+  \@xp\ifx\csname#3\endcsname\Umathaccent
+    \@tempd#4\@nil#5%
   \else
     \PackageWarningNoLine{amsmath}{%
       Unable to redefine math accent \string#5}%
-  \fi
-}
+  \fi\fi}
 \def\@tempc#1"#2#3#4#5#6\@nil#7{%
   \chardef\@tempd="#3\relax\set@mathaccent\@tempd{#7}{#2}{#4#5}}
+\def\@tempd#1\@nil#2{%
+    \PackageWarningNoLine{amsmath}{%
+      Unable to redefine \string\Umathaccent\space\string#2}%
+}
 \@tempa{\hat}
 \@tempa{\check}
 \@tempa{\tilde}
-- 
cgit v1.2.3

