The theme I chose does not come with a built-in math renderer, (but how can one write articles without LaTeX?), so I looked for a way to install LaTeX and here is a simple method. qwq
Installation#
$ npm install hexo-filter-mathjax
$ hexo clean
Configuration#
Add the following to the _config.yml in the blog directory
mathjax:
tags: none # or 'ams' or 'all'
single_dollars: true # Whether to use LaTeX for single dollar signs
cjk_width: 0.9 # relative CJK char width
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to pages rendered by MathJax
every_page: false # If set to true, MathJax will load on every page, recommended to turn off
packages: # extra packages to load
extension_options: {}
# you can put your extension options here
# see http://docs.mathjax.org/en/latest/options/input/tex.html#tex-extension-options for more detail
In the front-matter where LaTeX needs to be loaded, write mathjax: true
Note#
- For formulas introduced by single dollar signs, there should be no space after the starting $ and before the ending $.
- If there is a conflict between LaTeX symbols and Markdown syntax, please escape with , for example, * should be written as \*.
- this can escape your LaTeX.