\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{amsmath1}[2008/01/03 Improved amsmath by ccshan]

\DeclareOption{intertext}{\AtEndOfPackage{%
% Fix bug amslatex/3996: \intertext leaves \jot too much space above and below.
\def\intertext@{%
  \def\intertext##1{%
    \ifvmode\else\\\@empty\fi
    \noalign{%
      \penalty\postdisplaypenalty\vskip\belowdisplayskip
      \vskip-\lineskiplimit      % added for fix
      \vskip\normallineskiplimit % added for fix
      \vbox{\normalbaselines
        \ifdim\linewidth=\columnwidth
        \else \parshape\@ne \@totalleftmargin \linewidth
        \fi
        \noindent##1\par}%
      \penalty\predisplaypenalty\vskip\abovedisplayskip%
      \vskip-\lineskiplimit      % added for fix
      \vskip\normallineskiplimit % added for fix
    }%
}}}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}
\ProcessOptions\relax
\RequirePackage{amsmath}

% Inside AMS-LaTeX's math alignment environments, say \displayleft{...} to
% make a left-justified alignment row, and \displayright{...} to make a
% right-justified alignment row.
%
\newcommand{\@ligndisplayskip}[2]{%
    #2\span\omit\strut@
    \ifinalign@ \else \column@plus \fi
    #1\tabskip\alignsep@}
\newcommand{\displayleft  }{\@ligndisplayskip\hfill}
\newcommand{\displayright }{\@ligndisplayskip\relax}
\newcommand{\displaycenter}{\@ligndisplayskip\hfil}

% Define \argmin and \argmax operators.
%
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
