title: MathJax Plugin
date: 2018-01-01
categories:
- Plugins
- General
tags:
thumbnail: /gallery/math.jpg
---
### Configuration
To enable MathJax support, just set `plugins.mathjax = true` in your theme `_config.yml` file.
```yml
# Plugins
plugins:
...
mathjax: true # options: true, false
```
For further MathJax configurations, please edit `/layout/plugin/scripts.ejs`:
```html
<% if (theme.plugins.mathjax) { %>
<%- js('https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML') %>
<% } %>
```
### TeX and LaTeX input
> **Attention**: Please be noted that when you write Tex/LaTeX in Markdown files, you need to use escape characters to prevent certain signs from being processed by Markdown interpreter.
##### Input
```
When $a \ne 0$, there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
```
##### Result
When $a \ne 0$, there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
### MathML input
> **Attention**: please be noted that newline characters may be transformed to ` ` tag by Markdown interpreter and this will interfere with MathML notation. Please write all MathML inline.
##### Input
```
When, there are two solutions to and they are
```
##### Result
When, there are two solutions to and they are
### AsciiMath input
> **Attention**: please be noted that when you write AsciiMath in Markdown files, you need to use escape characters to prevent certain signs from being processed by Markdown interpreter.
##### Input
```
When \`a != 0\`, there are two solutions to \`ax^2 + bx + c = 0\` and they are
\`x = (-b +- sqrt(b^2-4ac))/(2a) .\`
```
##### Result
When \`a != 0\`, there are two solutions to \`ax^2 + bx + c = 0\` and they are