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
{{ message }}
This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: docs/_posts/2015-08-10-mathjax-example.md
+40-8
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,55 @@ title: "MathJax Example"
3
3
date: 2015-08-10T08:08:50-04:00
4
4
---
5
5
6
-
[MathJax](http://www.mathjax.org/) is a simple way of including Tex/LaTex/MathML based mathematics in HTML webpages. To get up and running you need to include the MathJax script in the header of your github pages page, and then write some maths. For LaTex, there are two delimiters you need to know about, one for block or displayed mathematics `\[ ... \]`, and the other for inline mathematics `\( ... \)`.
6
+
[MathJax](http://www.mathjax.org/) is a simple, yet powerful, way of
7
+
including Tex/LaTex/MathML based mathematics in HTML webpages.
7
8
8
9
## Usage
9
10
10
-
To enable MathJax support be sure Kramdown is your Markdown flavor of choice and MathJax is set to true in your `_config.yml` file.
11
+
To enable MathJax support configure your `_config.xml` to:
12
+
* Set `kramdown` as the Markdown parser.
13
+
* Enable MathJax.
14
+
15
+
The version of MathJax enabled is v3.
16
+
17
+
An example setting for `_config.xml` is shown below:
11
18
12
19
```yaml
13
20
markdown: kramdown
14
-
mathjax: true
21
+
mathjax:
22
+
enable: true
23
+
combo: "tex-svg"
24
+
tags: "ams"
15
25
```
16
26
17
-
$$a^2 + b^2 = c^2$$
27
+
Use `$$` as delimiters to enable TeX math mode, both for inline and display (i.e. block) rendering.
28
+
29
+
Here is an example equation that is inline: $$a^2 + b^2 = c^2$$, where
30
+
$$a$$, $$b$$, and $$c$$ are variables.
31
+
32
+
Here is a block rendering with no default equation numbering:
33
+
34
+
$$
35
+
\frac{1}{n^{2}}
36
+
$$
37
+
38
+
And, below is a block using the `\begin{equation}` and
39
+
`\end{equation}`LaTeX delimiters. This equation will be numbered in
40
+
the `ams` and `all` setting for `mathjax.tags`.
18
41
19
-
Here is an example MathJax inline rendering \\( 1/x^{2} \\), and here is a block rendering:
If equation numbering is turned on, we should see an equation number here: $$\eqref{test}$$.
22
49
23
-
The only thing to look out for is the escaping of the backslash when using markdown, so the delimiters become `\\[ ... \\]` and `\\( ... \\)` for inline and block maths respectively.
50
+
An example using the `{align}` LaTeX environment is below. The first equation has a `\notag` directive.
Copy file name to clipboardexpand all lines: example/_posts/2015-08-10-mathjax-example.md
+40-8
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,55 @@ title: "MathJax Example"
3
3
date: 2015-08-10T08:08:50-04:00
4
4
---
5
5
6
-
[MathJax](http://www.mathjax.org/) is a simple way of including Tex/LaTex/MathML based mathematics in HTML webpages. To get up and running you need to include the MathJax script in the header of your github pages page, and then write some maths. For LaTex, there are two delimiters you need to know about, one for block or displayed mathematics `\[ ... \]`, and the other for inline mathematics `\( ... \)`.
6
+
[MathJax](http://www.mathjax.org/) is a simple, yet powerful, way of
7
+
including Tex/LaTex/MathML based mathematics in HTML webpages.
7
8
8
9
## Usage
9
10
10
-
To enable MathJax support be sure Kramdown is your Markdown flavor of choice and MathJax is set to true in your `_config.yml` file.
11
+
To enable MathJax support configure your `_config.xml` to:
12
+
* Set `kramdown` as the Markdown parser.
13
+
* Enable MathJax.
14
+
15
+
The version of MathJax enabled is v3.
16
+
17
+
An example setting for `_config.xml` is shown below:
11
18
12
19
```yaml
13
20
markdown: kramdown
14
-
mathjax: true
21
+
mathjax:
22
+
enable: true
23
+
combo: "tex-svg"
24
+
tags: "ams"
15
25
```
16
26
17
-
$$a^2 + b^2 = c^2$$
27
+
Use `$$` as delimiters to enable TeX math mode, both for inline and display (i.e. block) rendering.
28
+
29
+
Here is an example equation that is inline: $$a^2 + b^2 = c^2$$, where
30
+
$$a$$, $$b$$, and $$c$$ are variables.
31
+
32
+
Here is a block rendering with no default equation numbering:
33
+
34
+
$$
35
+
\frac{1}{n^{2}}
36
+
$$
37
+
38
+
And, below is a block using the `\begin{equation}` and
39
+
`\end{equation}`LaTeX delimiters. This equation will be numbered in
40
+
the `ams` and `all` setting for `mathjax.tags`.
18
41
19
-
Here is an example MathJax inline rendering \\( 1/x^{2} \\), and here is a block rendering:
If equation numbering is turned on, we should see an equation number here: $$\eqref{test}$$.
22
49
23
-
The only thing to look out for is the escaping of the backslash when using markdown, so the delimiters become `\\[ ... \\]` and `\\( ... \\)` for inline and block maths respectively.
50
+
An example using the `{align}` LaTeX environment is below. The first equation has a `\notag` directive.
0 commit comments