Bookdown - specify MathJax URL?

Viewed 193

When using Bookdown, is it possible to specify a custom URL for MathJax? The version served by RStudio is out of date, and I would like to use the most up to date version.

I have tried the following:

_output.yml:

bookdown::gitbook:
  css: style.css
  mathjax: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"

index.Rmd:

--- 
title: "Untitled"
author: "An author"
site: bookdown::bookdown_site
documentclass: book
---

$$E=mc^2$$

However, if I right click on the MathJax equation in the browser it shows the version as 2.7.2, not the intended version 3.0.5. Checking the html shows it is loading MathJax from mathjax.rstudio.com/latest, not the specified url.

Interestingly, in plain RMarkdown the following does correctly load MathJax 3.

Untitled.Rmd:

---
title: "Untitled"
author: "An author"
date: "15/07/2020"
output: 
  html_document: 
        mathjax: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
        keep_md: yes
---

$$E = mc^2$$

(Edit: raised issue on GitHub)

0 Answers
Related