Add support for MathJax equation numbering #1500
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using the flag 'number_equations:true' you can add equation numbering to MathJax. The numbering happens when you write equations using \begin{equation}...\end{equation} as described here:
https://docs.mathjax.org/en/latest/input/tex/eqnumbers.html
An example was included in:
_posts/2019-08-08-text-and-typography.md
Type of change
Description
Option 1 (implemented)
I added a new flag:
'number_equations:true' in order to support equation numbering.
This flag changes the configuration for MathJax such that when true, MathJax supports equation numbering.
The change happens in js-selector.html and looks like:
The
tags: 'ams'
causes MathJax to generate equation numbering inside\begin{equation}
and\end{equation}
blocks.Option 2 (not implemented/simpler)
Potentially a simpler idea would be to have the equation numbering always on. This way, if someone wants to use it they can, but most people probably would not notice. I could prepare that patch if this is a direction you would be willing to pursue.
If the equation numbering would always be on, then:
Would work like previously.
However,
Would now require a
\notag
or\nonumber
to skip the (1) that would appear on the right.Additional context
This feature would be an answer to a previous request in issue #147
You can see a live demo of this working on https://qbrak.github.io/posts/how-to-least-squares
Here is the documentation from MathJax on how this works: https://docs.mathjax.org/en/latest/input/tex/eqnumbers.html
EDIT: I added more structure and clarity to the text