White Cabinet

Hugo Theme

Inserting mathematical expressions

Posted on 9 Mar, 2020

By enabling math in the config.toml, you can include mathematical expressions powered by $$\KaTeX$$ in your pages:

[Params]
  ...
  math = true
  ...

This will be useful especially for pages with scientific contents.

For example, by writing

$$
-\frac{\hbar^2}{2m}\left(\nabla^2 + V(\boldsymbol{r}) \right)\phi(t,\boldsymbol{r}) = i\hbar \frac{\partial}{\partial t} \phi(t,\boldsymbol{r}),
$$

it will be rendered as

$$ -\frac{\hbar^2}{2m}\left(\nabla^2 + V(\boldsymbol{r}) \right)\phi(t,\boldsymbol{r}) = i\hbar \frac{\partial}{\partial t} \phi(t,\boldsymbol{r}) . $$

If you want to insert an equation inline, by writing $E=mc^2$, you get $E=mc^2$.