Skip to content

Commit 550f796

Browse files
committed
Better MathJax support and sample slides
1 parent a957f15 commit 550f796

File tree

4 files changed

+24
-47
lines changed

4 files changed

+24
-47
lines changed

math_example.rst

Lines changed: 0 additions & 46 deletions
This file was deleted.

samples/math/math_example.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MathJax Support
2+
3+
---
4+
5+
## Math
6+
7+
To get MathJax rendering, you must:
8+
9+
1. Compile your presentation with the `-m` flag
10+
2. Escape all backslashes in your MathJax markup
11+
12+
So this MathJax markup: `\[ \left( \sum_{k=1}^n a_k b_k \right)^2 \]`
13+
14+
When escaped as this: `\\[ \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\]`
15+
16+
Renders to this:
17+
18+
\\[ \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\]

src/landslide/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _parse_options():
150150
"-m", "--math-output",
151151
action="store_true",
152152
dest="math_output",
153-
help="Enable mathematical output using mathjax",
153+
help="Enable mathematical output using MathJax",
154154
default=False
155155
)
156156

src/landslide/themes/default/base.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
{% endif %}
6767
{% endfor %}
6868
{% if math_output %}
69+
<script type="text/x-mathjax-config">
70+
MathJax.Hub.Config({
71+
tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
72+
});
73+
</script>
6974
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
7075
{% endif %}
7176
<!-- /Javascripts -->

0 commit comments

Comments
 (0)