Skip to content

Instantly share code, notes, and snippets.

@drXor drXor/preable.tex Secret
Created Jun 25, 2015

Embed
What would you like to do?
%% Vars %%
\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\cat}[1]{\mathcal{#1}}
\newcommand{\namedCat}[1]{\mathbf{#1}}
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\lie}[1]{\mathfrak{#1}}
%% Number sets %%
% Standard %
\newcommand{\N}{\field{N}}
\newcommand{\Z}{\field{Z}}
\newcommand{\Q}{\field{Q}}
\newcommand{\R}{\field{R}}
\newcommand{\C}{\field{C}}
\newcommand{\Quat}{\field{H}}
% Vect %
\newcommand{\Rn}{\R^n}
\newcommand{\Rm}{\R^m}
\newcommand{\Ri}{\R^{\infty}}
\newcommand{\ROver}[1]{\R\left[#1\right]}
\newcommand{\ZOver}[1]{\Z\left[#1\right]}
% Misc %
\newcommand{\posR}[1]{\R^+}
\newcommand{\surR}{\R^+\cup\left\{\infty\right\}} % measure codomain
\newcommand{\modZ}[1]{\Z^+/#1\Z}
%% Categories %%
\newcommand{\cSet}{\namedCat{Set}}
\newcommand{\cCat}{\namedCat{Cat}}
\newcommand{\cVect}{\namedCat{Vect}}
\newcommand{\cAb}{\namedCat{Ab}}
\newcommand{\cTop}{\namedCat{Top}}
\newcommand{\cRng}{\namedCat{Rng}}
%% Operators %%
\DeclareMathOperator{\image}{im}
\DeclareMathOperator{\vecspan}{span}
% Categories %
\DeclareMathOperator{\Hom}{Hom} % hom-set
\DeclareMathOperator{\Endo}{End} % endomorphism
\DeclareMathOperator{\Aut}{Aut} % automorphism
\DeclareMathOperator{\Obj}{Obj} % category objects
\DeclareMathOperator{\Mor}{Mor} % category morphisms
\DeclareMathOperator{\ident}{id}
% Topology %
\DeclareMathOperator{\Int}{Int} % interior
\DeclareMathOperator{\Ext}{Ext} % exteriror
\DeclareMathOperator{\Bd}{Bd} % boundary
% this defines what dx actually looks like%
\newcommand{\diff}{\mathrm{\mathstrut d}}
% low-level tex for dx, via ISO-31 %
\makeatletter
\providecommand*{\rawdiff}{\@ifnextchar^{\DIfF}{\DIfF^{}}}
\def\DIfF^#1{\mathop{\diff}\nolimits^{#1}\gobblespace}
\def\gobblespace{\futurelet\diffarg\opspace}
\def\opspace{\let\DiffSpace\!\ifx\diffarg(\let\DiffSpace\relax\else\ifx\diffarg[\let\DiffSpace\relax\else\ifx\diffarg\{\let\DiffSpace\relax\fi\fi\fi\DiffSpace}
% %
\newcommand{\D}{\rawdiff}
\providecommand*{\leib}[4][]{\frac{#2^{#1}#3}{#2 #4^{#1}}} % leibinz notation
\newcommand{\od}[3][]{\leib[#1]{\D}{#2}{#3}}
\newcommand{\pd}[3][]{\leib[#1]{\partial}{#2}{#3}}
\newcommand{\tensor}{\otimes}
% Vec Calc %
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\diverge}{div}
\DeclareMathOperator{\curl}{curl}
\newcommand{\Grad}{\nabla}
\newcommand{\Diverge}{\nabla\cdot}
\newcommand{\Curl}{\nabla\times}
\newcommand{\laplace}{\nabla^2}
% Misc %
\newcommand{\inject}{\hookrightarrow}
\newcommand{\surject}{\twoheadrightarrow}
\newcommand{\transp}[1]{#1^{\mathrm{T}}}
\newcommand{\andL}{\,\mathrm{and}\,}
\newcommand{\orL}{\,\mathrm{or}\,}
\newcommand{\xorL}{\,\mathrm{xor}\,}
\newcommand{\nin}{\notin}
\newcommand{\ind}{\mathbf{1}}
\newcommand{\abs}[1]{\left\mid#1\right\mid}
\newcommand{\norm}[1]{\left\Vert#1\right\Vert}
\newcommand{\jacobi}[2]{\left(\frac{#1}{#2}\right)}
%% Objects %%
\renewcommand{\empty}{\varnothing}
\newcommand{\vzero}{\vect{0}}
%% Misc %%
\newcommand{\restrictto}[1]{\left.#1\right|}
\newcommand{\mkset}[2]{\left\{#1\,\middle|\,#2\right\}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.