LaTeX on mkdocs

This is a brief instruction if you want to write LaTeX in your blog and if you use mkdocs to write them.

Run the following command to install pymdown-extensions:

pip install pymdown-extensions

Once it is successfully installed, you need to add it to your config file, mkdocs.yaml.

markdown_extensions:
  - pymdownx.arithmatex:
      generic: true

extra_javascript:
  - javascripts/config.js
  - https://polyfill.io/v3/polyfill.min.js?features=es6
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

Close your server currently running and run it again. You should now be able to render LaTeX on your blog.

Inline would be $\pi <3$: \(\pi <3\) and large equations:

$$
|\psi(t)\rangle = e^{-itH}|\psi_0\rangle
$$
\[ |\psi(t)\rangle = e^{-itH}|\psi_0\rangle \]

References