Commits

Georg Brandl committed 8d38013

The math extension displaymath directives now support ``name`` in
addition to ``label`` for giving the equation label, for compatibility
with Docutils.

  • Participants
  • Parent commits ead73f5

Comments (0)

Files changed (2)

   - #367: Added automatic exclusion of hidden members in inheritance
     diagrams, and an option to selectively enable it.
   - Added :confval:`pngmath_add_tooltips`.
+  - The math extension displaymath directives now support ``name`` in
+    addition to ``label`` for giving the equation label, for compatibility
+    with Docutils.
 
 * New locales:
 

sphinx/ext/mathbase.py

     final_argument_whitespace = True
     option_spec = {
         'label': directives.unchanged,
+        'name': directives.unchanged,
         'nowrap': directives.flag,
     }
 
             latex = self.arguments[0] + '\n\n' + latex
         node = displaymath()
         node['latex'] = latex
-        node['label'] = self.options.get('label', None)
+        node['label'] = self.options.get('name', None)
+        if node['label'] is None:
+            node['label'] = self.options.get('label', None)
         node['nowrap'] = 'nowrap' in self.options
         node['docname'] = self.state.document.settings.env.docname
         ret = [node]