Markdown Math Macro definition
The latex command source
\newcommand{\bm}[1]{\boldsymbol{#1}} \newcommand{\sign}{\operatorname{sign}}Click %to \DeclareMathOperator{\sign}{sign}
\newcommand{\Tr}{\operatorname{Tr}} % \DeclareMathOperator{\Tr}{Tr}
\newcommand{\E}{\mathbb{E}}
\newcommand{\KL}{D_\mathrm{KL}}
\newcommand{\NormalDist}{\mathcal{N}}
\newcommand{\diag}{\mathrm{diag}}
\newcommand{\Ls}{\mathcal{L}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\emp}{\tilde{p}}
\newcommand{\lr}{\alpha}
\newcommand{\reg}{\lambda}
\newcommand{\rect}{\mathrm{rectifier}}
\newcommand{\softmax}{\mathrm{softmax}}
\newcommand{\sigmoid}{\sigma}
\newcommand{\softplus}{\zeta}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\standarderror}{\mathrm{SE}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\tran}{^\top}
\newcommand{\inv}{^{-1}}
\newcommand{\diff}{ \mathrm{d}}
% % Vectors
\newcommand{\vzero}{\bm{0}}
\newcommand{\vone}{\bm{1}}
\newcommand{\vmu}{\bm{\mu}}
\newcommand{\vnu}{\bm{\nu}}
\newcommand{\vtheta}{\bm{\theta}}
\renewcommand{\va}{\bm{a}}
\renewcommand{\vb}{\bm{b}}
% \newcommand{\va}{\bm{a}}
% \newcommand{\vb}{\bm{b}}
\newcommand{\vc}{\bm{c}}
\newcommand{\vd}{\bm{d}}
\newcommand{\ve}{\bm{e}}
\newcommand{\vf}{\bm{f}}
\newcommand{\vg}{\bm{g}}
\newcommand{\vh}{\bm{h}}
\newcommand{\vi}{\bm{i}}
\newcommand{\vj}{\bm{j}}
\newcommand{\vk}{\bm{k}}
\newcommand{\vl}{\bm{l}}
\newcommand{\vm}{\bm{m}}
\newcommand{\vn}{\bm{n}}
\newcommand{\vo}{\bm{o}}
\newcommand{\vp}{\bm{p}}
\newcommand{\vq}{\bm{q}}
\newcommand{\vr}{\bm{r}}
\newcommand{\vs}{\bm{s}}
\newcommand{\vt}{\bm{t}}
\newcommand{\vu}{\bm{u}}
\newcommand{\vv}{\bm{v}}
\newcommand{\vw}{\bm{w}}
\newcommand{\vx}{\bm{x}}
\newcommand{\vy}{\bm{y}}
\newcommand{\vz}{\bm{z}}
% % Random variables
% % old latex command \rm is overwritten, now should use `\textrm` or `\mathrm`
% \newcommand{\reta}{{\textnormal{$\eta$}}}
\newcommand{\ra}{{\textnormal{a}}}
\newcommand{\rb}{{\textnormal{b}}}
\newcommand{\rc}{{\textnormal{c}}}
\newcommand{\rd}{{\textnormal{d}}}
\newcommand{\re}{{\textnormal{e}}}
\newcommand{\rf}{{\textnormal{f}}}
\newcommand{\rg}{{\textnormal{g}}}
\newcommand{\rh}{{\textnormal{h}}}
\newcommand{\ri}{{\textnormal{i}}}
\newcommand{\rj}{{\textnormal{j}}}
\newcommand{\rk}{{\textnormal{k}}}
\newcommand{\rl}{{\textnormal{l}}}
\renewcommand{\rm}{{\textnormal{m}}} % note \rm is old command
\newcommand{\rn}{{\textnormal{n}}}
\newcommand{\ro}{{\textnormal{o}}}
\newcommand{\rp}{{\textnormal{p}}}
\newcommand{\rq}{{\textnormal{q}}}
\newcommand{\rr}{{\textnormal{r}}}
\newcommand{\rs}{{\textnormal{s}}}
\newcommand{\rt}{{\textnormal{t}}}
\newcommand{\ru}{{\textnormal{u}}}
\newcommand{\rv}{{\textnormal{v}}}
\newcommand{\rw}{{\textnormal{w}}}
\newcommand{\rx}{{\textnormal{x}}}
\newcommand{\ry}{{\textnormal{y}}}
\newcommand{\rz}{{\textnormal{z}}}
% % Random vectors % TODO, greek vector valued random variables and vectors are same
\newcommand{\rvepsilon}{\bm{\epsilon}}
\newcommand{\rvtheta}{\bm{\theta}}
\newcommand{\rva}{\mathbf{a}}
\newcommand{\rvb}{\mathbf{b}}
\newcommand{\rvc}{\mathbf{c}}
\newcommand{\rvd}{\mathbf{d}}
\newcommand{\rve}{\mathbf{e}}
\newcommand{\rvf}{\mathbf{f}}
\newcommand{\rvg}{\mathbf{g}}
\newcommand{\rvh}{\mathbf{h}}
\newcommand{\rvi}{\mathbf{i}}
\newcommand{\rvj}{\mathbf{j}}
\newcommand{\rvk}{\mathbf{k}}
\newcommand{\rvl}{\mathbf{l}}
\newcommand{\rvm}{\mathbf{m}}
\newcommand{\rvn}{\mathbf{n}}
\newcommand{\rvo}{\mathbf{o}}
\newcommand{\rvp}{\mathbf{p}}
\newcommand{\rvq}{\mathbf{q}}
\newcommand{\rvr}{\mathbf{r}}
\newcommand{\rvs}{\mathbf{s}}
\newcommand{\rvt}{\mathbf{t}}
\newcommand{\rvu}{\mathbf{u}}
\newcommand{\rvv}{\mathbf{v}}
\newcommand{\rvw}{\mathbf{w}}
\newcommand{\rvx}{\mathbf{x}}
\newcommand{\rvy}{\mathbf{y}}
\newcommand{\rvz}{\mathbf{z}}
% % Elements of random vectors
\newcommand{\erva}{{\textnormal{a}}}
\newcommand{\ervb}{{\textnormal{b}}}
\newcommand{\ervc}{{\textnormal{c}}}
\newcommand{\ervd}{{\textnormal{d}}}
\newcommand{\erve}{{\textnormal{e}}}
\newcommand{\ervf}{{\textnormal{f}}}
\newcommand{\ervg}{{\textnormal{g}}}
\newcommand{\ervh}{{\textnormal{h}}}
\newcommand{\ervi}{{\textnormal{i}}}
\newcommand{\ervj}{{\textnormal{j}}}
\newcommand{\ervk}{{\textnormal{k}}}
\newcommand{\ervl}{{\textnormal{l}}}
\newcommand{\ervm}{{\textnormal{m}}}
\newcommand{\ervn}{{\textnormal{n}}}
\newcommand{\ervo}{{\textnormal{o}}}
\newcommand{\ervp}{{\textnormal{p}}}
\newcommand{\ervq}{{\textnormal{q}}}
\newcommand{\ervr}{{\textnormal{r}}}
\newcommand{\ervs}{{\textnormal{s}}}
\newcommand{\ervt}{{\textnormal{t}}}
\newcommand{\ervu}{{\textnormal{u}}}
\newcommand{\ervv}{{\textnormal{v}}}
\newcommand{\ervw}{{\textnormal{w}}}
\newcommand{\ervx}{{\textnormal{x}}}
\newcommand{\ervy}{{\textnormal{y}}}
\newcommand{\ervz}{{\textnormal{z}}}
% % Random matrices
\newcommand{\rmA}{{\mathbf{A}}}
\newcommand{\rmB}{{\mathbf{B}}}
\newcommand{\rmC}{{\mathbf{C}}}
\newcommand{\rmD}{{\mathbf{D}}}
\newcommand{\rmE}{{\mathbf{E}}}
\newcommand{\rmF}{{\mathbf{F}}}
\newcommand{\rmG}{{\mathbf{G}}}
\newcommand{\rmH}{{\mathbf{H}}}
\newcommand{\rmI}{{\mathbf{I}}}
\newcommand{\rmJ}{{\mathbf{J}}}
\newcommand{\rmK}{{\mathbf{K}}}
\newcommand{\rmL}{{\mathbf{L}}}
\newcommand{\rmM}{{\mathbf{M}}}
\newcommand{\rmN}{{\mathbf{N}}}
\newcommand{\rmO}{{\mathbf{O}}}
\newcommand{\rmP}{{\mathbf{P}}}
\newcommand{\rmQ}{{\mathbf{Q}}}
\newcommand{\rmR}{{\mathbf{R}}}
\newcommand{\rmS}{{\mathbf{S}}}
\newcommand{\rmT}{{\mathbf{T}}}
\newcommand{\rmU}{{\mathbf{U}}}
\newcommand{\rmV}{{\mathbf{V}}}
\newcommand{\rmW}{{\mathbf{W}}}
\newcommand{\rmX}{{\mathbf{X}}}
\newcommand{\rmY}{{\mathbf{Y}}}
\newcommand{\rmZ}{{\mathbf{Z}}}
% % Elements of random matrices
\newcommand{\ermA}{{\textnormal{A}}}
\newcommand{\ermB}{{\textnormal{B}}}
\newcommand{\ermC}{{\textnormal{C}}}
\newcommand{\ermD}{{\textnormal{D}}}
\newcommand{\ermE}{{\textnormal{E}}}
\newcommand{\ermF}{{\textnormal{F}}}
\newcommand{\ermG}{{\textnormal{G}}}
\newcommand{\ermH}{{\textnormal{H}}}
\newcommand{\ermI}{{\textnormal{I}}}
\newcommand{\ermJ}{{\textnormal{J}}}
\newcommand{\ermK}{{\textnormal{K}}}
\newcommand{\ermL}{{\textnormal{L}}}
\newcommand{\ermM}{{\textnormal{M}}}
\newcommand{\ermN}{{\textnormal{N}}}
\newcommand{\ermO}{{\textnormal{O}}}
\newcommand{\ermP}{{\textnormal{P}}}
\newcommand{\ermQ}{{\textnormal{Q}}}
\newcommand{\ermR}{{\textnormal{R}}}
\newcommand{\ermS}{{\textnormal{S}}}
\newcommand{\ermT}{{\textnormal{T}}}
\newcommand{\ermU}{{\textnormal{U}}}
\newcommand{\ermV}{{\textnormal{V}}}
\newcommand{\ermW}{{\textnormal{W}}}
\newcommand{\ermX}{{\textnormal{X}}}
\newcommand{\ermY}{{\textnormal{Y}}}
\newcommand{\ermZ}{{\textnormal{Z}}}
% % Elements of vectors
\newcommand{\evalpha}{{\alpha}}
\newcommand{\evbeta}{{\beta}}
\newcommand{\evepsilon}{{\epsilon}}
\newcommand{\evlambda}{{\lambda}}
\newcommand{\evomega}{{\omega}}
\newcommand{\evmu}{{\mu}}
\newcommand{\evpsi}{{\psi}}
\newcommand{\evsigma}{{\sigma}}
\newcommand{\evtheta}{{\theta}}
\newcommand{\eva}{{a}}
\newcommand{\evb}{{b}}
\newcommand{\evc}{{c}}
\newcommand{\evd}{{d}}
\newcommand{\eve}{{e}}
\newcommand{\evf}{{f}}
\newcommand{\evg}{{g}}
\newcommand{\evh}{{h}}
\newcommand{\evi}{{i}}
\newcommand{\evj}{{j}}
\newcommand{\evk}{{k}}
\newcommand{\evl}{{l}}
\newcommand{\evm}{{m}}
\newcommand{\evn}{{n}}
\newcommand{\evo}{{o}}
\newcommand{\evp}{{p}}
\newcommand{\evq}{{q}}
\newcommand{\evr}{{r}}
\newcommand{\evs}{{s}}
\newcommand{\evt}{{t}}
\newcommand{\evu}{{u}}
\newcommand{\evv}{{v}}
\newcommand{\evw}{{w}}
\newcommand{\evx}{{x}}
\newcommand{\evy}{{y}}
\newcommand{\evz}{{z}}
% %% Matrix
\newcommand{\mBeta}{{\bm{\beta}}}
\newcommand{\mPhi}{{\bm{\Phi}}}
\newcommand{\mLambda}{{\bm{\Lambda}}}
\newcommand{\mSigma}{{\bm{\Sigma}}}
\newcommand{\mA}{{\bm{A}}}
\newcommand{\mB}{{\bm{B}}}
\newcommand{\mC}{{\bm{C}}}
\newcommand{\mD}{{\bm{D}}}
\newcommand{\mE}{{\bm{E}}}
\newcommand{\mF}{{\bm{F}}}
\newcommand{\mG}{{\bm{G}}}
\newcommand{\mH}{{\bm{H}}}
\newcommand{\mI}{{\bm{I}}}
\newcommand{\mJ}{{\bm{J}}}
\newcommand{\mK}{{\bm{K}}}
\newcommand{\mL}{{\bm{L}}}
\newcommand{\mM}{{\bm{M}}}
\newcommand{\mN}{{\bm{N}}}
\newcommand{\mO}{{\bm{O}}}
\newcommand{\mP}{{\bm{P}}}
\newcommand{\mQ}{{\bm{Q}}}
\newcommand{\mR}{{\bm{R}}}
\newcommand{\mS}{{\bm{S}}}
\newcommand{\mT}{{\bm{T}}}
\newcommand{\mU}{{\bm{U}}}
\newcommand{\mV}{{\bm{V}}}
\newcommand{\mW}{{\bm{W}}}
\newcommand{\mX}{{\bm{X}}}
\newcommand{\mY}{{\bm{Y}}}
\newcommand{\mZ}{{\bm{Z}}}
% \DeclareMathAlphabet{\mathsfit}{\encodingdefault}{\sfdefault}{m}{sl}
% \SetMathAlphabet{\mathsfit}{bold}{\encodingdefault}{\sfdefault}{bx}{n}
% \newcommand{\tens}[1]{\bm{\mathsfit{#1}}}
% inunfold mathjax usemacro mathsfdefinition
insteadly```html
\newcommand{\tens}[1]{ \bm{\mathit{\mathsf{#1}}} }
% % Tensor
\newcommand{\tA}{{\tens{A}}}
\newcommand{\tB}{{\tens{B}}}
\newcommand{\tC}{{\tens{C}}}
\newcommand{\tD}{{\tens{D}}}
\newcommand{\tE}{{\tens{E}}}
\newcommand{\tF}{{\tens{F}}}
\newcommand{\tG}{{\tens{G}}}
\newcommand{\tH}{{\tens{H}}}
\newcommand{\tI}{{\tens{I}}}
\newcommand{\tJ}{{\tens{J}}}
\newcommand{\tK}{{\tens{K}}}
\newcommand{\tL}{{\tens{L}}}
\newcommand{\tM}{{\tens{M}}}
\newcommand{\tN}{{\tens{N}}}
\newcommand{\tO}{{\tens{O}}}
\newcommand{\tP}{{\tens{P}}}
\newcommand{\tQ}{{\tens{Q}}}
\newcommand{\tR}{{\tens{R}}}
\newcommand{\tS}{{\tens{S}}}
\newcommand{\tT}{{\tens{T}}}
\newcommand{\tU}{{\tens{U}}}
\newcommand{\tV}{{\tens{V}}}
\newcommand{\tW}{{\tens{W}}}
\newcommand{\tX}{{\tens{X}}}
\newcommand{\tY}{{\tens{Y}}}
\newcommand{\tZ}{{\tens{Z}}}
% % Graph
\newcommand{\gA}{{\mathcal{A}}}
\newcommand{\gB}{{\mathcal{B}}}
\newcommand{\gC}{{\mathcal{C}}}
\newcommand{\gD}{{\mathcal{D}}}
\newcommand{\gE}{{\mathcal{E}}}
\newcommand{\gF}{{\mathcal{F}}}
\newcommand{\gG}{{\mathcal{G}}}
\newcommand{\gH}{{\mathcal{H}}}
\newcommand{\gI}{{\mathcal{I}}}
\newcommand{\gJ}{{\mathcal{J}}}
\newcommand{\gK}{{\mathcal{K}}}
\newcommand{\gL}{{\mathcal{L}}}
\newcommand{\gM}{{\mathcal{M}}}
\newcommand{\gN}{{\mathcal{N}}}
\newcommand{\gO}{{\mathcal{O}}}
\newcommand{\gP}{{\mathcal{P}}}
\newcommand{\gQ}{{\mathcal{Q}}}
\newcommand{\gR}{{\mathcal{R}}}
\newcommand{\gS}{{\mathcal{S}}}
\newcommand{\gT}{{\mathcal{T}}}
\newcommand{\gU}{{\mathcal{U}}}
\newcommand{\gV}{{\mathcal{V}}}
\newcommand{\gW}{{\mathcal{W}}}
\newcommand{\gX}{{\mathcal{X}}}
\newcommand{\gY}{{\mathcal{Y}}}
\newcommand{\gZ}{{\mathcal{Z}}}
% % Sets
\newcommand{\sA}{{\mathbb{A}}}
\newcommand{\sB}{{\mathbb{B}}}
\newcommand{\sC}{{\mathbb{C}}}
\newcommand{\sD}{{\mathbb{D}}}
% % Don't use a set called E, because this would be the same as our symbol
% % for expectation.
\newcommand{\sF}{{\mathbb{F}}}
\newcommand{\sG}{{\mathbb{G}}}
\newcommand{\sH}{{\mathbb{H}}}
\newcommand{\sI}{{\mathbb{I}}}
\newcommand{\sJ}{{\mathbb{J}}}
\newcommand{\sK}{{\mathbb{K}}}
\newcommand{\sL}{{\mathbb{L}}}
\newcommand{\sM}{{\mathbb{M}}}
\newcommand{\sN}{{\mathbb{N}}}
\newcommand{\sO}{{\mathbb{O}}}
\newcommand{\sP}{{\mathbb{P}}}
\newcommand{\sQ}{{\mathbb{Q}}}
\newcommand{\sR}{{\mathbb{R}}}
\newcommand{\sS}{{\mathbb{S}}}
\newcommand{\sT}{{\mathbb{T}}}
\newcommand{\sU}{{\mathbb{U}}}
\newcommand{\sV}{{\mathbb{V}}}
\newcommand{\sW}{{\mathbb{W}}}
\newcommand{\sX}{{\mathbb{X}}}
\newcommand{\sY}{{\mathbb{Y}}}
\newcommand{\sZ}{{\mathbb{Z}}}
% % Entries of a matrix
\newcommand{\emSigma}{{\Sigma}}
\newcommand{\emLambda}{{\Lambda}}
\newcommand{\emA}{{A}}
\newcommand{\emB}{{B}}
\newcommand{\emC}{{C}}
\newcommand{\emD}{{D}}
\newcommand{\emE}{{E}}
\newcommand{\emF}{{F}}
\newcommand{\emG}{{G}}
\newcommand{\emH}{{H}}
\newcommand{\emI}{{I}}
\newcommand{\emJ}{{J}}
\newcommand{\emK}{{K}}
\newcommand{\emL}{{L}}
\newcommand{\emM}{{M}}
\newcommand{\emN}{{N}}
\newcommand{\emO}{{O}}
\newcommand{\emP}{{P}}
\newcommand{\emQ}{{Q}}
\newcommand{\emR}{{R}}
\newcommand{\emS}{{S}}
\newcommand{\emT}{{T}}
\newcommand{\emU}{{U}}
\newcommand{\emV}{{V}}
\newcommand{\emW}{{W}}
\newcommand{\emX}{{X}}
\newcommand{\emY}{{Y}}
\newcommand{\emZ}{{Z}}
% % entries of a tensor
% % Same font as tensor, without \bm wrapper
\newcommand{\etens}[1]{\mathsfit{#1}}
\newcommand{\etLambda}{{\etens{\Lambda}}}
\newcommand{\etA}{{\etens{A}}}
\newcommand{\etB}{{\etens{B}}}
\newcommand{\etC}{{\etens{C}}}
\newcommand{\etD}{{\etens{D}}}
\newcommand{\etE}{{\etens{E}}}
\newcommand{\etF}{{\etens{F}}}
\newcommand{\etG}{{\etens{G}}}
\newcommand{\etH}{{\etens{H}}}
\newcommand{\etI}{{\etens{I}}}
\newcommand{\etJ}{{\etens{J}}}
\newcommand{\etK}{{\etens{K}}}
\newcommand{\etL}{{\etens{L}}}
\newcommand{\etM}{{\etens{M}}}
\newcommand{\etN}{{\etens{N}}}
\newcommand{\etO}{{\etens{O}}}
\newcommand{\etP}{{\etens{P}}}
\newcommand{\etQ}{{\etens{Q}}}
\newcommand{\etR}{{\etens{R}}}
\newcommand{\etS}{{\etens{S}}}
\newcommand{\etT}{{\etens{T}}}
\newcommand{\etU}{{\etens{U}}}
\newcommand{\etV}{{\etens{V}}}
\newcommand{\etW}{{\etens{W}}}
\newcommand{\etX}{{\etens{X}}}
\newcommand{\etY}{{\etens{Y}}}
\newcommand{\etZ}{{\etens{Z}}}
The command in markdown are defined as follows in mathJax
<script>