emacs.d

My emacs configuration, done in a literate programming fashion using org-mode

git clone git://git.shimmy1996.com/emacs.d.git
commit f8cea9d03c43bbcab3cdeb72819296a60cd94870
parent 1d3207a1bdb8b481f1c2132ff273f70cd658b7e6
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Fri, 17 Aug 2018 15:02:11 -0400

Add support for easy latex macros.

Diffstat:
Asnippets/org-mode/latex-macros | 7+++++++
Astatic/math_macros.sty | 242+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 249 insertions(+), 0 deletions(-)
diff --git a/snippets/org-mode/latex-macros b/snippets/org-mode/latex-macros
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: latex-macros
+# key: lm_
+# --
+#+BEGIN_SRC latex-macros
+$0
+#+END_SRC
diff --git a/static/math_macros.sty b/static/math_macros.sty
@@ -0,0 +1,242 @@
+\newcommand{\E}{\mathrm{e}}
+\newcommand{\I}{\mathrm{i}}
+% Scientific numbers
+\newcommand{\Em}{\text{e-}}
+\newcommand{\Ep}{\text{e+}}
+
+\newcommand{\Alpha}{A}
+\newcommand{\Beta}{B}
+\newcommand{\Epsilon}{E}
+
+\newcommand{\abs}[1]{\lvert#1\rvert}
+\newcommand{\ceil}[1]{\lceil#1\rceil}
+\newcommand{\floor}[1]{\lfloor#1\rfloor}
+\newcommand{\norm}[1]{\lVert#1\rVert}
+\newcommand{\mean}[1]{\overline{#1}}
+\newcommand{\conj}[1]{\overline{#1}}
+
+\newcommand{\dd}{\mathop{}\,\mathrm{d}}
+\newcommand{\der}[2][]{\frac{\mathrm{d}#1}{\mathrm{d}#2}}
+\newcommand{\pder}[2][]{\frac{\partial#1}{\partial#2}}
+
+\newcommand{\geqst}{\geq_{\text{st}}}
+\newcommand{\leqst}{\leq_{\text{st}}}
+
+\newcommand{\pto}{\overset{p}\to}
+\newcommand{\lpto}{\overset{p}\longrightarrow}
+\newcommand{\dto}{\overset{d}\to}
+\newcommand{\ldto}{\overset{d}\longrightarrow}
+\newcommand{\asto}{\overset{\text{a.s.}}\longrightarrow}
+
+\newcommand{\sgn}{\operatorname{sgn}}
+\newcommand{\im}{\operatorname{Im}}
+\newcommand{\re}{\operatorname{Re}}
+\newcommand{\rank}{\operatorname{rank}}
+\newcommand{\diag}{\operatorname{diag}}
+\newcommand{\col}{\operatorname{col}}
+\newcommand{\row}{\operatorname{row}}
+
+\newcommand{\As}{\text{ as }}
+% \newcommand{\And}{\text{ and }}
+\newcommand{\To}{\text{ to }}
+\newcommand{\Or}{\text{ or }}
+\newcommand{\If}{\text{ if }}
+\newcommand{\Otherwise}{\text{ otherwise}}
+\newcommand{\ForAll}{\text{ for all }}
+\newcommand{\For}{\text{ for }}
+\newcommand{\Yes}{\text{Yes}}
+\newcommand{\No}{\text{No}}
+\newcommand{\Num}{\text{\# }}
+
+\newcommand{\vctr}[1]{\mathbf{#1}}
+\newcommand{\mtrx}[1]{\bm{#1}}
+
+% Special
+\newcommand{\vzero}{\vctr{0}}
+\newcommand{\vone}{\vctr{1}}
+% Greek
+\newcommand{\valpha}{\vctr{\alpha}}
+\newcommand{\vbeta}{\vctr{\beta}}
+\newcommand{\vgamma}{\vctr{\gamma}}
+\newcommand{\vmu}{\vctr{\mu}}
+\newcommand{\vtheta}{\vctr{\theta}}
+% Latin
+\newcommand{\va}{\vctr{a}}
+\newcommand{\vb}{\vctr{b}}
+\newcommand{\vc}{\vctr{c}}
+\newcommand{\vd}{\vctr{d}}
+\newcommand{\ve}{\vctr{e}}
+\newcommand{\vf}{\vctr{f}}
+\newcommand{\vg}{\vctr{g}}
+\newcommand{\vh}{\vctr{h}}
+\newcommand{\vi}{\vctr{i}}
+\newcommand{\vj}{\vctr{j}}
+\newcommand{\vk}{\vctr{k}}
+\newcommand{\vl}{\vctr{l}}
+\newcommand{\vm}{\vctr{m}}
+\newcommand{\vn}{\vctr{n}}
+\newcommand{\vo}{\vctr{o}}
+\newcommand{\vp}{\vctr{p}}
+\newcommand{\vq}{\vctr{q}}
+\newcommand{\vr}{\vctr{r}}
+\newcommand{\vs}{\vctr{s}}
+\newcommand{\vt}{\vctr{t}}
+\newcommand{\vu}{\vctr{u}}
+\newcommand{\vv}{\vctr{v}}
+\newcommand{\vw}{\vctr{w}}
+\newcommand{\vx}{\vctr{x}}
+\newcommand{\vy}{\vctr{y}}
+\newcommand{\vz}{\vctr{z}}
+
+% Special
+\newcommand{\mZero}{\mtrx{0}}
+\newcommand{\mOne}{\mtrx{1}}
+% Greek
+\newcommand{\mBeta}{\mtrx{\beta}}
+\newcommand{\mPhi}{\mtrx{\Phi}}
+\newcommand{\mLambda}{\mtrx{\Lambda}}
+\newcommand{\mSigma}{\mtrx{\Sigma}}
+\newcommand{\mOmega}{\mtrx{\Omega}}
+% Latin
+\newcommand{\mA}{\mtrx{A}}
+\newcommand{\mB}{\mtrx{B}}
+\newcommand{\mC}{\mtrx{C}}
+\newcommand{\mD}{\mtrx{D}}
+\newcommand{\mE}{\mtrx{E}}
+\newcommand{\mF}{\mtrx{F}}
+\newcommand{\mG}{\mtrx{G}}
+\newcommand{\mH}{\mtrx{H}}
+\newcommand{\mI}{\mtrx{I}}
+\newcommand{\mJ}{\mtrx{J}}
+\newcommand{\mK}{\mtrx{K}}
+\newcommand{\mL}{\mtrx{L}}
+\newcommand{\mM}{\mtrx{M}}
+\newcommand{\mN}{\mtrx{N}}
+\newcommand{\mO}{\mtrx{O}}
+\newcommand{\mP}{\mtrx{P}}
+\newcommand{\mQ}{\mtrx{Q}}
+\newcommand{\mR}{\mtrx{R}}
+\newcommand{\mS}{\mtrx{S}}
+\newcommand{\mT}{\mtrx{T}}
+\newcommand{\mU}{\mtrx{U}}
+\newcommand{\mV}{\mtrx{V}}
+\newcommand{\mW}{\mtrx{W}}
+\newcommand{\mX}{\mtrx{X}}
+\newcommand{\mY}{\mtrx{Y}}
+\newcommand{\mZ}{\mtrx{Z}}
+
+\newcommand{\tr}{^{\mathsf{T}}}
+\newcommand{\ip}[1]{\langle#1\rangle}
+
+\newcommand{\set}[1]{\mathbb{#1}}
+\newcommand{\field}[1]{\mathcal{#1}}
+\renewcommand{\emptyset}{\varnothing}
+
+% Latin
+\newcommand{\sA}{\set{A}}
+\newcommand{\sB}{\set{B}}
+\newcommand{\sC}{\set{C}}
+\newcommand{\sD}{\set{D}}
+\newcommand{\sE}{\set{E}}
+\newcommand{\sF}{\set{F}}
+\newcommand{\sG}{\set{G}}
+\newcommand{\sH}{\set{H}}
+\newcommand{\sI}{\set{I}}
+\newcommand{\sJ}{\set{J}}
+\newcommand{\sK}{\set{K}}
+\newcommand{\sL}{\set{L}}
+\newcommand{\sM}{\set{M}}
+\newcommand{\sN}{\set{N}}
+\newcommand{\sO}{\set{O}}
+\newcommand{\sP}{\set{P}}
+\newcommand{\sQ}{\set{Q}}
+\newcommand{\sR}{\set{R}}
+\newcommand{\sS}{\set{S}}
+\newcommand{\sT}{\set{T}}
+\newcommand{\sU}{\set{U}}
+\newcommand{\sV}{\set{V}}
+\newcommand{\sW}{\set{W}}
+\newcommand{\sX}{\set{X}}
+\newcommand{\sY}{\set{Y}}
+\newcommand{\sZ}{\set{Z}}
+
+% Latin
+\newcommand{\fA}{\field{A}}
+\newcommand{\fB}{\field{B}}
+\newcommand{\fC}{\field{C}}
+\newcommand{\fD}{\field{D}}
+\newcommand{\fE}{\field{E}}
+\newcommand{\fF}{\field{F}}
+\newcommand{\fG}{\field{G}}
+\newcommand{\fH}{\field{H}}
+\newcommand{\fI}{\field{I}}
+\newcommand{\fJ}{\field{J}}
+\newcommand{\fK}{\field{K}}
+\newcommand{\fL}{\field{L}}
+\newcommand{\fM}{\field{M}}
+\newcommand{\fN}{\field{N}}
+\newcommand{\fO}{\field{O}}
+\newcommand{\fP}{\field{P}}
+\newcommand{\fQ}{\field{Q}}
+\newcommand{\fR}{\field{R}}
+\newcommand{\fS}{\field{S}}
+\newcommand{\fT}{\field{T}}
+\newcommand{\fU}{\field{U}}
+\newcommand{\fV}{\field{V}}
+\newcommand{\fW}{\field{W}}
+\newcommand{\fX}{\field{X}}
+\newcommand{\fY}{\field{Y}}
+\newcommand{\fZ}{\field{Z}}
+
+\renewcommand{\subseteq}{\subset}
+
+\newcommand{\rInd}{\mathbf{1}}
+\newcommand{\rPoi}{\operatorname{Poisson}}
+\newcommand{\rBern}{\operatorname{Bern}}
+\newcommand{\rNorm}{\mathcal{N}}
+
+% Probability
+\newcommand{\pr}{\mathbb{P}}
+% Expectation
+\newcommand{\ev}{\mathbb{E}}
+% Variance
+\newcommand{\var}{\operatorname{Var}}
+% Covariance
+\newcommand{\cov}{\operatorname{Cov}}
+% Correlation
+\newcommand{\corr}{\operatorname{Cor}}
+% Skewness
+\newcommand{\sk}{\operatorname{Sk}}
+% Kurtosis
+\newcommand{\kur}{\operatorname{Kur}}
+
+% Random Vectors
+\newcommand{\randvctr}[1]{\mathbf{#1}}
+% Random Scalars
+\newcommand{\rind}{\bm{1}}
+\newcommand{\randvar}[1]{#1}
+
+\newcommand{\rX}{\randvar{X}}
+\newcommand{\rY}{\randvar{Y}}
+\newcommand{\rZ}{\randvar{Z}}
+\newcommand{\rvX}{\randvctr{X}}
+\newcommand{\rvY}{\randvctr{Y}}
+\newcommand{\rvZ}{\randvctr{Z}}
+
+% Maximum Likelihood Estimator
+\newcommand{\mle}[1]{\hat{#1}}
+% Special
+\newcommand{\hsigmasq}{\mle{\sigma^{2}}}
+% Greek
+\newcommand{\halpha}{\mle{\alpha}}
+\newcommand{\hbeta}{\mle{\beta}}
+\newcommand{\hgamma}{\mle{\gamma}}
+\newcommand{\htheta}{\mle{\theta}}
+\newcommand{\hlambda}{\mle{\lambda}}
+\newcommand{\hmu}{\mle{\mu}}
+\newcommand{\hnu}{\mle{\nu}}
+\newcommand{\hpi}{\mle{\pi}}
+\newcommand{\hsigma}{\mle{\sigma}}
+% Latin
+\newcommand{\hx}{\mle{\x}}
+\newcommand{\hp}{\mle{p}}