\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sciencestuff}[2020/04/08 Science related stuff]

\RequirePackage{amsmath} %--------------------- math mode
\RequirePackage{amssymb} %--------------------- math symbols
\RequirePackage{amsfonts} %-------------------- math fonts
\RequirePackage{mathtools} %------------------- mathematical tools
\RequirePackage{mathrsfs} %-------------------- better cal
\RequirePackage{slashed} %--------------------- slashed characters
\RequirePackage{tensor} %---------------------- write tensors
\RequirePackage{listings} %-------------------- code sections
\RequirePackage[amsmath,
                hyperref,
                framed]{ntheorem} %------------ improved theorem envoronment
\RequirePackage{dsfont} %---------------------- improved math set symbols
\RequirePackage{upgreek} %--------------------- better Greek alphabet
\RequirePackage{physics} %--------------------- full physics-related commands
\RequirePackage{siunitx} %--------------------- SI units formatting
\RequirePackage{graphicx} %-------------------- images and figures
\RequirePackage{ifthen} %---------------------- conditionals
\RequirePackage[sort&compress,
                english]{cleveref} %----------- nicer citations and references
\RequirePackage[compat=1.1.0]{tikz-feynman} %-- Feynman diagrams

\ProcessOptions\relax

%---- prepare packages
\tikzfeynmanset{/tikzfeynman/warn luatex=false}

\lstset{%
    language=Python,
    tabsize=4,
    morecomment=[l]{\#},
    basicstyle=\ttfamily\small,
    showstringspaces=false,
    captionpos=b,
    breaklines=true
}
\lstset{escapeinside={(*@}{@*)}}
\lstdefinestyle{boxed}{frame=single, numbers=left}

%---- numbering (number equations, figures and tables within section)

\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}

%---- remap greek letters

\renewcommand{\alpha}{\upalpha\xspace}
\renewcommand{\beta}{\upbeta\xspace}
\renewcommand{\gamma}{\upgamma\xspace}
\renewcommand{\delta}{\updelta\xspace}
\renewcommand{\epsilon}{\upepsilon\xspace}
\renewcommand{\zeta}{\upzeta\xspace}
\renewcommand{\eta}{\upeta\xspace}
\renewcommand{\theta}{\uptheta\xspace}
\renewcommand{\iota}{\upiota\xspace}
\renewcommand{\kappa}{\upkappa\xspace}
\renewcommand{\lambda}{\uplambda\xspace}
\renewcommand{\mu}{\upmu\xspace}
\renewcommand{\nu}{\upnu\xspace}
\renewcommand{\xi}{\upxi\xspace}
\renewcommand{\pi}{\uppi\xspace}
\renewcommand{\rho}{\uprho\xspace}
\renewcommand{\sigma}{\upsigma\xspace}
\renewcommand{\tau}{\uptau\xspace}
\renewcommand{\upsilon}{\upupsilon\xspace}
\renewcommand{\phi}{\upphi\xspace}
\renewcommand{\chi}{\upchi\xspace}
\renewcommand{\psi}{\uppsi\xspace}
\renewcommand{\omega}{\upomega\xspace}
\renewcommand{\varepsilon}{\upvarepsilon\xspace}
\renewcommand{\vartheta}{\upvartheta\xspace}
\renewcommand{\varpi}{\upvarpi\xspace}
\renewcommand{\varphi}{\upvarphi\xspace}
\renewcommand{\Gamma}{\Upgamma\xspace}
\renewcommand{\Delta}{\Updelta\xspace}
\renewcommand{\Theta}{\Uptheta\xspace}
\renewcommand{\Lambda}{\Uplambda\xspace}
\renewcommand{\Xi}{\Upxi\xspace}
\renewcommand{\Pi}{\Uppi\xspace}
\renewcommand{\Sigma}{\Upsigma\xspace}
\renewcommand{\Upsilon}{\Upupsilon\xspace}
\renewcommand{\Phi}{\Upphi\xspace}
\renewcommand{\Psi}{\Uppsi\xspace}
\renewcommand{\Omega}{\Upomega\xspace}

%---- numerical sets

\providecommand{\1}{\ensuremath{\mathds{1}}\xspace}
\providecommand{\N}{\ensuremath{\mathds{N}}\xspace}
\providecommand{\Q}{\ensuremath{\mathds{Q}}\xspace}
\providecommand{\R}{\ensuremath{\mathds{R}}\xspace}
\providecommand{\Z}{\ensuremath{\mathds{Z}}\xspace}
\providecommand{\C}{\ensuremath{\mathds{C}}\xspace}

%---- calligraphic letters

\providecommand{\cA}{\ensuremath{\mathcal{A}}\xspace}
\providecommand{\cB}{\ensuremath{\mathcal{B}}\xspace}
\providecommand{\cC}{\ensuremath{\mathcal{C}}\xspace}
\providecommand{\cD}{\ensuremath{\mathcal{D}}\xspace}
\providecommand{\cE}{\ensuremath{\mathcal{E}}\xspace}
\providecommand{\cF}{\ensuremath{\mathcal{F}}\xspace}
\providecommand{\cG}{\ensuremath{\mathcal{G}}\xspace}
\providecommand{\cH}{\ensuremath{\mathcal{H}}\xspace}
\providecommand{\cI}{\ensuremath{\mathcal{I}}\xspace}
\providecommand{\cJ}{\ensuremath{\mathcal{J}}\xspace}
\providecommand{\cK}{\ensuremath{\mathcal{K}}\xspace}
\providecommand{\cL}{\ensuremath{\mathcal{L}}\xspace}
\providecommand{\cM}{\ensuremath{\mathcal{M}}\xspace}
\providecommand{\cN}{\ensuremath{\mathcal{N}}\xspace}
\providecommand{\cO}{\ensuremath{\mathcal{O}}\xspace}
\providecommand{\cP}{\ensuremath{\mathcal{P}}\xspace}
\providecommand{\cQ}{\ensuremath{\mathcal{Q}}\xspace}
\providecommand{\cR}{\ensuremath{\mathcal{R}}\xspace}
\providecommand{\cS}{\ensuremath{\mathcal{S}}\xspace}
\providecommand{\cT}{\ensuremath{\mathcal{T}}\xspace}
\providecommand{\cU}{\ensuremath{\mathcal{U}}\xspace}
\providecommand{\cV}{\ensuremath{\mathcal{V}}\xspace}
\providecommand{\cW}{\ensuremath{\mathcal{W}}\xspace}
\providecommand{\cX}{\ensuremath{\mathcal{X}}\xspace}
\providecommand{\cY}{\ensuremath{\mathcal{Y}}\xspace}
\providecommand{\cZ}{\ensuremath{\mathcal{Z}}\xspace}

\providecommand{\ccA}{\ensuremath{\mathscr{A}}\xspace}
\providecommand{\ccB}{\ensuremath{\mathscr{B}}\xspace}
\providecommand{\ccC}{\ensuremath{\mathscr{C}}\xspace}
\providecommand{\ccD}{\ensuremath{\mathscr{D}}\xspace}
\providecommand{\ccE}{\ensuremath{\mathscr{E}}\xspace}
\providecommand{\ccF}{\ensuremath{\mathscr{F}}\xspace}
\providecommand{\ccG}{\ensuremath{\mathscr{G}}\xspace}
\providecommand{\ccH}{\ensuremath{\mathscr{H}}\xspace}
\providecommand{\ccI}{\ensuremath{\mathscr{I}}\xspace}
\providecommand{\ccJ}{\ensuremath{\mathscr{J}}\xspace}
\providecommand{\ccK}{\ensuremath{\mathscr{K}}\xspace}
\providecommand{\ccL}{\ensuremath{\mathscr{L}}\xspace}
\providecommand{\ccM}{\ensuremath{\mathscr{M}}\xspace}
\providecommand{\ccN}{\ensuremath{\mathscr{N}}\xspace}
\providecommand{\ccO}{\ensuremath{\mathscr{O}}\xspace}
\providecommand{\ccP}{\ensuremath{\mathscr{P}}\xspace}
\providecommand{\ccQ}{\ensuremath{\mathscr{Q}}\xspace}
\providecommand{\ccR}{\ensuremath{\mathscr{R}}\xspace}
\providecommand{\ccS}{\ensuremath{\mathscr{S}}\xspace}
\providecommand{\ccT}{\ensuremath{\mathscr{T}}\xspace}
\providecommand{\ccU}{\ensuremath{\mathscr{U}}\xspace}
\providecommand{\ccV}{\ensuremath{\mathscr{V}}\xspace}
\providecommand{\ccW}{\ensuremath{\mathscr{W}}\xspace}
\providecommand{\ccX}{\ensuremath{\mathscr{X}}\xspace}
\providecommand{\ccY}{\ensuremath{\mathscr{Y}}\xspace}
\providecommand{\ccZ}{\ensuremath{\mathscr{Z}}\xspace}

%---- roman letters

\providecommand{\rA}{\ensuremath{\mathrm{A}}\xspace}
\providecommand{\rB}{\ensuremath{\mathrm{B}}\xspace}
\providecommand{\rC}{\ensuremath{\mathrm{C}}\xspace}
\providecommand{\rD}{\ensuremath{\mathrm{D}}\xspace}
\providecommand{\rE}{\ensuremath{\mathrm{E}}\xspace}
\providecommand{\rF}{\ensuremath{\mathrm{F}}\xspace}
\providecommand{\rG}{\ensuremath{\mathrm{G}}\xspace}
\providecommand{\rH}{\ensuremath{\mathrm{H}}\xspace}
\providecommand{\rI}{\ensuremath{\mathrm{I}}\xspace}
\providecommand{\rJ}{\ensuremath{\mathrm{J}}\xspace}
\providecommand{\rK}{\ensuremath{\mathrm{K}}\xspace}
\providecommand{\rL}{\ensuremath{\mathrm{L}}\xspace}
\providecommand{\rM}{\ensuremath{\mathrm{M}}\xspace}
\providecommand{\rN}{\ensuremath{\mathrm{N}}\xspace}
\providecommand{\rO}{\ensuremath{\mathrm{O}}\xspace}
\providecommand{\rP}{\ensuremath{\mathrm{P}}\xspace}
\providecommand{\rQ}{\ensuremath{\mathrm{Q}}\xspace}
\providecommand{\rR}{\ensuremath{\mathrm{R}}\xspace}
\providecommand{\rS}{\ensuremath{\mathrm{S}}\xspace}
\providecommand{\rT}{\ensuremath{\mathrm{T}}\xspace}
\providecommand{\rU}{\ensuremath{\mathrm{U}}\xspace}
\providecommand{\rV}{\ensuremath{\mathrm{V}}\xspace}
\providecommand{\rW}{\ensuremath{\mathrm{W}}\xspace}
\providecommand{\rX}{\ensuremath{\mathrm{X}}\xspace}
\providecommand{\rY}{\ensuremath{\mathrm{Y}}\xspace}
\providecommand{\rZ}{\ensuremath{\mathrm{Z}}\xspace}

%---- frak letters

\providecommand{\fA}{\ensuremath{\mathfrak{A}}\xspace}
\providecommand{\fB}{\ensuremath{\mathfrak{B}}\xspace}
\providecommand{\fC}{\ensuremath{\mathfrak{C}}\xspace}
\providecommand{\fD}{\ensuremath{\mathfrak{D}}\xspace}
\providecommand{\fE}{\ensuremath{\mathfrak{E}}\xspace}
\providecommand{\fF}{\ensuremath{\mathfrak{F}}\xspace}
\providecommand{\fG}{\ensuremath{\mathfrak{G}}\xspace}
\providecommand{\fH}{\ensuremath{\mathfrak{H}}\xspace}
\providecommand{\fI}{\ensuremath{\mathfrak{I}}\xspace}
\providecommand{\fJ}{\ensuremath{\mathfrak{J}}\xspace}
\providecommand{\fK}{\ensuremath{\mathfrak{K}}\xspace}
\providecommand{\fL}{\ensuremath{\mathfrak{L}}\xspace}
\providecommand{\fM}{\ensuremath{\mathfrak{M}}\xspace}
\providecommand{\fN}{\ensuremath{\mathfrak{N}}\xspace}
\providecommand{\fO}{\ensuremath{\mathfrak{O}}\xspace}
\providecommand{\fP}{\ensuremath{\mathfrak{P}}\xspace}
\providecommand{\fQ}{\ensuremath{\mathfrak{Q}}\xspace}
\providecommand{\fR}{\ensuremath{\mathfrak{R}}\xspace}
\providecommand{\fS}{\ensuremath{\mathfrak{S}}\xspace}
\providecommand{\fT}{\ensuremath{\mathfrak{T}}\xspace}
\providecommand{\fU}{\ensuremath{\mathfrak{U}}\xspace}
\providecommand{\fV}{\ensuremath{\mathfrak{V}}\xspace}
\providecommand{\fW}{\ensuremath{\mathfrak{W}}\xspace}
\providecommand{\fX}{\ensuremath{\mathfrak{X}}\xspace}
\providecommand{\fY}{\ensuremath{\mathfrak{Y}}\xspace}
\providecommand{\fZ}{\ensuremath{\mathfrak{Z}}\xspace}

%---- groups

\providecommand{\OO}[1]{\ensuremath{\mathrm{O}(#1)}\xspace}
\providecommand{\SO}[1]{\ensuremath{\mathrm{SO}(#1)}\xspace}
\providecommand{\U}[1]{\ensuremath{\mathrm{U}(#1)}\xspace}
\providecommand{\SU}[1]{\ensuremath{\mathrm{SU}(#1)}\xspace}
\providecommand{\SL}[2]{\ensuremath{\mathrm{SL}_{#1}(#2)}\xspace}
\providecommand{\GL}[2]{\ensuremath{\mathrm{GL}_{#1}(#2)}\xspace}

%---- algebras
\providecommand{\liebraket}[2]{\ensuremath{\left[ #1,\, #2 \right]}}

%---- inline partial derivatives (use $\ipd{s}$ for $\partial_s$)

\providecommand{\ipd}[1]{\partial_{#1}}

%---- metric (use $\dss[n]{s}$ for $\mathrm{d}s^n$, [n] is optional)

\providecommand{\dss}[2][1]{\ifthenelse{\equal{#1}{1}}
                                       {\dd{#2}}
                                       {\dd{#2^{#1}}}
                           }

%---- integrals, sums and products

\providecommand{\zeroinfint}[1]{\int\limits_0^{+\infty} \dd{#1}}
\providecommand{\infzeroint}[1]{\int\limits_{-\infty}^0 \dd{#1}}
\providecommand{\infinfint}[1]{\int\limits_{-\infty}^{+\infty} \dd{#1}}
\providecommand{\finiteint}[3]{\int\limits_{#2}^{#3} \dd{#1}}

\providecommand{\zeroinfsum}[1]{\sum\limits_{#1 = 0}^{+\infty}}
\providecommand{\infzerosum}[1]{\sum\limits_{#1 = -\infty}^0}
\providecommand{\infinfsum}[1]{\sum\limits_{#1 = -\infty}^{+\infty}}
\providecommand{\finitesum}[3]{\sum\limits_{#1 = #2}^{#3}}

\providecommand{\zeroinfprod}[1]{\prod\limits_{#1 = 0}^{+\infty}}
\providecommand{\infzeroprod}[1]{\prod\limits_{#1 = -\infty}^0}
\providecommand{\infinfprod}[1]{\prod\limits_{#1 = -\infty}^{+\infty}}
\providecommand{\finiteprod}[3]{\prod\limits_{#1 = #2}^{#3}}

% vim: ft=tex
