79463720

Date: 2025-02-24 13:45:46
Score: 2
Natty:
Report link

As per recent versions of Jupyterlab (my guess: after version 4.0, released in June 2023), the solution by @waddles is broken due to the switch from Mathjax 2 to Mathjax 3, see version Jupyterlab 4.0 announcement.

Running the proposed code cell

%%javascript
MathJax.Hub.Config({
    TeX: { equationNumbers: { autoNumber: "AMS" } }
});

yields a Javascript Error: MathJax.Hub is undefined.

I looked at MathJax 3.2 doc which says that equation numbering should be activated by the following javascript code:

window.MathJax = {
  tex: {
    tags: 'ams'
  }
};

I've tried to implement this in a Jupyterlab code cell

%%javascript
window.MathJax = {
  tex: {
    tags: 'ams'
  }
};

and it runs without error.

However, the following Markdown cell doesn't work (doesn't work in the sense that 1) the equation is not numbered and 2) the reference is replace by (???)):

Here is equation number \eqref{eqa}:
\begin{equation}
    \label{eqa}
    a=1
\end{equation}

So I don't know what is the solution of Jupyterlab 4.0+...

Reasons:
  • Blacklisted phrase (1): ???
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @waddles
  • Low reputation (0.5):
Posted by: Pierre H.