From 5a774ef6f3b38b19b26913a34b1388530c72334e Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 9 Apr 2013 14:31:22 +0200 Subject: Initial Commit --- deck.js/extensions/simplemath/deck.simplemath.js | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 deck.js/extensions/simplemath/deck.simplemath.js (limited to 'deck.js/extensions/simplemath') 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 -- cgit v1.2.1