summaryrefslogtreecommitdiff
path: root/deck.js/extensions/simplemath
diff options
context:
space:
mode:
Diffstat (limited to 'deck.js/extensions/simplemath')
-rw-r--r--deck.js/extensions/simplemath/deck.simplemath.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/deck.js/extensions/simplemath/deck.simplemath.js b/deck.js/extensions/simplemath/deck.simplemath.js
new file mode 100644
index 0000000..c09d6f3
--- /dev/null
+++ b/deck.js/extensions/simplemath/deck.simplemath.js
@@ -0,0 +1,25 @@
+/*!
+Deck JS - deck.simplemath
+Copyright (c) 2012 RĂ©mi Emonet,
+using a modified version of the script from http://gold-saucer.afraid.org/mathml/greasemonkey/ by Steve Cheng
+*/
+
+/*
+This module provides a support for latex equation syntax.
+*/
+
+(function($, deck, undefined) {
+ var $d = $(document);
+ var may = function(f) {return f ? f : function() {}};
+
+ $d.bind('deck.init', function() {
+ var container = $[deck]('getContainer');
+ $('.latex', container).each(function() {
+ var it = this;
+ var v = $(it).text();
+ it.innerHTML = "$\\displaystyle "+v+"$";
+ new latex2mml().patch_element(it);
+ });
+ });
+
+})(jQuery, 'deck'); \ No newline at end of file