# MathJax Tips for Markdown (Hugo & Jupyter Notebook)

Hongtao Hao / 2023-03-02

## Matrix #

$$A = \begin{bmatrix} 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & -1 \\ -1 & 1 & 0 & 0 \\ 0 & 0 & -1 & 1 \end{bmatrix}$$


$$A = \begin{bmatrix} 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & -1 \\ -1 & 1 & 0 & 0 \\ 0 & 0 & -1 & 1 \end{bmatrix}$$

$$x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix}$$


$$x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix}$$

## Aligned equations #

\begin{aligned} a & = b \\ & = c \\ & = d \\ & = e \end{aligned}


\begin{aligned} a & = b \\ & = c \\ & = d \\ & = e \end{aligned}

## Linear program #

\begin{align*} \underset{x}{\text{maximize}}\qquad& cos(t)x_1 - cos(t)x_2 + sin(t)x_3 - sin(t)x_4\\ \text{subject to:}\qquad& x_1 - x_2 \le 1 \\ & x_3 - x_4 \le 1 \\ & x_2 - x_1 \le 1 \\ & x_4 - x_3 \le 1\\ & x_1, x_2, x_3, x_4 \ge 0 \end{align*}


\begin{align*} \underset{x}{\text{maximize}}\qquad& cos(t)x_1 - cos(t)x_2 + sin(t)x_3 - sin(t)x_4\\ \text{subject to:}\qquad& x_1 - x_2 \le 1 \\ & x_3 - x_4 \le 1 \\ & x_2 - x_1 \le 1 \\ & x_4 - x_3 \le 1\\ & x_1, x_2, x_3, x_4 \ge 0 \end{align*}

#writing