\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{FPSACmoduli}


% all styling here

%% Editing comments
\def\seeEditComments{1} % 1 to see edit comments, 0 to hide them

%% Load Packages
    
    
    \RequirePackage{amsmath, amssymb, amsthm}
    \RequirePackage{hyperref}
    
    % for drawing and commutative diagrams
    \RequirePackage{tikz, tikz-cd}
    \RequirePackage{mathtools,blkarray}
    \RequirePackage{algorithmicx,algpseudocode}
    \RequirePackage{stmaryrd}
    \RequirePackage{graphicx,color,xcolor,soul}
    \RequirePackage{float,multirow}
    \RequirePackage{caption,subcaption}
    \RequirePackage{algorithm}
    \RequirePackage{indentfirst, enumitem}
    
    \RequirePackage{blkarray}
    \RequirePackage{eqnarray}
    
    \RequirePackage{listings}
    \RequirePackage{diagbox}
    
    \RequirePackage{comment}

    


%% END of packages





%% Theorem-like environments

    
    % other types have the same numbering as "Theorem"
    \theoremstyle{plain}
    
    \newtheorem{thm}{Theorem}[section]
    \newtheorem{lem}[thm]{Lemma}
    \newtheorem{cor}[thm]{Corollary}
    \newtheorem{prop}[thm]{Proposition}
    \newtheorem{conj}[thm]{Conjecture}
    
    \theoremstyle{definition}
    \newtheorem{defn}[thm]{Definition}
    \newtheorem{exmp}[thm]{Example}


    \theoremstyle{definition}
    \newtheorem{rmk}[thm]{Remark}
    
    % Each type has independent numbering
    
    % \theoremstyle{plain}
    % \newtheorem{thm}{Theorem}[section]
    % \newtheorem{lem}{Lemma}[section]
    % \newtheorem{cor}{Corollary}[section]
    % \newtheorem{prop}{Proposition}[section] 
    % \newtheorem{conj}{Conjecture}
    
    % \theoremstyle{definition}
    % \newtheorem{defn}{Definition}[section]
    % \newtheorem{exmp}{Example}[section]


%% mathbb
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Zge}{\Z_{\ge 0}} % non-negative integers
\newcommand{\Zgt}{\Z_{> 0}} % positive integers
\newcommand{\C}{\mathbb{C}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\van}{\mathbb{V}} % vanishing set - zero locus
\newcommand{\Pj}{\mathbb{P}} % projective
\newcommand{\A}{\mathbb{A}} % affine


% mathfrak
\newcommand{\mfa}{\mathfrak{a}}
\newcommand{\mfb}{\mathfrak{b}}
\newcommand{\mfc}{\mathfrak{c}}
\newcommand{\mfd}{\mathfrak{d}}
\newcommand{\mfe}{\mathfrak{e}}
\newcommand{\mff}{\mathfrak{f}}
\newcommand{\mfg}{\mathfrak{g}}
\newcommand{\mfh}{\mathfrak{h}}
\newcommand{\mfi}{\mathfrak{i}}
\newcommand{\mfj}{\mathfrak{j}}
\newcommand{\mfk}{\mathfrak{k}}
\newcommand{\mfl}{\mathfrak{l}}
\newcommand{\mfm}{\mathfrak{m}}
\newcommand{\mfn}{\mathfrak{n}}
\newcommand{\mfo}{\mathfrak{o}}
\newcommand{\mfp}{\mathfrak{p}}
\newcommand{\mfq}{\mathfrak{q}}
\newcommand{\mfr}{\mathfrak{r}}
\newcommand{\mfs}{\mathfrak{s}}
\newcommand{\mft}{\mathfrak{t}}
\newcommand{\mfu}{\mathfrak{u}}
\newcommand{\mfv}{\mathfrak{v}}
\newcommand{\mfw}{\mathfrak{w}}
\newcommand{\mfx}{\mathfrak{x}}
\newcommand{\mfy}{\mathfrak{y}}
\newcommand{\mfz}{\mathfrak{z}}
\newcommand{\mfA}{\mathfrak{A}}
\newcommand{\mfB}{\mathfrak{B}}
\newcommand{\mfC}{\mathfrak{C}}
\newcommand{\mfD}{\mathfrak{D}}
\newcommand{\mfE}{\mathfrak{E}}
\newcommand{\mfF}{\mathfrak{F}}
\newcommand{\mfG}{\mathfrak{G}}
\newcommand{\mfH}{\mathfrak{H}}
\newcommand{\mfI}{\mathfrak{I}}
\newcommand{\mfJ}{\mathfrak{J}}
\newcommand{\mfK}{\mathfrak{K}}
\newcommand{\mfL}{\mathfrak{L}}
\newcommand{\mfM}{\mathfrak{M}}
\newcommand{\mfN}{\mathfrak{N}}
\newcommand{\mfO}{\mathfrak{O}}
\newcommand{\mfP}{\mathfrak{P}}
\newcommand{\mfQ}{\mathfrak{Q}}
\newcommand{\mfR}{\mathfrak{R}}
\newcommand{\mfS}{\mathfrak{S}}
\newcommand{\mfT}{\mathfrak{T}}
\newcommand{\mfU}{\mathfrak{U}}
\newcommand{\mfV}{\mathfrak{V}}
\newcommand{\mfW}{\mathfrak{W}}
\newcommand{\mfX}{\mathfrak{X}}
\newcommand{\mfY}{\mathfrak{Y}}
\newcommand{\mfZ}{\mathfrak{Z}}

% mathcal
\newcommand{\mcA}{\mathcal{A}}
\newcommand{\mcB}{\mathcal{B}}
\newcommand{\mcC}{\mathcal{C}}
\newcommand{\mcD}{\mathcal{D}}
\newcommand{\mcE}{\mathcal{E}}
\newcommand{\mcF}{\mathcal{F}}
\newcommand{\mcG}{\mathcal{G}}
\newcommand{\mcH}{\mathcal{H}}
\newcommand{\mcI}{\mathcal{I}}
\newcommand{\mcJ}{\mathcal{J}}
\newcommand{\mcK}{\mathcal{K}}
\newcommand{\mcL}{\mathcal{L}}
\newcommand{\mcM}{\mathcal{M}}
\newcommand{\mcN}{\mathcal{N}}
\newcommand{\mcO}{\mathcal{O}}
\newcommand{\mcP}{\mathcal{P}}
\newcommand{\mcQ}{\mathcal{Q}}
\newcommand{\mcR}{\mathcal{R}}
\newcommand{\mcS}{\mathcal{S}}
\newcommand{\mcT}{\mathcal{T}}
\newcommand{\mcU}{\mathcal{U}}
\newcommand{\mcV}{\mathcal{V}}
\newcommand{\mcW}{\mathcal{W}}
\newcommand{\mcX}{\mathcal{X}}
\newcommand{\mcY}{\mathcal{Y}}
\newcommand{\mcZ}{\mathcal{Z}}


%% math operators
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\Spec}{Spec}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\Br}{Br}
\DeclareMathOperator{\val}{val}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\Bl}{Bl}
\DeclareMathOperator{\Mar}{Mar}
\DeclareMathOperator{\GL}{GL}
\DeclareMathOperator{\aff}{aff}
\DeclareMathOperator{\Int}{int}
\DeclareMathOperator{\rank}{rank}

\DeclareMathOperator{\Conf}{Conf}


% ordered (planar) rooted trees with every internal vertex having >=2 children
\DeclareMathOperator{\Rtree}{Rtree}

% (full) binary trees subset of stable rooted trees
% \DeclareMathOperator{\BinRtree}{BinRtree}

% stable rooted trees
\DeclareMathOperator{\StRtree}{StRtree}

% refined stable rooted trees
\DeclareMathOperator{\RStRtree}{RStRtree}


% \DeclareMathOperator{\Rleaf}{Rleaf}
% \DeclareMathOperator{\Lleaf}{Lleaf}
% \DeclareMathOperator{\attach}{attach}


%% add "^*" for recursive flips

% flip nonrecursively at a vertex including root
\DeclareMathOperator{\flip}{flip}

% flip at a root
\DeclareMathOperator{\rflip}{rflip}

% flip at any vertex but the root
\DeclareMathOperator{\nrflip}{\overline{rflip}}


%%% general math related mcros

% embedding into
\newcommand{\into}{\hookrightarrow}

% surjects onto
\newcommand{\onto}{\twoheadrightarrow}


% white circle
\newcommand{\whitecircle}{\tikz\draw[black,fill=white] (0,0) circle (.5ex);}

% ceiling and floor commands
\newcommand{\ceil}[1]{\lceil {#1}\rceil}
\newcommand{\floor}[1]{\lfloor {#1}\rfloor}

% raise to the power of -1
\newcommand{\inv}[1]{{#1}^{-1}}

% set subtraction 
\newcommand{\ssub}{\setminus}

% \subto{x}{n} yields x_1...x_n
\newcommand{\subto}[2]{{#1}_1\hdots{#1}_{#2}}

% \subtoComma{x}{n} yields x_1,...,x_n
\newcommand{\subtoComma}[2]{{#1}_1,\hdots,{#1}_{#2}}


% zero vector (arrow on top)
\newcommand{\veczero}{\vec{0}}

% double cover notation
% \newcommand{\DC}[1]{{#1}^{2:1}}
\newcommand{\DC}[1]{\widetilde{#1}}

% generator or generated by
\newcommand{\gen}[1]{\langle {#1} \rangle}

% WLOG
\newcommand{\WLOG}{Without loss of generality}

%SES
\newcommand{\SES}{short exact sequence\ }


\newcommand{\littlecell}{\tau_{\text{little}}}
\newcommand{\bigcell}{\tau_{\text{big}}}


%%% Utility for M_0,n-bar and Hassett space

% typeset M_0,n given the n parameter
\newcommand{\moduli}[1]{M_{0,{#1}}}
\newcommand{\moduliDC}[1]{\DC{M_{0,#1}}}
\newcommand{\DMumford}[1]{\overline{\moduli{#1}}}

%deprecate
\newcommand{\DMumfordDC}[1]{\overline{\moduliDC{#1}}}

% symmetric hassett space with weight \mcA(a), a: parameter
\newcommand{\hassett}[1]{\DMumford{\mcA({#1})}}
\newcommand{\hassettDC}[1]{\moduliDC{\mcA({#1})}}


    %% Draw a marked point on a tree of P^1's
    % Arguments:
    % #1 The tikz node corresponding to the component (P^1 bubble) containing this marked point
    % #2 Angle in degrees (from rightmost CCW) to place the marked point
    % #3 Label on the outside
    % #4 label on the inside
    \newcommand{\markedpoint}[4]{
    \node[black, % with the color defined by the macro
             draw, %thick, % draw the outline
             fill, % fill it
             inner sep = 0pt, % not too big
             minimum size=1.5mm, % set the size
             circle, % circular shape
             label={ {#2} : {#4} }, % add the number on the inside
             label = {{#2+180} : {#3} }  % add the number on the outside
             ] at ({#1}.{#2}) % position it on the edge of the main circle
              {}
    }



%%% Macros for some rooted tree drawings

%% Tree with 2 leaves
% #1 - label of the left leaf
% #2 - right leaf
\newcommand{\trivialTree}[2]{


                        %leaves
                        \node [circle, draw, fill, inner sep =1pt, label = { 90:  {#1}}] (node_1_-1) at (1,-2) {};
                        \node [circle, draw, fill, inner sep =1pt, label = { 90: {#2}}] (node_5'0_-2) at (5.0,-2) {};
                        
                        %root
                        \node [circle, draw, fill, inner sep =1pt, label = { 90:  }] (node_3'0_-3) at (3.0,-4) {};

                        %edges
                        \draw[] (node_3'0_-3) -- (node_1_-1);
                        \draw[] (node_3'0_-3) -- (node_5'0_-2);
                        
                    
}


 \newcommand{\deprecate}[1]{\par\ {\color{gray}{\hrulefill\\
 \underline{\textbf{Deprecated (will be removed soon): }\\} {#1} }~\\
 }
 \hrulefill
 }


% EXTRA logic

\if\seeEditComments1
    \newcommand{\plan}[1]{\par\textcolor{blue}{\underline{\textbf{Plan: }} {#1}}~\\}
    \newcommand{\JL}[1]{\par\ {\color{red}{JL: {#1}}}}
    \newcommand{\HL}[1]{\par\ {\color{blue}{\underline{\textbf{HL: }} {#1}}}~\\}
\fi
\if\seeEditComments0
    \newcommand{\plan}[1]{}
    \newcommand{\JL}[1]{}
    \newcommand{\HL}[1]{}
\fi


