% Jonny's beamer preamble. 
% To include this preamble on a document, use something like this:

%\documentclass{beamer}
%\input{preamble-beamer.tex}

%\usetheme{Berlin}
%\usecolortheme{beaver}
%\usefonttheme{serif}
%\usepackage{framed}
%\usepackage{wrapfig}

\usepackage{amsmath,amsthm,amssymb,amsfonts}

\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{\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}}
\newcommand \Fr {\mathcal{F}}
\renewcommand \Pr {\mathbb{P}}
\newcommand \E {\mathbb{E}}

%%% 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
}

% What does this do?
\pgfplotsset{compat=1.10}

%%% Support for CJK. 
% To use:
% \cjk{你好！}
\usepackage{CJKutf8}
\newenvironment{Korean}{%
  \CJKfamily{mj}}{}
\newenvironment{Chinese}{%
  \CJKfamily{mj}}{}
\newcommand{\cjk}[1] {\begin{CJK}{UTF8}{}\begin{Chinese}#1\end{Chinese}\end{CJK}}

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

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