diff --git a/CHANGES b/CHANGES index 20d90d57e..b2e61d64d 100644 --- a/CHANGES +++ b/CHANGES @@ -88,6 +88,8 @@ Release 1.1 (in development) * autodoc now supports documenting the signatures of ``functools.partial`` objects. +* Added :confval:`pngmath_add_tooltips`. + * C++ domain now supports array definitions. diff --git a/doc/ext/math.rst b/doc/ext/math.rst index ae91875d5..c20961045 100644 --- a/doc/ext/math.rst +++ b/doc/ext/math.rst @@ -170,6 +170,13 @@ There are various config values you can set to influence how the images are buil Unfortunately, this only works when the `preview-latex package`_ is installed. Therefore, the default for this option is ``False``. +.. confval:: pngmath_add_tooltips + + Default: true. If false, do not add the LaTeX code as an "alt" attribute for + math images. + + .. versionadded:: 1.1 + :mod:`sphinx.ext.mathjax` -- Render math via JavaScript ------------------------------------------------------- diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 37b4d3239..78c331a60 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -179,7 +179,7 @@ def cleanup_tempdir(app, exc): pass def get_tooltip(self, node): - if self.builder.config.pngmath_use_tooltips : + if self.builder.config.pngmath_add_tooltips: return ' alt="%s"' % self.encode(node['latex']).strip() return '' @@ -198,12 +198,10 @@ def html_visit_math(self, node): self.body.append('%s' % self.encode(node['latex']).strip()) else: - c = '') raise nodes.SkipNode def html_visit_displaymath(self, node): @@ -228,10 +226,8 @@ def html_visit_displaymath(self, node): self.body.append('%s

\n' % self.encode(node['latex']).strip()) else: - c = '

\n') raise nodes.SkipNode @@ -244,5 +240,5 @@ def setup(app): ['-gamma 1.5', '-D 110'], 'html') app.add_config_value('pngmath_latex_args', [], 'html') app.add_config_value('pngmath_latex_preamble', '', 'html') - app.add_config_value('pngmath_use_tooltips', True, 'html') + app.add_config_value('pngmath_add_tooltips', True, 'html') app.connect('build-finished', cleanup_tempdir)