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/pngmath.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/pngmath.py')
-rw-r--r-- | sphinx/ext/pngmath.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 85010b799..968139f15 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -30,6 +30,7 @@ from sphinx.util.png import read_png_depth, write_png_depth from sphinx.util.osutil import ensuredir, ENOENT, cd from sphinx.util.pycompat import sys_encoding from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath +from sphinx.ext.mathbase import get_node_equation_number if False: # For type annotation @@ -242,7 +243,8 @@ def html_visit_displaymath(self, node): self.body.append(self.starttag(node, 'div', CLASS='math')) self.body.append('<p>') if node['number']: - self.body.append('<span class="eqno">(%s)</span>' % node['number']) + number = get_node_equation_number(self.builder.env, node) + self.body.append('<span class="eqno">(%s)</span>' % number) if fname is None: # something failed -- use text-only as a bad substitute self.body.append('<span class="math">%s</span></p>\n</div>' % |