From 773569b4a2668be34b9993f718766d77100968ef Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 29 Nov 2017 21:53:10 -0800 Subject: [PATCH] Allow tex2jax options to be passed into math plugin. Closes #2026. This does not change the default behavior of the math plugin, but it allows $ delimiters to be disabled (which is usually what you want, since otherwise normal uses of $ for currency get treated as math delimiters). To use: Reveal.initialize({ math: { tex2jax: { inlineMath: [['\\(','\\)']], skipTags: ['script','noscript','style', 'textarea','pre'] } }, etc. }); --- plugin/math/math.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/math/math.js b/plugin/math/math.js index e3b4089..7867376 100755 --- a/plugin/math/math.js +++ b/plugin/math/math.js @@ -9,15 +9,15 @@ var RevealMath = window.RevealMath || (function(){ var options = Reveal.getConfig().math || {}; options.mathjax = options.mathjax || 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js'; options.config = options.config || 'TeX-AMS_HTML-full'; + options.tex2jax = options.tex2jax || { + inlineMath: [['$','$'],['\\(','\\)']] , + skipTags: ['script','noscript','style','textarea','pre'] }; loadScript( options.mathjax + '?config=' + options.config, function() { MathJax.Hub.Config({ messageStyle: 'none', - tex2jax: { - inlineMath: [['$','$'],['\\(','\\)']] , - skipTags: ['script','noscript','style','textarea','pre'] - }, + tex2jax: options.tex2jax, skipStartupTypeset: true });