# Mathematics

To enable LaTeX syntax for maths:

- Set
`mathjax-enabled: true`

in`_config.yml`

. It is off (`false`

) by default to avoid loading unnecessary scripts in books without maths. - For PDF output, you must have PhantomJS installed. (PhantomJS must render the maths before Prince can include it in PDF output.)

The LaTeX is turned into displayed maths by MathJax. Surround your LaTeX with `$$`

… `$$`

to have MathJax process it.

## MathJax in HTML blocks

Sometimes you have to use actual HTML code in your markdown, for instance when adding an HTML table to a figure include. In that case, surround LaTeX with `$$`

… `$$`

for displayed maths (centered, with blank space above and below), and `\(`

… `\)`

for inline maths.

## Avoid using LaTeX for content layout

LaTeX syntax can store two different kinds of info:

- mathematics, delimited in our markdown with
`$$`

- content layout, which must not be used with MathJax.

MathJax can only display the mathematics, and does not understand content layout. (More detail here.)