HTML generated by Jupyter Book does not recognise inline equations

385 Views Asked by At

The official JupyterBook documentation states that simply placing an equation between two $ signs should be all that is needed, e.g. $y = wx + b$. Unfortunately, on creating the book (jb build ... on the command line) the HTML file is generated incorrectly so that the equation is not recognised and, therefore, rendered as plain text (including the $ signs).

Interestingly, blocked equations using double $$ signs come out correctly.

Updating JupyterLab to 4.0.3 had no effect, same with updating the following:

  • Jupyter Book : 0.15.1
  • External ToC : 0.3.1
  • MyST-Parser : 0.18.1
  • MyST-NB : 0.17.2
  • Sphinx Book Theme : 1.0.1
  • Jupyter-Cache : 0.6.1
  • NbClient : 0.5.13

An extensive search yielded no answers.

At least it was possible to find out that HTML generated via the export function of JupyterLab works flawlessly.

1

There are 1 best solutions below

0
On

I had the same problem. I found that "dollarmath" was disabled as default, so in your _config.yml file, simply enable it and it works (at least it did for me)

For example:

parse:
  myst_enable_extensions:
    # don't forget to list any other extensions you want enabled,
    # including those that are enabled by default!
    - amsmath
    - dollarmath