You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: This plugin is a server-side math rendering plugin, which does not depend on any front-end scripts. If you have already enabled other math rendering methods before installing this plugin, please do the following to avoid conflicts:
Remove all other Hexo math plugins
Disable front-end math renderer in Hexo theme settings (For theme NexT, you need to set both math.mathjax.enable and math.katax.enable to false)
Delete front-end scripts related to math rendering
Installation
$ npm install hexo-filter-mathjax
$ hexo clean
Options
You can configure this plugin in Hexo _config.yml. Default options:
mathjax:
tags: none # or 'ams' or 'all'single_dollars: true # enable single dollar signs as in-line math delimiterscjk_width: 0.9# relative CJK char widthnormal_width: 0.6# relative normal (monospace) widthappend_css: true # add CSS to pages rendered by MathJaxevery_page: false # if true, every page will be rendered by MathJax regardless the `mathjax` setting in Front-matterpackages: # extra packages to loadextension_options: {}# you can put your extension options here# see https://docs.mathjax.org/en/latest/options/input/tex.html#tex-extension-options for more detail
Usage
Set mathjax: true in Front-matter of each article (post / page) that you would like to enable MathJax. For example:
---title: On the Electrodynamics of Moving Bodiescategories: Physicsdate: 1905-06-30 12:00:00mathjax: true---
Then you can use the LaTeX syntax in the article.
Renderer
hexo-renderer-pandoc is recommended because it can handle mathematical formulas in markdown documents perfectly. But you need to be aware that inline Math (..$...$) must not have white spaces after the opening $ and before the ending $. For example:
If you are using other renderers, such as hexo-renderer-marked, you need to be aware of the conflict between LaTeX and Markdown syntax. For example, an underscore (_) may be interpreted as the start of italic text in Markdown, or subscripted mark in TeX. Use \ to escape if necessary: