> For the complete documentation index, see [llms.txt](https://evans-organization.gitbook.io/redefine-document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://evans-organization.gitbook.io/redefine-document/en/advanced/mathematical-formula.md).

# Mathematical formula

If you want to display math formulas in the article, you can use the plugin [**hexo-filter-mathjax**](https://github.com/next-theme/hexo-filter-mathjax/).

Configuration process:

1. Install the plugin **hexo-filter-mathjax** in the root directory of the Hexo project.

   ```bash
   $ cd hexo-site
   $ npm install hexo-filter-mathjax
   ```
2. Add the following configuration at the bottom of the Hexo configuration file `_config.yml`.

   ```yml
   mathjax:
     tags: none # or 'ams' or 'all'
     single_dollars: true # enable single dollar signs as in-line math delimiters
     cjk_width: 0.9 # relative CJK char width
     normal_width: 0.6 # relative normal (monospace) width
     append_css: true # add CSS to every page
     every_page: false # if true, every page will be rendered by mathjax regardless the `mathjax` setting in Front-matter of each article
   ```
3. Add the `mathjax: true` attribute to the article page. At this point, you can write formulas on this page.

   Example:

   ```yml
   ---
   title: MathJax Test
   date: 2020-09-12 16:02:07
   tags: MathJax
   categories: MathJax
   mathjax: true
   ---
   $$
   i\hbar\frac{\partial}{\partial t}\psi=-\frac{\hbar^2}{2m}\nabla^2\psi+V\psi
   $$
   ```

   Effect picture: ![image](https://evan.beee.top/img/image.76zdiodvgds0.png)
