%%
%% This is file `lwarp-amsmath.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `amsmath')
%% This is a generated file.
%% Copyright 2016-2025 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% 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.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
\LWR@ProvidesPackagePass{amsmath}[2017/09/02]
\newcommand*{\LWR@HTML@dotso}{\textellipsis\ }
\LWR@formatted{dotso}
\def\maketag@@@#1{\text{#1}}
\def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip)}}

\ifbool{mathjax}{}{% not mathjax

\VerifyCommand[lwarp][amsmath]{\make@df@tag@@}{A5AA7B9CD20DC2C73B1D19D582C44A8E}
\VerifyCommand[lwarp][amsmath]{\make@df@tag@@@}{670399C01F88B0E9B0874E9B129FA404}

\LetLtxMacro\LWR@origmake@df@tag@@\make@df@tag@@
\LetLtxMacro\LWR@origmake@df@tag@@@\make@df@tag@@@

\renewcommand*{\make@df@tag@@}[1]{%
    \LWR@remembertag{#1}%
    \LWR@origmake@df@tag@@{#1}%
}

\renewcommand*{\make@df@tag@@@}[1]{%
    \LWR@remembertag{#1}%
    \LWR@origmake@df@tag@@@{#1}%
}

}% not mathjax
\newcounter{LWR@amsmathdepth}
\setcounter{LWR@amsmathdepth}{0}
\newcounter{LWR@maxfields@}

\VerifyCommand[lwarp][amsmath]{\start@align}{D39AF6A45F9E97A21F17EADB4D21D218}

\xpatchcmd{\start@align}
    {\maxfields@#3\relax}
    {%
        \maxfields@#3\relax%
        \setcounter{LWR@maxfields@}{#3}%
    }
    {}
    {\LWR@patcherror{amsmath}{start@align}}
\NewDocumentCommand{\LWR@amsmathenv@@before}{s m}{%
    \IfBooleanTF{#1}{
        \begin{BlockClass}{displaymath}
    }{
        \begin{BlockClass}{displaymathnumbered}
    }
    \LWR@newautoidanchor%
    \booltrue{LWR@indisplaymathimage}%
    \begin{lateximage}[\LWR@amsmathbodynumbered{#2}]*?%
    \LWR@applyxfakebold%
}
\NewDocumentCommand{\LWR@amsmathenv@before}{s m}{%
    \ifnumequal{\value{LWR@amsmathdepth}}{0}{%
        \LWR@stoppars%
        \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
        {
            \LWR@syncmathjax
            \boolfalse{LWR@amsmultline}
            \ifstrequal{#2}{multline}{\booltrue{LWR@amsmultline}}{}
            \ifstrequal{#2}{multline*}{\booltrue{LWR@amsmultline}}{}
            \LWR@beginhideamsmath
        }
        {
            \IfBooleanTF{#1}{
                \LWR@amsmathenv@@before*{#2}
            }{
                \LWR@amsmathenv@@before{#2}
            }
        }
    }{}
    \addtocounter{LWR@amsmathdepth}{1}
}
\newcommand*{\LWR@amsmathenv@@after}{%
    \end{lateximage}\end{BlockClass}\LWR@startpars%
}
\NewDocumentCommand{\LWR@amsmathenv@after}{s m}{%
    \ifnumequal{\value{LWR@amsmathdepth}}{1}{%
        \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
        {
            \LWR@endhideamsmath
            \boolfalse{LWR@amsmultline}
            \LWR@addmathjax{#2}{\the\@envbody}%
        }
        {\LWR@amsmathenv@@after}
        \gdef\LWR@ThisAltText{}%
    }{}
    \addtocounter{LWR@amsmathdepth}{-1}
}
\BeforeBeginEnvironment{multline}{\LWR@amsmathenv@before{multline}}

\AfterEndEnvironment{multline}{\LWR@amsmathenv@after{multline}}

\BeforeBeginEnvironment{multline*}{\LWR@amsmathenv@before*{multline*}}

\AfterEndEnvironment{multline*}{\LWR@amsmathenv@after*{multline*}}


\BeforeBeginEnvironment{gather}{\LWR@amsmathenv@before{gather}}

\AfterEndEnvironment{gather}{\LWR@amsmathenv@after{gather}}

\BeforeBeginEnvironment{gather*}{\LWR@amsmathenv@before*{gather*}}

\AfterEndEnvironment{gather*}{\LWR@amsmathenv@after*{gather*}}

\BeforeBeginEnvironment{align}{\LWR@amsmathenv@before{align}}

\AfterEndEnvironment{align}{\LWR@amsmathenv@after{align}}

\BeforeBeginEnvironment{align*}{\LWR@amsmathenv@before*{align*}}

\AfterEndEnvironment{align*}{\LWR@amsmathenv@after*{align*}}

\BeforeBeginEnvironment{flalign}{\LWR@amsmathenv@before{flalign}}

\AfterEndEnvironment{flalign}{\LWR@amsmathenv@after{flalign}}

\BeforeBeginEnvironment{flalign*}{\LWR@amsmathenv@before*{flalign*}}

\AfterEndEnvironment{flalign*}{\LWR@amsmathenv@after*{flalign*}}

\BeforeBeginEnvironment{alignat}{\LWR@amsmathenv@before{alignat}}

\AfterEndEnvironment{alignat}{\LWR@amsmathenv@after{alignat}}

\BeforeBeginEnvironment{alignat*}{\LWR@amsmathenv@before*{alignat*}}

\AfterEndEnvironment{alignat*}{\LWR@amsmathenv@after*{alignat*}}
\AtBeginEnvironment{subequations}{
    \renewcommand*{\theMathJaxsubequations}{1}
    \renewcommand*{\theMathJaxsection}{\theparentequation}
    \renewcommand*{\theMathJaxequation}{\arabic{equation}}
}
\begin{warpMathJax}
\CustomizeMathJax{\newcommand{\intertext}[1]{\text{#1}\notag \\}}
\CustomizeMathJax{\let\Hat\hat}
\CustomizeMathJax{\let\Check\check}
\CustomizeMathJax{\let\Tilde\tilde}
\CustomizeMathJax{\let\Acute\acute}
\CustomizeMathJax{\let\Grave\grave}
\CustomizeMathJax{\let\Dot\dot}
\CustomizeMathJax{\let\Ddot\ddot}
\CustomizeMathJax{\let\Breve\breve}
\CustomizeMathJax{\let\Bar\bar}
\CustomizeMathJax{\let\Vec\vec}
\end{warpMathJax}

\endinput
%%
%% End of file `lwarp-amsmath.sty'.