1

I would like to add equation numbers with MathJax v3.0. I don't understand where the following code must be added :

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

I made a non working JSFiddle here with some of my trials.

Edit : I need to number automatically all the equations.

Fifi
  • 3,360
  • 2
  • 27
  • 53

3 Answers3

3

With the configuration tag:'ams' you need to wrap the equation with \begin{equation} and \end{equation} . So write your equation as -

\begin{equation}
x_1 = \sqrt(y) 
\end{equation}
The_ehT
  • 1,202
  • 17
  • 32
  • Thank you, do you know what ams stand for ? – Fifi Nov 24 '19 at 07:59
  • @Fifi: originally, AMS stood for the American Mathematical Society, but in this context it more directly references the LaTeX packages made by them: https://tex.stackexchange.com/questions/32100/what-does-each-ams-package-do – Paul Wintz Mar 08 '23 at 22:17
1

Changing ams to all resolves the problem :

<script>window.MathJax = { tex: { tags: 'all' } }; </script>

https://jsfiddle.net/Lordfc0v/2/

Fifi
  • 3,360
  • 2
  • 27
  • 53
  • Hi, Fifi, thanks for your answer. I would like to know that how can we add this in the `MathJax.Hub.Config`? – xyz May 04 '20 at 01:21
0

I would recommend viewing Equation numbering in Jupyter notebooks

One of the solutions that I used from there is:

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

Run this in another cell and the automatic numbering should be turned on.