Latex equation via MathJax

In order to make my blog ready for Mathematic equation, I enable MathJax in ghost via customization of core/client and theme template project. This blog is to record the critical math equation for reference purpose.

  • Case 1: equations with auto-numbering

\begin{equation}
E = mc^2
\label{myequation}
\end{equation}

As shown in \eqref{myequation}, energy and mass are related.

\begin{bmatrix}
a & b \\ c & d
\end{bmatrix}

In \eqref{ eq:sample }, we find the value of an interesting integral:

\begin{equation}
\int_0^\infty \frac{ x^3 }{ e^x-1 },dx = \frac{ \pi^4 }{15}
\label{ eq:sample }
\end{equation}

  • Case 2: embedded math function
  1. CF with collaborative filtering algorithm

$$
J(x^{ (1) }, ..., x^{ (n_m) }, \theta^{ (1) }, ..., \theta^{ (n_u) }) = \frac{ 1 }{ 2 } \sum_{ (i,j): r(i,j)!=-1 } \left[ (\theta^{ (j) })^{T} * x^{ (i) } - y^{ (i,j) } \right] ^ {2} + \frac{ \lambda }{ 2 } \sum_{ i=1 }^{ n_{ m } }\sum_{ k=1 }^{ n }(x_k^{ (i) })^2 + \frac{ \lambda }{ 2 }\sum_{ j=1 }^{ n_{u} }\sum_{ k=1 }^{ n }( \theta_k^{ (j) } )^2
$$

  1. Conditional function

$$
\begin{array}
\mathcal{V_t(S_{t-1})} =
\begin{cases}
V_{t-1}(S_{t-1}) + \alpha_t\left[r_t + rV_{t-1}(S_t) - V_t(S_{t-1}) \right] & \\
V_{t-1}(S_{t-1}) & \text{otherwise for convergence}
\end{cases}
\end{array}
$$