%
% PACKAGES
%

% Standard Packages
\usepackage{babel}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\usepackage{mathtools}
\usepackage{varioref}
\usepackage[arrow,curve,matrix]{xy}

% Graphics Packages
\usepackage{colortbl}
\usepackage{graphicx}
\usepackage{tikz}

% von Jakob
\usepackage{caption}
\usepackage{subcaption}


% Font packages
\usepackage{mathrsfs}


%
% GENERAL TYPESETTING
%

% Colours for hyperlinks
\definecolor{linkred}{rgb}{0.7,0.2,0.2}
\definecolor{linkblue}{rgb}{0,0.2,0.6}

% Limit table of contents to section titles
\setcounter{tocdepth}{1}

% Numbering of figures (see below for numbering of equations)
\numberwithin{figure}{section}

% Add an uparrow to the bibliography entries, just before the back-list of references
\usepackage[hyperpageref]{backref}
\renewcommand{\backref}[1]{$\uparrow$~#1}

% Numbering of parts in roman numbers
\renewcommand\thepart{\Roman{part}}

% Sloppy formatting -- often looks better
\sloppy

% Changes the layout of descriptions and itemized lists.  The indent specified in
% the original amsart style is too much for my taste.
\setdescription{labelindent=\parindent, leftmargin=2\parindent}
\setitemize[1]{labelindent=\parindent, leftmargin=2\parindent}
\setenumerate[1]{labelindent=0cm, leftmargin=*, widest=iiii}

%
% Input characters
%
\newunicodechar{α}{\ensuremath{α}}
\newunicodechar{β}{\ensuremath{β}}
\newunicodechar{χ}{\ensuremath{χ}}
\newunicodechar{δ}{\ensuremath{δ}}
\newunicodechar{ε}{\ensuremath{ε}}
\newunicodechar{Δ}{\ensuremath{Δ}}
\newunicodechar{η}{\ensuremath{η}}
\newunicodechar{γ}{\ensuremath{γ}}
\newunicodechar{Γ}{\ensuremath{Γ}}
\newunicodechar{ι}{\ensuremath{ι}}
\newunicodechar{κ}{\ensuremath{κ}}
\newunicodechar{λ}{\ensuremath{λ}}
\newunicodechar{Λ}{\ensuremath{Λ}}
\newunicodechar{ν}{\ensuremath{ν}}
\newunicodechar{μ}{\ensuremath{μ}}
\newunicodechar{ω}{\ensuremath{ω}}
\newunicodechar{Ω}{\ensuremath{Ω}}
\newunicodechar{π}{\ensuremath{π}}
\newunicodechar{Π}{\ensuremath{\Pi}}
\newunicodechar{φ}{\ensuremath{φ}}
\newunicodechar{Φ}{\ensuremath{Φ}}
\newunicodechar{ψ}{\ensuremath{ψ}}
\newunicodechar{Ψ}{\ensuremath{Ψ}}
\newunicodechar{ρ}{\ensuremath{ρ}}
\newunicodechar{σ}{\ensuremath{σ}}
\newunicodechar{Σ}{\ensuremath{Σ}}
\newunicodechar{τ}{\ensuremath{τ}}
\newunicodechar{θ}{\ensuremath{θ}}
\newunicodechar{Θ}{\ensuremath{Θ}}
\newunicodechar{ξ}{\ensuremath{ξ}}
\newunicodechar{Ξ}{\ensuremath{Ξ}}
\newunicodechar{ζ}{\ensuremath{ζ}}

\newunicodechar{ℓ}{\ensuremath{ℓ}}
\newunicodechar{ï}{\"{\i}}

\newunicodechar{𝔸}{\ensuremath{𝔸}}
\newunicodechar{𝔹}{\ensuremath{𝔹}}
\newunicodechar{ℂ}{\ensuremath{ℂ}}
\newunicodechar{𝔻}{\ensuremath{𝔻}}
\newunicodechar{𝔼}{\ensuremath{𝔼}}
\newunicodechar{𝔽}{\ensuremath{𝔽}}
\newunicodechar{ℕ}{\ensuremath{ℕ}}
\newunicodechar{ℙ}{\ensuremath{ℙ}}
\newunicodechar{ℚ}{\ensuremath{ℚ}}
\newunicodechar{ℝ}{\ensuremath{ℝ}}
\newunicodechar{𝕏}{\ensuremath{𝕏}}
\newunicodechar{ℤ}{\ensuremath{ℤ}}
\newunicodechar{𝒜}{\ensuremath{𝒜}}
\newunicodechar{ℬ}{\ensuremath{ℬ}}
\newunicodechar{𝒞}{\ensuremath{𝒞}}
\newunicodechar{𝒟}{\ensuremath{𝒟}}
\newunicodechar{ℰ}{\ensuremath{ℰ}}
\newunicodechar{ℱ}{\ensuremath{ℱ}}
\newunicodechar{𝒢}{\ensuremath{𝒢}}
\newunicodechar{ℋ}{\ensuremath{ℋ}}
\newunicodechar{𝒥}{\ensuremath{𝒥}}
\newunicodechar{ℒ}{\ensuremath{ℒ}}
\newunicodechar{𝒪}{\ensuremath{𝒪}}
\newunicodechar{𝒬}{\ensuremath{𝒬}}
\newunicodechar{𝒯}{\ensuremath{𝒯}}
\newunicodechar{𝒲}{\ensuremath{𝒲}}

\newunicodechar{∂}{\ensuremath{∂}}
\newunicodechar{∇}{\ensuremath{∇}}

\newunicodechar{↺}{\ensuremath{↺}}
\newunicodechar{∞}{\ensuremath{∞}}
\newunicodechar{⊕}{\ensuremath{⊕}}
\newunicodechar{⊗}{\ensuremath{⊗}}
\newunicodechar{•}{\ensuremath{•}}
\newunicodechar{Λ}{\ensuremath{Λ}}
\newunicodechar{↪}{\ensuremath{↪}}
\newunicodechar{→}{\ensuremath{→}}
\newunicodechar{↦}{\ensuremath{↦}}
\newunicodechar{⨯}{\ensuremath{⨯}}
\newunicodechar{∪}{\ensuremath{∪}}
\newunicodechar{∩}{\ensuremath{∩}}
\newunicodechar{⊋}{\ensuremath{⊋}}
\newunicodechar{⊇}{\ensuremath{⊇}}
\newunicodechar{⊃}{\ensuremath{⊃}}
\newunicodechar{⊊}{\ensuremath{⊊}}
\newunicodechar{⊆}{\ensuremath{⊆}}
\newunicodechar{⊂}{\ensuremath{⊂}}
\newunicodechar{⊄}{\ensuremath{⊄}}
\newunicodechar{≥}{\ensuremath{≥}}
\newunicodechar{≠}{\ensuremath{≠}}
\newunicodechar{≫}{\ensuremath{≫}}
\newunicodechar{≪}{\ensuremath{≪}}

\newunicodechar{≤}{\ensuremath{≤}}
\newunicodechar{∈}{\ensuremath{∈}}
\newunicodechar{∉}{\ensuremath{\not ∈}}
\newunicodechar{∖}{\ensuremath{∖}}
\newunicodechar{◦}{\ensuremath{◦}}
\newunicodechar{°}{\ensuremath{°}}
\newunicodechar{…}{\ifmmode\mathellipsis\else\textellipsis\fi}
\newunicodechar{·}{\ensuremath{·}}
\newunicodechar{⋯}{\ensuremath{⋯}}
\newunicodechar{∅}{\ensuremath{∅}}
\newunicodechar{⇒}{\ensuremath{⇒}}

\newunicodechar{⁰}{\ensuremath{⁰}}
\newunicodechar{¹}{\ensuremath{¹}}
\newunicodechar{²}{\ensuremath{²}}
\newunicodechar{³}{\ensuremath{³}}
\newunicodechar{⁴}{\ensuremath{⁴}}
\newunicodechar{⁵}{\ensuremath{⁵}}
\newunicodechar{⁶}{\ensuremath{⁶}}
\newunicodechar{⁷}{\ensuremath{⁷}}
\newunicodechar{⁸}{\ensuremath{⁸}}
\newunicodechar{⁹}{\ensuremath{⁹}}
\newunicodechar{ⁱ}{\ensuremath{ⁱ}}

\newunicodechar{⌈}{\ensuremath{⌈}}
\newunicodechar{⌉}{\ensuremath{⌉}}
\newunicodechar{⌊}{\ensuremath{⌊}}
\newunicodechar{⌋}{\ensuremath{⌋}}

\newunicodechar{≅}{\ensuremath{≅}}
\newunicodechar{⇔}{\ensuremath{⇔}}
\newunicodechar{∃}{\ensuremath{∃}}
\newunicodechar{±}{\ensuremath{±}}


%
% FONT DEFINTIONS
%

% Script Font used for sheaves
\DeclareFontFamily{OMS}{rsfs}{\skewchar\font'60}
\DeclareFontShape{OMS}{rsfs}{m}{n}{<-5>rsfs5 <5-7>rsfs7 <7->rsfs10 }{}
\DeclareSymbolFont{rsfs}{OMS}{rsfs}{m}{n}
\DeclareSymbolFontAlphabet{\scr}{rsfs}
\DeclareSymbolFontAlphabet{\scr}{rsfs}

% Code from mathabx.sty and mathabx.dcl, define macro \wcheck
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
      <5> <6> <7> <8> <9> <10>
      <10.95> <12> <14.4> <17.28> <20.74> <24.88>
      mathx10
      }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\wcheck}{0}{mathx}{"71}


%
% MATHEMATICS DEFINITIONS
%

% Operators
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\const}{const}
\DeclareMathOperator{\Ext}{Ext}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Id}{Id}
\DeclareMathOperator{\Image}{Image}
\DeclareMathOperator{\img}{img}
\DeclareMathOperator{\Pic}{Pic}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Ramification}{Ramification}
\DeclareMathOperator{\red}{red}
\DeclareMathOperator{\reg}{reg}
\DeclareMathOperator{\sat}{sat}
\DeclareMathOperator{\sEnd}{ℰ\negthinspace \mathit{nd}}
\DeclareMathOperator{\sing}{sing}
\DeclareMathOperator{\Spec}{Spec}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\tor}{tor}
\DeclareMathOperator{\Tor}{Tor}
\DeclareMathOperator{\Frob}{Frob}

% Sheaves
\newcommand{𝒜}{\scr{A}}
\newcommand{ℬ}{\scr{B}}
\newcommand{𝒞}{\scr{C}}
\newcommand{𝒟}{\scr{D}}
\newcommand{ℰ}{\scr{E}}
\newcommand{ℱ}{\scr{F}}
\newcommand{𝒢}{\scr{G}}
\newcommand{ℋ}{\scr{H}}
\newcommand{\sHom}{\scr{H}\negthinspace om}
\newcommand{\sI}{\scr{I}}
\newcommand{𝒥}{\scr{J}}
\newcommand{\sK}{\scr{K}}
\newcommand{ℒ}{\scr{L}}
\newcommand{ℳ}{\scr{M}}
\newcommand{\sN}{\scr{N}}
\newcommand{𝒪}{\scr{O}}
\newcommand{\sP}{\scr{P}}
\newcommand{𝒬}{\scr{Q}}
\newcommand{\sR}{\scr{R}}
\newcommand{𝒮}{\scr{S}}
\newcommand{𝒯}{\scr{T}}
\newcommand{\sU}{\scr{U}}
\newcommand{\sV}{\scr{V}}
\newcommand{𝒲}{\scr{W}}
\newcommand{\sX}{\scr{X}}
\newcommand{\sY}{\scr{Y}}
\newcommand{\sZ}{\scr{Z}}

% C-infty sheaves
\newcommand{\cA}{\mathcal A}
\newcommand{\cC}{\mathcal C}
\newcommand{\cD}{\mathcal D}
\newcommand{\cE}{\mathcal E}
\newcommand{\cM}{\mathcal M}
\newcommand{\cN}{\mathcal N}
\newcommand{\cV}{\mathcal V}

% Blackboard Bold Symbols
\newcommand{𝔸}{\mathbb{A}}
\newcommand{𝔹}{\mathbb{B}}
\newcommand{ℂ}{\mathbb{C}}
\newcommand{𝔻}{\mathbb{D}}
\newcommand{𝔼}{\mathbb{E}}
\newcommand{𝔽}{\mathbb{F}}
\newcommand{𝔾}{\mathbb{G}}
\newcommand{\bH}{\mathbb{H}}
\newcommand{\bI}{\mathbb{I}}
\newcommand{\bJ}{\mathbb{J}}
\newcommand{\bK}{\mathbb{K}}
\newcommand{\bL}{\mathbb{L}}
\newcommand{\bM}{\mathbb{M}}
\newcommand{ℕ}{\mathbb{N}}
\newcommand{\bO}{\mathbb{O}}
\newcommand{ℙ}{\mathbb{P}}
\newcommand{ℚ}{\mathbb{Q}}
\newcommand{ℝ}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bT}{\mathbb{T}}
\newcommand{\bU}{\mathbb{U}}
\newcommand{\bV}{\mathbb{V}}
\newcommand{\bW}{\mathbb{W}}
\newcommand{𝕏}{\mathbb{X}}
\newcommand{\bY}{\mathbb{Y}}
\newcommand{ℤ}{\mathbb{Z}}

% Sans serif symbols
\newcommand{\aB}{{\sf B}}
\newcommand{\aD}{{\sf D}}
\newcommand{\aE}{{\sf E}}
\newcommand{\aF}{{\sf F}}


% Theorem type environments
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\newtheorem{aassumption}[thm]{Additional Assumption}
\newtheorem{conjecture}[thm]{Conjecture}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{defn}[thm]{Definition}
\newtheorem{fact}[thm]{Fact}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{lemDef}[thm]{Lemma and Definition}
\newtheorem{lemNot}[thm]{Lemma and Notation}
\newtheorem{problem}[thm]{Problem}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{setup}[thm]{Setup}
\newtheorem{subthm}[thm]{Sub-Theorem}
\newtheorem{summary}[thm]{Summary}
\theoremstyle{remark}
\newtheorem{assumption}[thm]{Assumption}
\newtheorem{asswlog}[thm]{Assumption w.l.o.g.}
\newtheorem{claim}[thm]{Claim}
\newtheorem{c-n-d}[thm]{Claim and Definition}
\newtheorem{consequence}[thm]{Consequence}
\newtheorem{construction}[thm]{Construction}
\newtheorem{computation}[thm]{Computation}
\newtheorem{example}[thm]{Example}
\newtheorem{explanation}[thm]{Explanation}
\newtheorem{notation}[thm]{Notation}
\newtheorem{obs}[thm]{Observation}
\newtheorem{rem}[thm]{Remark}
\newtheorem{question}[thm]{Question}
\newtheorem*{rem-nonumber}{Remark}
\newtheorem{setting}[thm]{Setting}
\newtheorem{warning}[thm]{Warning}

% Numbering of equations.  Number equation subordniate to theorems.
\numberwithin{equation}{thm}

% Style for enumerated lists.  The following makes sure that enumerated lists are
% numbered in the same way as equations are.
\setlist[enumerate]{label=(\thethm.\arabic*), before={\setcounter{enumi}{\value{equation}}}, after={\setcounter{equation}{\value{enumi}}}}

% Shorthand notations
\newcommand{↪}{↪}
\newcommand{\onto}{\twoheadrightarrow}
\newcommand{\wtilde}{\widetilde}
\newcommand{\what}{\widehat}

%
% HYPENTATION
%

\hyphenation{com-po-nents}
\hyphenation{pos-i-tive}
\hyphenation{Theo-rem}
\hyphenation{Vojta}


%
% SPECIALIZED MACROS
%

% CounterStep - increases equation counter
\newcommand\CounterStep{\addtocounter{thm}{1}\setcounter{equation}{0}}

% factor - quotient groups
\newcommand{\factor}[2]{\left.  \raise 2pt\hbox{$#1$} \right/\hskip -2pt\raise -2pt\hbox{$#2$}}
