]> BookStack Code Mirror - hacks/blob - content/mathjax/index.md
Add LaTeX/MathJax hack
[hacks] / content / mathjax / index.md
1 +++
2 title = "Render LaTeX with MathJax"
3 author = "@codemicro"
4 date = 2023-02-27T00:00:00Z
5 updated = 2023-02-27T00:00:00Z
6 tested = "v23.02"
7 +++
8
9 This hack will allow LaTeX equations and markup to be rendered within a page on
10 Bookstack.
11
12 Inline math can be surrounded with `$` and math blocks can be surrounded with 
13 `$$`.
14
15 This can be used with both the WYSISYG editor and the Markdown editor and will
16 affect everything on a given page, meaning this can be used in titles,
17 book/chapter headings, etc.
18
19 #### Considerations
20
21 This loads MathJax the MathJax JavaScript from a CDN, and will do so for every 
22 page load.
23
24 Live previews of the rendered LaTeX markup will not be rendered in the Markdown
25 editor's preview.
26
27 Using this markup may create difficulties when using the search engine to find
28 certain pages.
29
30 #### Options
31
32 It is possible to configure MathJax as documented [here](https://docs.mathjax.org/en/latest/web/configuration.html).
33
34 #### Code
35
36 {{<hack file="head.html" type="head">}}