Hexo-math
This is a plugin adds support to Mathjax and KaTex. So we can then use LaTex for our math symbols.
Mathjax: A JavaScript display engine for mathematics that works in all browsers. No more setup for readers. It just works.
KaTex: The fastest math typesetting library for the web.
Link: https://github.com/hexojs/hexo-math (with instruction)
Installation:
1 | // requires hexo 5+ |
Usage
- KaTex
1 |
|
- MathJax
1 |
|
Per-article configuration
Override the global options via the front-matter of an article (post/page) basis.
1 |
|
Options
Disable math renderer in an article
1 |
|
Override global options:
1 |
|
Global Options
1 |
|
- css: Location of stylesheet.
- Specify a relative path if you’re self-hosting the stylesheet.
- Example:
css: '/css/style.css'
refers tosource/css/style.css
orthemes/<theme-name>/source/css/style.css
- Example:
- It can be disabled (css:false) if the installed theme has already included one.
- KaTex: defaults to the [official stylesheet] (https://github.com/KaTeX/KaTeX/blob/master/src/katex.less)
- MathJax: defaults to [style.css] (https://github.com/hexojs/hexo-math/blob/master/dist/style.css)
- Specify a relative path if you’re self-hosting the stylesheet.
KaTex
- options: Refer to the [documentation] (https://katex.org/docs/options.html) for available options.
MathJax
- options: Rendering options.
- conversion: Conversion options
- tex: [Tex input options.] (https://docs.mathjax.org/en/latest/options/input/tex.html)
- svg: [SVG output options.] (https://docs.mathjax.org/en/latest/options/output/svg.html)
Enable mathjax in your theme
_config.yml in your theme folder
1 | mathjax: |
Configuration priority etc.
Check latest Github page of this project link provided above.