\DeclareMathAlphabet\mathbfcal{OMS}{cmsy}{b}{n}
\usepackage{xparse}

% style commands
\theoremstyle{plain}
\newtheorem{Defi}{Definition}[section]  \newtheorem{SDefi}[Defi]{Definition und Satz}
 \newtheorem{Satz}[Defi]{Satz}  \newtheorem{Prop}[Defi]{Proposition}
\newtheorem{Lemma}[Defi]{Lemma}  \newtheorem{Question}[Defi]{Question}  \newtheorem{Cor}[Defi]{Corollary}
\newtheorem{Thm}[Defi]{Theorem}  \newtheorem{asu}[Defi]{Assumption}  
\newtheorem{KeyLe}[Defi]{Key Lemma}  
\newtheorem*{PrvThm}{Provisional Theorem}  
\newtheorem{Crit}[Defi]{Criterion}  %\newtheorem*{Anm}{Anmerkung}  
\newtheorem{remark}[Defi]{remark}  %\newtheorem*{Anm}{Anmerkung}  
\newtheorem{Conj}[Defi]{Conjecture}


%\declaretheoremstyle[headfont=\rmfamily]{normalhead}
%\declaretheorem[Defi,style=normalhead]{Ex}
\theoremstyle{remark}
%\theorembodyfont{\rmfamily }
\newtheorem{Ex}[Defi]{Example}
\newtheorem{Not}[Defi]{Notation}
\newtheorem{Rem}[Defi]{Remark} 
\newtheorem{Pb}[Defi]{Problem}  \newtheorem{Auf}[Defi]{Aufgabe}  \newtheorem{Frg}[Defi]{Frage}


% BBB letters
\renewcommand{\AA}{\mathbb{A}} 
\newcommand{\B}{\mathbb{B}} 
\newcommand{\CC}{\mathbb{C}}
\newcommand\Cs{\CC^\times} 
\newcommand{\DD}{\mathbb{D}}
\newcommand{\EE}{\mathbb{E}}
\newcommand{\FF}{\mathbb{F}}
\newcommand{\GG}{\mathbb{G}} 
\newcommand{\HH}{\mathbb{H}}
\newcommand{\KK}{\mathbb{K}} 
\newcommand{\LL}{\mathbb{L}} 
\newcommand{\MM}{\mathbb{M}}
\newcommand{\BM}{\overline{\mathcal M}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\OO}{\mathbb{O}} 
\newcommand{\PP}{\mathbb{P}} 
\newcommand{\QQ}{\mathbb{Q}} 
\newcommand{\RR}{\mathbb{R}} 
\newcommand{\TT}{\mathbb{T}} 
\newcommand{\VV}{\mathbb{V}} 
\newcommand{\WW}{\mathbb{W}} 
\newcommand{\ZZ}{\mathbb{Z}}
\def\Z{\ZZ} 

% Fraktur letters 
\newcommand{\fraka}{\mathfrak{a}} 
\newcommand{\frakb}{\mathfrak{b}}
\newcommand{\frakc}{\mathfrak{c}}
\newcommand{\frakd}{\mathfrak{d}}
\newcommand{\frakh}{\mathfrak{h}}  
\newcommand{\frakI}{\mathfrak{I}}
\newcommand{\frakp}{\mathfrak{p}}  
\newcommand{\frakm}{\mathfrak{m}} 
\newcommand{\frakn}{\mathfrak{n}}
\newcommand{\fraku}{\mathfrak{u}} 
\newcommand{\frakU}{\mathfrak{U}}
\newcommand{\frakz}{\mathfrak{z}}
\newcommand{\frakR}{\mathfrak{R}}
\newcommand{\frakZ}{\mathfrak{Z}}
\newcommand{\fZ}{\mathfrak{Z}}
\newcommand{\mfS}{{\mathfrak S}} 
\newcommand{\fracL}{\mathfrak{L}}
\newcommand{\SH}{\mathfrak{h}} 
\def\fd{\mathfrak d} 


% Calligraphic letters
\newcommand{\cLL}{{\mathcal L}} \newcommand{\cAA}{{\mathcal A}} \newcommand{\cPP}{{\mathcal P}}  
\newcommand{\cFF}{{\mathcal F}} \newcommand{\cEE}{{\mathcal E}} 
\newcommand{\cDD}{{\mathcal D}} \newcommand{\cXX}{{\mathcal X}}  
\newcommand{\cCC}{{\mathcal C}} \newcommand{\cSS}{{\mathcal S}}
\newcommand{\cBB}{{\mathcal B}} \newcommand{\cGG}{{\mathcal G}}
\newcommand{\cHH}{{\mathcal H}} \newcommand{\cJJ}{{\mathcal J}}
\newcommand{\cMM}{{\mathcal M}} \newcommand{\cOO}{{\mathcal O}}
\newcommand{\cQQ}{{\mathcal Q}}
\newcommand{\cYY}{{\mathcal Y}} \newcommand{\tr}{{\rm tr}} \newcommand{\diag}{{\rm diag}}
 \newcommand{\sgn}{{\rm sgn}}
\newcommand{\msC}{{\cal M}}  \def\M{\cMM}  \def\OmM{\Omega\M}

\newcommand{\bfcH}{{\mathbfcal H}}

% Boldface letters
\newcommand{\bfa}{{\bf a}}
\newcommand{\bfd}{{\bf d}}
\newcommand{\dd}{{\bf d}}
\newcommand{\bfe}{{\bf e}}
\newcommand{\bff}{{\bf f}}
\newcommand{\bfg}{{\bf g}}
\newcommand{\bfh}{{\bf h}}
\newcommand{\bfm}{{\bf m}}
\newcommand{\bfn}{{\bf n}}
\newcommand{\bfp}{{\bf p}}
\newcommand{\bfq}{{\bf q}}
\newcommand{\bfP}{{\bf P}}
\newcommand{\bfR}{{\bf R}}
\newcommand{\bfU}{{\bf U}}
\newcommand{\bfu}{{\bf u}}
\newcommand{\bfz}{{\bf z}}

\renewcommand\P{{\bf P}}
\newcommand{\bfl}{{\boldsymbol{\ell}}}
\newcommand{\bfmu}{{\boldsymbol{\mu}}}
\newcommand{\bfLA}{{\boldsymbol{\Lambda}}}
\newcommand{\bfve}{{\boldsymbol{\varepsilon}}}
\newcommand{\bfrho}{{\boldsymbol{\rho}}}
\newcommand{\bfde}{{\boldsymbol{\delta}}}
\newcommand{\ual}{{\boldsymbol{\alpha}}}
\newcommand{\ube}{{\boldsymbol{\beta}}}
\newcommand{\uga}{{\boldsymbol{\gamma}}}
\newcommand{\ula}{{\boldsymbol{\lambda}}}
\newcommand{\usi}{{\boldsymbol{\sigma}}}
\def\DS{\bf D\bf S} \def\DE{\bf D\bf E}
\def\bE{\boldsymbol{E}} \def\bx{\boldsymbol{x}}


% abbreviations (symbols in roman type)
\newcommand{\Aut}{{\rm Aut}}
\newcommand{\Cl}{{\rm Cl}}
\newcommand{\Cliff}{{\rm Cliff}}
\newcommand{\Clp}{{\rm Cl}^+} 
\newcommand{\Coker}{{\rm Coker}}  
\newcommand{\Ker}{{\rm Ker}} 
\newcommand{\End}{{\rm End}} 
\newcommand{\Sq}{{\rm Sq}}  
\newcommand{\Mod}{{\rm Mod}} 
\newcommand{\Jac}{{\rm Jac}}
\newcommand{\na}{{\rm na}} 
\newcommand{\cyl}{{\rm cyl}} 
\newcommand{\phy}{{\rm phy}}
\newcommand{\Mp}{{\cMM{\rm -p}}}
\newcommand{\aut}{{\rm aut}} 
\newcommand{\ho}{{\rm hom}} 
\newcommand{\area}{{\rm area}} 
\newcommand{\Cov}{{\rm Hur}} %%% MACRO HAS BEEN CHANGED!!
\newcommand{\Pic}{{\rm Pic}}   
\newcommand{\Gal}{{\rm Gal}} 
\newcommand{\Hom}{{\rm Hom}}
\newcommand{\Aff}{{\rm Aff}}
\newcommand{\ord}{\O} \newcommand{\ind}{{\rm ind}} \newcommand{\Ext}{{\rm Ext}} \newcommand{\Def}{{\rm Def}}
\newcommand{\Inn}{{\rm Inn}} \newcommand{\Stab}{{\rm Stab}} \newcommand{\Tr}{{\rm Tr}}
\newcommand{\odd}{{\rm odd}}
\newcommand{\even}{{\rm even}}
\newcommand{\spin}{{\rm spin}}
\newcommand{\hyp}{{\rm hyp}}
\newcommand{\str}{{\rm str}}
\newcommand{\tp}{{\rm top}}
\newcommand{\md}{{\rm mid}}
\newcommand{\bt}{{\rm bot}}
%\newcommand{\sign}{{\rm s}}
\newcommand{\other}{\operatorname{other}}
\newcommand{\Centr}{{\rm Centr}} 
%%%%%%\newcommand{\Mob}{{\text{M{\"o}b}}} 
\newcommand{\lead}{{\rm lead}} 
\newcommand{\wgt}{{\rm wt}} 
%\renewcommand{\div}{{\rm div}}
\newcommand{\irr}{\operatorname{irr}}
\DeclareMathOperator{\vol}{vol}
\DeclareMathOperator{\Res}{Res}
\newcommand{\ddbar}{\partial \overline{\partial}} 
\newcommand{\Hur}{\operatorname{Hur}}

%%%%%%%%%%%%%%%%%%%%%% Dons definitions
\def\={\;=\;}  \def\+{\,+\,} \def\m{\,-\,}    \def\endpf{$\;\;\square$\enddemo}   \def\h{\tfrac12}  \def\d{\partial}
\def\i{^{-1}}   \def\bs{\backslash}  \def\de{\doteq} \def\ssm{\smallsetminus} \newcommand{\sms}{\smallsetminus} 
\def\lr{\leftrightarrow}  \def\c{\circ} \def\es{\emptyset} \def\sse{\subseteq}  \def\spse{\supseteq}
\newcommand{\bneg}{\!\!\!\;}  \def\dto{\downarrow}
\def\map#1{\overset{#1} \longrightarrow} \def\mapt#1{\overset{#1}\mapsto}

\def\pp{{\boldsymbol \partial}}  % this should be a BOLD \partial




% \def\PPP{\mathscr{P}}
\DeclareMathAlphabet{\eucal}{U}{eus}{m}{n}
% \newcommand{\PPP}{{\eucal P}}
\DeclareMathAlphabet{\newcal}{U}{dutchcal}{m}{n}
\newcommand{\PPP}{{\mathcal P}}
\def\frakR{{\newcal R}}
\def\RRR{{\newcal R}}

% \def\Mob{\bold M \bold o \bold b} 
\def\Mob{\text{\bf M\"ob}}   


\def\Z{\ZZ} \def\Q{\QQ}   \def\fd{\mathfrak d} \def\pp{\partial}
  
\def\ev{{\rm ev}}  \def\Ev{{\rm Ev}}  \def\evX{\Ev}
\def\evh{\ev}
\def\brX#1{\bigl\langle#1\bigr\rangle_X}   \def\sbrX#1{\langle#1\rangle_X}
\def\brh#1{\bigl\langle#1\bigr\rangle_\hslash}
\def\sbrh#1{\langle#1\rangle_\hslash}
\def\Gv{\mathfrak G} \def\Gva{\mathfrak G_{asy}} 
 \def\Br{\mathfrak{B}} \def\br{\mathfrak{b}}
\def\wta{\widetilde a} \def\wtb{\widetilde b} \def\wtc{\widetilde c}
\def\la{\langle}  \def\ra{\rangle}




%% overlined and underlined, tilde
\def\ov#1{\overline{#1}} \def\t#1{\tilde{#1}}  \def\wt#1{\widetilde{#1}}   \def\wh#1{\widehat{#1}}  
\newcommand{\ol}{\overline}  \newcommand{\ul}{\underline}  \newcommand{\ulx}{\underline{x}}


%% objects with tilde

\def\tz{\wt z} \def\tg{\wt g} \def\tc{\wt c} \def\tJ{\wt J} \def\tf{\wt f}   \def\tv{\wt v}
\def\tA{\wt A} \def\tB{\wt B}  \def\tQ{\wt Q}  \def\ty{\wt y} \def\tx{\wt x} \def\tm{\wt m}
\def\tq{\wt q}  \def\tom{\wt\om}   \def\uz{\underline z}
\def\tL{\wt L} \def\tit{\wt t}  
\def\wT{\wt T}  \def\wM{\wt M} 

%% objects with hat
\def\hm{\hat{m}}
\def\wF{\widehat F}  
\def\wG{\widehat G}  

%% Lie groups
\def\SL{{\textrm{SL}}}
\def\GL{{\textrm{GL}}}
\def\PSL{{\textrm PSL}}
\newcommand{\SO}{{\rm SO}}
\newcommand{\Sp}{{\rm Sp}}
\newcommand{\QM}{{\rm QM}}
\newcommand{\SP}{{\rm SP}}
\newcommand{\OP}{{\rm OP}}
%%% special brackets
\DeclareMathOperator{\lda}{\langle\langle}
\DeclareMathOperator{\rda}{\rangle\rangle}
\def\bq#1{\bigl\langle#1\bigr\rangle_q}   \def\sbq#1{\langle#1\rangle_q}
\def\bqs#1{\bigl\langle#1\bigr\rangle_q^\star}   \def\sbqs#1{\langle#1\rangle_q^\star}  
\def\bL#1{\bigl\langle#1\bigr\rangle_L}   \def\sbL#1{\langle#1\rangle_L}
\def\bX#1{\bigl\langle#1\bigr\rangle_X}   \def\sbX#1{\langle#1\rangle_X}
\def\rs{\rho^\star}

\def\bstr#1{\bigl\langle#1\bigr\rangle_{\rm str}}
\def\sbstr#1{\langle#1\rangle_{\rm str}}
\def\bsL#1{\bigl\langle#1\bigr\rangle_{{\rm str},L}}
\def\sbsL#1{\langle#1\rangle_{{\rm str},L}}


%%% shortcuts for greek letters
\def\a{\alpha} \def\b{\beta}  \def\th{\theta}   \def\v{\varepsilon} \newcommand{\ve}{{\varepsilon}}
\def\g{\gamma}  \def\w{\delta} \def\l{\lambda} 
\newcommand{\gr}{\nabla}  
\def\om{\omega}  \def\s{\sigma} \def\t{\tau} \def\z{\zeta}  \def\p{\partial}  \def\ph{\varphi}
\def\G{\Gamma}  \def\L{\Lambda} \def\D{\Delta}  \def\Th{\Theta}   \def\Om{\Omega}

%%% shortform of matrices
\def\sm#1#2#3#4{\bigl(\smallmatrix#1&#2\\#3&#4\endsmallmatrix\bigr)} 
\def\mat#1#2#3#4{\begin{pmatrix}#1&#2\\#3&#4\\ \end{pmatrix}}    \def\MT{\frac{az+b}{cz+d}}  

%%%%%%%%%%%%%% equations
\def\be{\begin{equation}}   \def\ee{\end{equation}}     \def\bes{\begin{equation*}}    \def\ees{\end{equation*}}
\def\ba{\be\begin{aligned}} \def\ea{\end{aligned}\ee}   \def\bas{\bes\begin{aligned}}  \def\eas{\end{aligned}\ees}

%%%%%%%%%%%%%% Moduli spaces %%%%%%%%%%%%%%%%%%%%%
\newcommand{\proj}{{\mathbb P}}
\newcommand{\moduli}[1][g]{{\mathcal M}_{#1}}
\newcommand{\omoduli}[1][g]{{\Omega \mathcal M}_{#1}}
\newcommand{\oamoduli}[1][g]{{\Omega_1 \mathcal M}_{#1}}
\newcommand{\barmoduli}[1][g]{{\overline{\mathcal M}}_{#1}}
\newcommand{\obarmoduli}[1][g]{{\overline{\Omega\mathcal M}}_{#1}}
\newcommand{\smoduli}[1][g]{{\mathcal S}_{#1}}
\newcommand{\barsmoduli}[1][g]{{\overline{\mathcal S}}_{#1}}
\newcommand{\pobarmoduli}[1][g]{{\proj\Omega\overline{\mathcal M}}_{#1}}

\def\M{\cMM}  \def\OmM{\Omega\M}
\newcommand{\oM}{\overline{\mathcal M}}
\newcommand{\oOmM}{\overline{\Omega\M}}
\newcommand{\oH}{\overline{\mathcal H}}

%%%%%%%%%%%%%%%%%%%%%% shortcuts making a global change of notation possible
\newcommand{\Teichmuller}{Teich\-m\"uller}
\newcommand{\BH}{\overline{H}}
\newcommand{\Hmu}{\Pi}
\newcommand{\he}{{\rm h}{\rm t}} 
\newcommand{\hgt}{{\rm ht}} 
\newcommand{\pd}{d}
\newcommand{\hd}{ ^{\bullet}}  
%\newcommand{\evX}{{\bf e}{\bf v}^X}
%\newcommand{\evh}{{\bf e}{\bf v}^h}
\newcommand{\Asy}{{\bf A}}
\newcommand{\Part}{{\P}} % for partitions. HAS NOT BEEN USED THROUGHOUT


\newcommand{\lra}{\leftrightarrow}
\newcommand{\twi}{I}
\newcommand{\ES}{E_{0, \{1,2 \}}}
\newcommand{\BB}{{\mathrm{BB}}}
\newcommand{\ABB}{{\mathrm{ABB}}}
\newcommand{\ms}{\scalebox{0.75}[1.0]{$-$}}


%%%%%%%%%%%%%%%%% formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcounter{savedtocdepth}
\newcommand*{\SaveTocDepth}[1]{%
  \addtocontents{toc}{%
    \protect\setcounter{savedtocdepth}{\protect\value{tocdepth}}%
    \protect\setcounter{tocdepth}{#1}%
  }%
}

\newcommand*{\RestoreTocDepth}{%
  \addtocontents{toc}{%
    \protect\setcounter{tocdepth}{\protect\value{savedtocdepth}}%
  }%
}

\DeclareDocumentCommand{\LMS}{ O{\mu} O{g}} {\Xi\mathcal{M}_{#2}(#1)}
\newcommand{\one}{{\bf 1}_N}
\newcommand{\changed}[1]{{\color{red} #1}}

