aboutsummaryrefslogtreecommitdiff
path: root/doc/tools
diff options
context:
space:
mode:
authorClément Pit-Claudel2018-09-25 10:43:42 +0200
committerThéo Zimmermann2018-09-25 12:45:57 +0200
commit44e9654d053b72931866d61b859ba831982c14fd (patch)
tree998e0f99cd7f7642c8ea6cd3cf0beed03a0598c1 /doc/tools
parent7eb8a7eb8d23ffaf149f71a46fb1b089b90db7f8 (diff)
[doc] Fix GH-8529: wrap macro definitions in math delimiters for MathJax
Diffstat (limited to 'doc/tools')
-rw-r--r--doc/tools/coqrst/coqdomain.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/tools/coqrst/coqdomain.py b/doc/tools/coqrst/coqdomain.py
index 97dabbf815..edf4e6ec9d 100644
--- a/doc/tools/coqrst/coqdomain.py
+++ b/doc/tools/coqrst/coqdomain.py
@@ -666,7 +666,9 @@ class ExampleDirective(BaseAdmonition):
class PreambleDirective(Directive):
r"""A reST directive to include a TeX file.
- Mostly useful to let MathJax know about `\def`s and `\newcommand`s.
+ Mostly useful to let MathJax know about `\def`s and `\newcommand`s. The
+ contents of the TeX file are wrapped in a math environment, as MathJax
+ doesn't process LaTeX definitions otherwise.
Usage::
@@ -693,7 +695,7 @@ class PreambleDirective(Directive):
with open(abs_fname, encoding="utf-8") as ltx:
latex = ltx.read()
- node = make_math_node(latex, env.docname, nowrap=True)
+ node = make_math_node(latex, env.docname, nowrap=False)
node['classes'] = ["math-preamble"]
set_source_info(self, node)
return [node]