%%
%% This is file `mismath.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mismath.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2019-2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%% 
%% This file 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.
%% 
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{mismath}
    [2020/11/15 v1.8 .dtx mismath file]
%% \CheckSum{419}


\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}
\ProcessOptions \relax
\@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}}
\@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}}
\RequirePackage{ifthen}
\RequirePackage{xspace}
\RequirePackage{mathtools}
{\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % the \bslash command
\newcommand\@mwarning[1]{
    \PackageWarning{mismath}{
        Command \bslash #1 already exist and will not be redefined
    }
}
\newcommand\@mmacro[2]{
    \@ifundefined{#1}{
        \expandafter\def\csname #1\endcsname{#2}
    }{\@mwarning{#1}}
}
\newcommand\@moperator[3][]{% this macro is ugly, TODO: by default #1=#3
    \ifthenelse{\equal{#1}{}}{
        \@ifundefined{#3}{
            \DeclareMathOperator{#2}{#3}
        }{\@mwarning{#3}}
    }{
        \@ifundefined{#1}{
            \DeclareMathOperator{#2}{#3}
        }{\@mwarning{#1}}
    }
}

\providecommand{\mathup}[1]{{\operatorfont #1}}
\@mmacro{e}{\mathup{e}}
\AtBeginDocument{\let\oldi\i \let\oldj\j
    \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
    \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}}
}

\DeclareSymbolFont{UpSh}{\encodingdefault}{\familydefault}{m}{n}
\newcommand{\enumber}{
    \AtBeginDocument{\DeclareMathSymbol{e}\mathalpha{UpSh}{`e}}
}
\newcommand{\inumber}{
    \AtBeginDocument{\DeclareMathSymbol{i}\mathalpha{UpSh}{`i}}
}
\newcommand{\jnumber}{
    \AtBeginDocument{\DeclareMathSymbol{j}\mathalpha{UpSh}{`j}}
}
\newcommand*{\pinumber}[1][Symbol]{
    \@ifpackageloaded{upgreek}{}{\usepackage[#1]{upgreek}}
    \let\itpi\pi
    \renewcommand{\pi}{\uppi}
}

\newboolean{arrowvect}
\setboolean{arrowvect}{true}
\newcommand{\arrowvect}{\setboolean{arrowvect}{true}}
\newcommand{\boldvect}{\setboolean{arrowvect}{false}}
\newcommand{\boldvectcommand}{\boldsymbol} % needs bm package
\@mmacro{vect}{\ifthenelse{\boolean{arrowvect}}{\vv}{\boldvectcommand}}
\newcommand*{\hvect}[1]{\vv{\vphantom{h}#1}}
\newcommand*{\hvec}[1]{\vec{\vphantom{t}#1}}

\newcommand*{\@norm}[1]{
    \mbox{\raisebox{1.75pt}{$\bigl\Vert$}} #1
    \mbox{\raisebox{1.75pt}{$\bigr\Vert$}} }
\newcommand*{\@@norm}[1]{
    \mbox{\footnotesize\raisebox{1pt}{$\Vert$}} #1
    \mbox{\footnotesize\raisebox{1pt}{$\Vert$}} }
\newcommand*{\@@@norm}[1]{
    \mbox{\tiny\raisebox{1pt}{$\Vert$}} #1
    \mbox{\tiny\raisebox{1pt}{$\Vert$}} }
\providecommand*{\norm}[1]{
    \mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}} }

\newcommand{\di}{\mathop{}\!\mathup{d}}
\newcommand\probastyle{}
\let\Par\P % end of paragraph symbol
\renewcommand{\P}{\operatorname{\probastyle{P}}}
\@mmacro{E}{\operatorname{\probastyle{E}}}
\@mmacro{V}{\operatorname{\probastyle{V}}}
\newcommand{\PEupright}{
    \AtBeginDocument{% necessary for working with beamer
        \DeclareMathSymbol{P}\mathalpha{UpSh}{`P}
        \DeclareMathSymbol{E}\mathalpha{UpSh}{`E}
    }
}

\@moperator{\adj}{adj}
\@moperator{\Aut}{Aut}
\@moperator{\Conv}{Conv}
\@moperator{\cov}{cov}
\@moperator{\Cov}{Cov}
\@mmacro{curl}{\operatorname{\vect{\mathup{curl}}}}
\@moperator[divg]{\divg}{div}
\@moperator{\End}{End}

\@moperator{\erf}{erf}
\@mmacro{grad}{\operatorname{\vect{\mathup{grad}}}}
\@moperator{\id}{id} % mathop or mathord ?
\@moperator{\Id}{Id}
\@moperator{\im}{im}
\let\oldIm\Im \renewcommand{\Im}{\operatorname{Im}}
\@moperator{\lb}{lb}
\@moperator{\lcm}{lcm}

\@moperator{\rank}{rank}
\let\oldRe\Re \renewcommand{\Re}{\operatorname{Re}}
\@mmacro{rot}{\operatorname{\vect{\mathup{rot}}}}
\@moperator{\sgn}{sgn}
\@moperator[spa]{\spa}{span}
\@moperator{\tr}{tr}
\@moperator{\Var}{Var}
\@moperator[Zu]{\Zu}{Z}

\@moperator{\arccot}{arccot}
\@moperator{\sech}{sech}
\@moperator{\csch}{csch}
\@moperator{\arsinh}{arsinh}
\@moperator{\arcosh}{arcosh}
\@moperator{\artanh}{artanh}
\@moperator{\arcoth}{arcoth}
\@moperator{\arsech}{arsech}
\@moperator{\arcsch}{arcsch}

\@moperator[bigO]{\bigO}{\mathcal{O}}
\@moperator[bigo]{\bigo}{O}
\@moperator[lito]{\lito}{o}

\newcommand{\mathset}{\mathbf}
\@mmacro{R}{\ensuremath{\mathset{R}}\xspace}
\@mmacro{C}{\ensuremath{\mathset{C}}\xspace}
\@mmacro{N}{\ensuremath{\mathset{N}}\xspace}
\@mmacro{Z}{\ensuremath{\mathset{Z}}\xspace}
\@mmacro{Q}{\ensuremath{\mathset{Q}}\xspace}
\@mmacro{F}{\ensuremath{\mathset{F}}\xspace}
\@mmacro{K}{\ensuremath{\mathset{K}}\xspace}

\@mmacro{ds}{\displaystyle}
\@mmacro{dlim}{\lim\limits}
\@mmacro{dsum}{\sum\limits}
\@mmacro{dprod}{\prod\limits}
\@mmacro{dcup}{\bigcup\limits}
\@mmacro{dcap}{\bigcap\limits}
\@mmacro{lbar}{\overline}
\providecommand*{\hlbar}[1]{\overline{\vphantom{h}#1}}
\@mmacro{eqdef}{\stackrel{\mathup{def}}{=}}
\@mmacro{unbr}{\underbrace}
\@mmacro{iif}{if and only if\xspace}

\@mmacro{mul}{\mathord{\times}}
\@mmacro{then}{\ \Longrightarrow \ \mbox{} }
\providecommand*{\txt}[1]{\quad\text{#1}\quad}
\providecommand*{\paren}[1]{\mathopen{\left(#1\right)}}
\providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}}
\providecommand*{\abs}[1]{\left\vert#1\right\vert}
\providecommand*{\lfrac}[2]{\frac{\:#1\:}{\:#2\:}}
\DeclareMathSymbol{]}\mathord{UpSh}{093} % originally \mathclose
\DeclareMathSymbol{[}\mathord{UpSh}{091} % originally \mathopen

\newcommand{\systemstretch}{1.2}
\newcommand{\systemsep}{\medspace}
\newenvironment{system}[1][l]{
    \renewcommand{\arraystretch}{\systemstretch}
    \setlength{\arraycolsep}{0.15em}
    \left\{\begin{array}{@{\systemsep}#1@{}} %
}{\end{array}\right.}

\newenvironment{spmatrix}{
    \left(\begin{smallmatrix}
}{\end{smallmatrix}\right)}

\newenvironment{mathcols}{% needs multicol package
    \renewcommand{\columnseprule}{0.1pt}
    \begin{multicols}{2}
        \par\noindent\hfill
        \begin{math}\begin{aligned}\displaystyle
}{%
        \end{aligned}\end{math} \hfill\mbox{}
    \end{multicols}
}
\newcommand{\changecol}{%
    \end{aligned}\end{math} \hfill\mbox{}
    \par\noindent\hfill
    \begin{math}\begin{aligned}\displaystyle
}

\endinput
%%
%% End of file `mismath.sty'.
