% Jonny's standard preamble. 
% To include this preamble on a document, insert the following line after the \documentclass line:
% \input{preamble.tex}

%\documentclass[a4paper,11pt]{article}
%\input{preamble.tex}
% 
% Or, for two columns:
%\documentclass[a4paper,11pt,twocolumn]{article}
%\input{preamble.tex}

% If you need CJK support:
% \input{preamble-cjk.tex}

%%% BEGINNING OF PREAMBLE 

\usepackage{amsmath,amsthm,amssymb,amsfonts,gensymb}

\usepackage[a4paper, margin=2cm]{geometry}

\usepackage{parskip}

% \usepackage{url}
\usepackage{hyperref}
\usepackage{bm} % Nicer bolds for vectors (including bold Greek letters and bold grad symbol)
\usepackage{verbatim} % Include files verbatim using \verbatiminput

\usepackage{graphicx}
\usepackage{rotating}
\usepackage{subfigure}

% TikZ: A package for basic line drawings:
% https://www.sharelatex.com/blog/2013/08/27/tikz-series-pt1.html
% \usepackage{tikz}
% \usetikzlibrary{arrows,shapes,shapes.geometric,shapes.misc}
% \usepackage{pgfplots}

% commath: common maths things
% http://anorien.csc.warwick.ac.uk/mirrors/CTAN/macros/latex/contrib/commath/commath.pdf 
\usepackage{commath}

\usepackage[final]{pdfpages}
\usepackage[autostyle]{csquotes}

% Some shortcuts for vector calculus. 
\newcommand{\bs}{\boldsymbol}
\newcommand{\grad}{\bs{\nabla}}
\newcommand{\cross}{\times}
\newcommand{\curl}{\grad\cross}
\newcommand{\divg}{\grad\cdot}
\newcommand{\DDtfull}{\left(\frac{\partial}{\partial t} + \bs{u}\cdot\grad\right)}
\newcommand{\DDt} [1] {\frac{\mathrm{D}#1}{\mathrm{D}t}}
\newcommand{\dDDt} [1] {\displaystyle\frac{\mathrm{D}#1}{\mathrm{D}t}} 

% Asterisks: \ask
%%% See http://tex.stackexchange.com/questions/59183/normal-high-asterisk-in-equation-mode
%%% magic code starts
\mathcode`*=\string"8000
\begingroup
\catcode`*=\active
\xdef*{\noexpand\textup{\string*}}
\endgroup
%%% magic code ends

% Mathematical writing
\newcommand{\theorem}{\paragraph{Theorem}}
\newcommand \theoremp[1] {\paragraph{Theorem (#1)}}
\newcommand{\proposition}{\paragraph{Proposition}}
\renewcommand{\proof}{\textit{Proof. }}
\newcommand{\example}{\paragraph{Example}}
\newcommand{\definition}{\paragraph{Definition}}
\newcommand{\exercise}{\paragraph{Exercise}}
\newcommand{\exercises}{\paragraph{Exercises}}
\newcommand{\note}{\textit{Note. }}
\newcommand{\notes}{\textit{Notes. }}

% Shortcuts for some mathematical functions
\newcommand \trace {\mathrm{trace}\,}
\newcommand \tr {\mathrm{tr}\,}

\newcommand{\sgn}{\mathrm{sgn}}
\newcommand{\erf}{\mathrm{erf}}
\newcommand{\erfc}{\mathrm{erfc}}

\newcommand \naturals {\mathbb{N}}
\newcommand \integers {\mathbb{Z}}
\newcommand \rationals {\mathbb{Q}}
\newcommand \reals {\mathbb{R}}
\newcommand \complex {\mathbb{C}}
\newcommand \Rey {\mathrm{Re}} % Reynolds number
% \newcommand \Fr {\mathrm{Fr}} % Froude number
\newcommand \Fr {\mathcal{F}}
\renewcommand \Pr {\mathbb{P}} % probability
\newcommand \E {\mathbb{E}} % expectation

%%% Column vectors: see http://tex.stackexchange.com/questions/2705/typesetting-column-vector
\newcount\colveccount
\newcommand*\colvec[1]{
        \global\colveccount#1
        \begin{pmatrix}
        \colvecnext
}
\def\colvecnext#1{
        #1
        \global\advance\colveccount-1
        \ifnum\colveccount>0
                \\
                \expandafter\colvecnext
        \else
                \end{pmatrix}
        \fi
}

\usepackage{centernot}
\newcommand{\nimplies} {\centernot\implies}

\usepackage{multicol}

\usepackage{framed}
\usepackage{color}
\definecolor{jonnyred}{HTML}{C00000}

%%% END OF PREAMBLE
