Ver código fonte

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.
      });
John MacFarlane 7 anos atrás
pai
commit
773569b4a2
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      plugin/math/math.js

+ 4 - 4
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
 		});