aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-29 21:53:10 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-29 21:57:29 -0800
commit773569b4a2668be34b9993f718766d77100968ef (patch)
tree097fec61fa12b2d936086024d1108ee37abfe7d6 /plugin
parenta0c013606e130baad976195730dcd7e7cd9e2855 (diff)
downloadperl-software-in-gnu-guix-773569b4a2668be34b9993f718766d77100968ef.tar
perl-software-in-gnu-guix-773569b4a2668be34b9993f718766d77100968ef.tar.gz
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. });
Diffstat (limited to 'plugin')
-rwxr-xr-xplugin/math/math.js8
1 files 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
});