aboutsummaryrefslogtreecommitdiff
path: root/plugin/math
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2013-08-13 08:53:31 -0400
committerHakim El Hattab <hakim.elhattab@gmail.com>2013-08-13 08:53:41 -0400
commitb17e285164bb17b920e8759ccb2891e147a0397e (patch)
treec327f056a49e2b9786a04ce7dca20be91bbd3dbf /plugin/math
parent71218583f7002c29bf8f3cc2fce37cb1e2823802 (diff)
downloadfreenode-live-2017-presentation-b17e285164bb17b920e8759ccb2891e147a0397e.tar
freenode-live-2017-presentation-b17e285164bb17b920e8759ccb2891e147a0397e.tar.gz
mathjax plugin updates #531
Diffstat (limited to 'plugin/math')
-rwxr-xr-xplugin/math/math.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/plugin/math/math.js b/plugin/math/math.js
index d021fdc..104d0e5 100755
--- a/plugin/math/math.js
+++ b/plugin/math/math.js
@@ -7,25 +7,26 @@
var RevealMath = window.RevealMath || (function(){
var config = Reveal.getConfig().math || {};
- config.host = config.host || 'http://cdn.mathjax.org/mathjax/latest/MathJax.js';
- config.mode = config.mode || 'TeX-AMS_HTML-full';
+ config.mathjax = config.mathjax || 'http://cdn.mathjax.org/mathjax/latest/MathJax.js';
+ config.dialect = config.dialect || 'TeX-AMS_HTML-full';
- loadScript( config.host + '?config=' + config.mode, function() {
+ loadScript( config.mathjax + '?config=' + config.dialect, function() {
MathJax.Hub.Config({
messageStyle: 'none',
- tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
+ tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] },
+ skipStartupTypeset: true
});
- // Process any math inside of the current slide when navigating,
- // this is needed since it's not possible to typeset equations
- // within invisible elements (far future or past).
+ // Typeset followed by an immediate reveal.js layout since
+ // the typesetting process could affect slide height
+ MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] );
+ MathJax.Hub.Queue( Reveal.layout );
+
+ // Reprocess equations in slides when they turn visible
Reveal.addEventListener( 'slidechanged', function( event ) {
- // This will only typeset equations that have not yet been
- // processed, as well as equations that have change since
- // last being processed.
- MathJax.Hub.Update( event.currentSlide );
+ MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] );
} );