Skip to content

Instantly share code, notes, and snippets.

@tt6746690
Created November 19, 2016 06:09
Show Gist options
  • Save tt6746690/cc8a06d6838f0a4556c7eedc45f020ef to your computer and use it in GitHub Desktop.
Save tt6746690/cc8a06d6838f0a4556c7eedc45f020ef to your computer and use it in GitHub Desktop.
Math LaTeX preamble
% math packages
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb} % Math symbols such as \mathbb
\usepackage{amsthm}
\usepackage{pgfplots} % plots
% other packages
\usepackage{graphicx}
\graphicspath{ {../assets/} }
\usepackage{enumitem}
\usepackage{color}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linktoc=all, %set to all if you want both sections and subsections linked
linkcolor=blue,
}
% proper inline math display, adjust height for symbols like \sum
\everymath{\displaystyle}
% define tags for math use..
\theoremstyle{plain}% default
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{proposition}{Proposition}[defn]
\newtheorem{exmp}{Example}[section]
\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}
% Gives begin{solution} same formating as \begin{proof}
\newenvironment{solution}
{\begin{proof}[Solution]}
{\end{proof}}
%running fraction with slash - requires math mode.
\newcommand*\rfrac[2]{{}^{#1}\!/_{#2}}
%shortcut to mathbb
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\I}{\mathbb{I}}
% color highlighting
\newcommand{\hilight}[1]{\colorbox{yellow}{#1}}
\newcommand{\icol}[1]{% inline column vector
\left(\begin{smallmatrix}#1\end{smallmatrix}\right)%
}
\newcommand{\irow}[1]{% inline row vector
\begin{smallmatrix}(#1)\end{smallmatrix}%
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment