diff --git a/inst/templates/bs4_book.html b/inst/templates/bs4_book.html
index 6bb319fc..ba7afe65 100644
--- a/inst/templates/bs4_book.html
+++ b/inst/templates/bs4_book.html
@@ -158,7 +158,7 @@
On this page
var script = document.createElement("script");
script.type = "text/javascript";
var src = "$if(mathjax)$$mathjax$$endif$";
- if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-AMS-MML_HTMLorMML";
+ if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=$if(mathjax-renderer)$$mathjax-renderer$$else$TeX-MML-AM_CHTML$endif$";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');
diff --git a/inst/templates/gitbook.html b/inst/templates/gitbook.html
index 2f6d3581..59487c5c 100644
--- a/inst/templates/gitbook.html
+++ b/inst/templates/gitbook.html
@@ -205,7 +205,7 @@
var script = document.createElement("script");
script.type = "text/javascript";
var src = "$if(mathjax)$$mathjax$$endif$";
- if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
+ if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=$if(mathjax-renderer)$$mathjax-renderer$$else$TeX-MML-AM_CHTML$endif$";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');