summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2021-04-08 16:35:54 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2021-04-08 16:35:54 +0000
commitd3864dbb5eed4ec01be6ef6b97c2d009c6d9840d (patch)
treedd2ac01db2624733d013e03c8d1b2942290d3fc5
parentc8b2df744ce6c772f7e0dbf76c904e74e9e63fde (diff)
downloaddocutils-d3864dbb5eed4ec01be6ef6b97c2d009c6d9840d.tar.gz
Fix bug #406 (MathML translation of ``\mathbf``).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8675 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/HISTORY.txt4
-rw-r--r--docutils/docutils/utils/math/latex2mathml.py2
-rw-r--r--docutils/test/functional/expected/math_output_mathml.xhtml4
3 files changed, 7 insertions, 3 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index db0c96684..2acc8a128 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -16,6 +16,10 @@
Changes Since 0.17
==================
+* docutils/utils/math/latex2mathml.py
+
+ - Fix bug #406 (MathML translation of ``\mathbf``).
+
* docutils/writers/latex2e/__init__.py:
- Open "docutils.sty" with encoding set to "utf8".
diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py
index dfc65027c..6e828c966 100644
--- a/docutils/docutils/utils/math/latex2mathml.py
+++ b/docutils/docutils/utils/math/latex2mathml.py
@@ -524,7 +524,7 @@ def handle_keyword(name, node, string):
node = node.append(mo(negatables[operator]))
skip += len(operator)
elif name == 'mathbf':
- style = mstyle(nchildren=1, fontweight='bold')
+ style = mstyle(nchildren=1, mathvariant='bold')
node.append(style)
node = style
elif name == 'mathbb':
diff --git a/docutils/test/functional/expected/math_output_mathml.xhtml b/docutils/test/functional/expected/math_output_mathml.xhtml
index 5583763c6..e8ee00d56 100644
--- a/docutils/test/functional/expected/math_output_mathml.xhtml
+++ b/docutils/test/functional/expected/math_output_mathml.xhtml
@@ -46,7 +46,7 @@ See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference
<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
<mtable>
<mtr>
-<mtd><mstyle fontweight="bold">
+<mtd><mstyle mathvariant="bold">
<mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
<mrow>
<mtable>
@@ -58,7 +58,7 @@ See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference
<mtd><mi>d</mi></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
</div>
<p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mo>|</mo><mstyle fontweight="bold">
+<mrow><mo>|</mo><mstyle mathvariant="bold">
<mrow><mi>M</mi></mrow></mstyle><mo>|</mo><mo>=</mo><mi>a</mi><mi>d</mi><mo>-</mo><mi>b</mi><mi>c</mi></mrow></math>.</p>
<p>More than one display math block can be put in one math directive.
For example, the following sum and integral with limits:</p>