Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arcticlampyrid/hexo-filter-katex

Server side Math Expression Renderer for Hexo, powered by KaTeX.
https://github.com/arcticlampyrid/hexo-filter-katex

Last synced: about 19 hours ago
JSON representation

Server side Math Expression Renderer for Hexo, powered by KaTeX.

Awesome Lists containing this project

README

        

## hexo-filter-katex
[![npm-image]][npm-url]
[![license-image]](LICENSE)
Server side Math Expression Renderer for Hexo, powered by [KaTeX](https://katex.org/).

## Examples
```markdown
## Inline
$ \frac{b^2+c^2-a^2} $
## Block
$$
\cos A = \frac{b^2+c^2-a^2}{2bc} = \frac{(b+c)^2-a^2-2bc}{2bc}
$$
```

## Config
The plugin works perfectly out of the box.
Though, you can config it to adapt to your preferences.
```yaml
katex:
render_options:
# See https://katex.org/docs/options.html for more details
# Note that `displayMode` is implicitly enabled for Math Block but disabled for Inline Math.

# output: htmlAndMathml
# strict: false
# trust: true

stylesheet_fragment: '' # A HTML fragment injected right before for stylesheet
```

## Compatibility
Even when you are using a math-unaware Markdown Renderer (eg. marked), additional escaping is not necessary.
The plugin ensures that all math expressions are not interpreted as Markdown syntax.

Note that the tag `_internal_math_placeholder` will be used internally, and you need to ensure that it is not used elsewhere.

[npm-image]: https://img.shields.io/npm/v/hexo-filter-katex?style=flat-square
[license-image]: https://img.shields.io/npm/l/hexo-filter-katex?style=flat-square
[npm-url]: https://www.npmjs.com/package/hexo-filter-katex