Update documentation for mathjax
This commit is contained in:
parent
094c1e7a52
commit
a1926bbe8e
|
@ -1,3 +1,6 @@
|
||||||
title = "mdBook Documentation"
|
title = "mdBook Documentation"
|
||||||
description = "Create book from markdown files. Like Gitbook but implemented in Rust"
|
description = "Create book from markdown files. Like Gitbook but implemented in Rust"
|
||||||
author = "Mathieu David"
|
author = "Mathieu David"
|
||||||
|
|
||||||
|
[output.html]
|
||||||
|
mathjax-support = true
|
|
@ -1,20 +1,30 @@
|
||||||
# MathJax Support
|
# MathJax Support
|
||||||
|
|
||||||
mdBook supports math equations through [MathJax](https://www.mathjax.org/).
|
mdBook has optional support for math equations through [MathJax](https://www.mathjax.org/).
|
||||||
|
|
||||||
**However the normal method for indication math equations with `$$` does not work (yet?).**
|
To enable MathJax, you need to add the `mathjax-support` key to your `book.toml` under the `output.html` section.
|
||||||
|
|
||||||
To indicate an inline equation \\( \int x = \frac{x^2}{2} \\) use
|
```toml
|
||||||
```
|
[output.html]
|
||||||
\\( \int x = \frac{x^2}{2} \\)
|
mathjax-support = true
|
||||||
```
|
```
|
||||||
|
|
||||||
To indicate a block equation
|
>**Note:**
|
||||||
|
The usual delimiters MathJax uses are not yet supported. You can't currently use `$$ ... $$` as delimiters and the `\[ ... \]` delimiters need an extra backslash to work. Hopefully this limitation will be lifted soon.
|
||||||
|
|
||||||
|
### Inline equations
|
||||||
|
Inline equations are delimited by `\\[` and `\\]`. So for example, to render the following inline equation \\( \int x dx = \frac{x^2}{2} + C \\) you would write the following:
|
||||||
|
```
|
||||||
|
\\( \int x dx = \frac{x^2}{2} + C \\)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Block equations
|
||||||
|
Block equations are delimited by `\\[` and `\\]`. To render the following equation
|
||||||
|
|
||||||
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
|
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
|
||||||
|
|
||||||
|
|
||||||
use
|
you would write:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
|
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
|
||||||
|
|
Loading…
Reference in New Issue