summaryrefslogtreecommitdiff
path: root/sphinx/ext/pngmath.py
diff options
context:
space:
mode:
authorOliver Jahn <jahn@mit.edu>2017-10-05 12:41:05 -0400
committerOliver Jahn <jahn@mit.edu>2017-10-18 16:52:28 -0400
commit7fc43d336574a305cd119981256e93d7a4a2ce7e (patch)
tree6b61a04d194dd291623ad49b0d4c5121186cc25b /sphinx/ext/pngmath.py
parentd24ccb85578a7d1bbd22742e69f5dead0b52f140 (diff)
downloadsphinx-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.py4
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>' %