Permalink
Browse files

Better MathJax support and sample slides

  • Loading branch information...
1 parent a957f15 commit 550f796dd54dc91c56df0cab28067bae34b0d649 @adamzap committed Aug 24, 2013
Showing with 24 additions and 47 deletions.
  1. +0 −46 math_example.rst
  2. +18 −0 samples/math/math_example.md
  3. +1 −1 src/landslide/main.py
  4. +5 −0 src/landslide/themes/default/base.html
View
@@ -1,46 +0,0 @@
-Slides in ReStructuredText
-==========================
-
-----
-
-Here we Go
-----------
-
-This is foo
-
-This is bar
-
-This is ünicô∂e
-
-- This
-- Is
-- A
-- List
-
-----
-
-
-Some math
-=========
-
-.. math::
- α_t(i) = P(O_1, O_2, … O_t, q_t = S_i λ)
-
-The area of a circle is :math:`A_\text{c} = (\pi/4) d^2`.
-
-----
-
-Table
------
-
-.. table:: Truth table for "not"
-
- ===== =====
- A not A
- ===== =====
- False True
- True False
- ===== =====
-
-.. DANGER::
- Beware killer rabbits!
@@ -0,0 +1,18 @@
+# MathJax Support
+
+---
+
+## Math
+
+To get MathJax rendering, you must:
+
+1. Compile your presentation with the `-m` flag
+2. Escape all backslashes in your MathJax markup
+
+So this MathJax markup: `\[ \left( \sum_{k=1}^n a_k b_k \right)^2 \]`
+
+When escaped as this: `\\[ \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\]`
+
+Renders to this:
+
+\\[ \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\]
View
@@ -150,7 +150,7 @@ def _parse_options():
"-m", "--math-output",
action="store_true",
dest="math_output",
- help="Enable mathematical output using mathjax",
+ help="Enable mathematical output using MathJax",
default=False
)
@@ -66,6 +66,11 @@
{% endif %}
{% endfor %}
{% if math_output %}
+ <script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
+ });
+ </script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
{% endif %}
<!-- /Javascripts -->

0 comments on commit 550f796

Please sign in to comment.