Add `MathJax` support (#43)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor 2025-03-17 16:20:03 +00:00 committed by GitHub
parent 4d264ee9a0
commit 0f46e1904f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -15,6 +15,22 @@ To add a new blogpost, please refer to `_posts/2023-06-20-vllm.md` as an example
The blog is automatically built and deployed by GitHub Actions when `main` is pushed to.
## LaTeX Math
The blog supports LaTeX math via [MathJax](https://docs.mathjax.org/en/latest/index.html).
It can be enabled by adding `math: true` to the document frontmatter. It has been configured to support the standard LaTeX style math notation, i.e.:
```latex
$ inline math $
```
```latex
$$
math block
$$
```
## Theme customization
The theme we are using is [Minima](https://github.com/jekyll/minima). If you need to customise anything from this theme, see [Overriding theme defaults](https://jekyllrb.com/docs/themes/#overriding-theme-defaults).

View File

@ -0,0 +1,12 @@
{% if page.math %}
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\\[', '\\]']]
}
};
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
{% endif %}