diff options
author | Oliver Jahn <jahn@mit.edu> | 2017-10-05 12:41:05 -0400 |
---|---|---|
committer | Oliver Jahn <jahn@mit.edu> | 2017-10-18 16:52:28 -0400 |
commit | 7fc43d336574a305cd119981256e93d7a4a2ce7e (patch) | |
tree | 6b61a04d194dd291623ad49b0d4c5121186cc25b /sphinx/ext/mathjax.py | |
parent | d24ccb85578a7d1bbd22742e69f5dead0b52f140 (diff) | |
download | sphinx-git-7fc43d336574a305cd119981256e93d7a4a2ce7e.tar.gz |
use numfig for numbering equations by section rather than page
Diffstat (limited to 'sphinx/ext/mathjax.py')
-rw-r--r-- | sphinx/ext/mathjax.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/ext/mathjax.py b/sphinx/ext/mathjax.py index f25f91e74..aff5c103b 100644 --- a/sphinx/ext/mathjax.py +++ b/sphinx/ext/mathjax.py @@ -17,6 +17,7 @@ import sphinx from sphinx.locale import _ from sphinx.errors import ExtensionError from sphinx.ext.mathbase import setup_math as mathbase_setup +from sphinx.ext.mathbase import get_node_equation_number def html_visit_math(self, node): @@ -36,7 +37,8 @@ def html_visit_displaymath(self, node): # necessary to e.g. set the id property correctly if node['number']: - self.body.append('<span class="eqno">(%s)' % node['number']) + number = get_node_equation_number(self.builder.env, node) + self.body.append('<span class="eqno">(%s)' % number) self.add_permalink_ref(node, _('Permalink to this equation')) self.body.append('</span>') self.body.append(self.builder.config.mathjax_display[0]) |