🇨🇦
hexo-theme-redefine
BlogGithub
English
English
  • Project Description
  • Get Started
    • Installation
    • Update
    • Usage
  • Configuration
    • Create a theme config file
    • base_info
    • style
      • primary_color
      • avatar
      • favicon
      • article_img_align
      • left_side_width
      • content_max_width
      • nav_color
      • hover
      • first_screen
      • scroll
    • social_contact
    • menu
    • home_article
    • post
      • word_count
      • author_label
    • toc
    • copyright_info
    • website_count
    • local_search
    • comment
      • use
      • Waline
      • Gitalk
      • Twikoo
    • rss
    • lazyload
    • cdn
    • pjax
    • footer
  • Advanced
    • Create a page
    • Note modules
    • Article top
    • Mathematical formula
    • Friendship style
    • file comparison
    • Resource compression
Powered by GitBook
On this page
  1. Advanced

Mathematical formula

PreviousArticle topNextFriendship style

Last updated 2 years ago

If you want to display math formulas in the article, you can use the plugin .

Configuration process:

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

    $ cd hexo-site
    $ npm install hexo-filter-mathjax
  2. Add the following configuration at the bottom of the Hexo configuration file _config.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:

    ---
    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:

hexo-filter-mathjax
image