summaryrefslogtreecommitdiff
path: root/sphinx/directives/patches.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/directives/patches.py')
-rw-r--r--sphinx/directives/patches.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py
index 3c31571ac..2d8ca636a 100644
--- a/sphinx/directives/patches.py
+++ b/sphinx/directives/patches.py
@@ -126,13 +126,16 @@ class MathDirective(SphinxDirective):
latex = '\n'.join(self.content)
if self.arguments and self.arguments[0]:
latex = self.arguments[0] + '\n\n' + latex
+ label = self.options.get('label', self.options.get('name'))
node = nodes.math_block(latex, latex,
docname=self.env.docname,
- number=self.options.get('name'),
- label=self.options.get('label'),
+ number=None,
+ label=label,
nowrap='nowrap' in self.options)
- ret = [node] # type: List[nodes.Node]
+ self.add_name(node)
set_source_info(self, node)
+
+ ret = [node] # type: List[nodes.Node]
self.add_target(ret)
return ret