|
From: <mi...@us...> - 2021-05-20 12:18:58
|
Revision: 8736
http://sourceforge.net/p/docutils/code/8736
Author: milde
Date: 2021-05-20 12:18:55 +0000 (Thu, 20 May 2021)
Log Message:
-----------
MathML: First part of fix to #407.
Partially fix #407 "Inline MathML role and block MathML
directive appear with reversed styles."
Modified Paths:
--------------
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/test/functional/tests/math_output_mathml.py
Added Paths:
-----------
trunk/docutils/test/functional/expected/math_output_mathml.html
Removed Paths:
-------------
trunk/docutils/test/functional/expected/math_output_mathml.xhtml
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 10:08:11 UTC (rev 8735)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 12:18:55 UTC (rev 8736)
@@ -233,9 +233,9 @@
return ['<%s>' % self.__class__.__name__]
xmlns = 'http://www.w3.org/1998/Math/MathML'
if self.inline:
- return ['<math xmlns="%s">' % xmlns]
+ return ['<math xmlns="%s" displaystyle="false">' % xmlns]
else:
- return ['<math xmlns="%s" mode="display">' % xmlns]
+ return ['<math xmlns="%s" display="block">' % xmlns]
def xml_end(self):
return ['</%s>' % self.__class__.__name__]
Copied: trunk/docutils/test/functional/expected/math_output_mathml.html (from rev 8735, trunk/docutils/test/functional/expected/math_output_mathml.xhtml)
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html (rev 0)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-05-20 12:18:55 UTC (rev 8736)
@@ -0,0 +1,221 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta charset="utf-8"/>
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<title>Mathematics</title>
+<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
+<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
+</head>
+<body>
+<main id="mathematics">
+<h1 class="title">Mathematics</h1>
+
+<p>Docutils supports inline math with the prefix or postfix <span class="docutils literal">:math:</span>
+role specificator, <math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mi>n</mi><mo>!</mo><mo>+</mo><mo>sin</mo><mo>(</mo><msubsup><mi>x</mi><mi>n</mi><mn>2</mn></msubsup><mo>)</mo></mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><msub><mi>A</mi><mtext>c</mtext></msub><mo>=</mo><mfrac>
+<mrow><mi>π</mi></mrow>
+<mrow><mn>4</mn></mrow></mfrac><msup><mi>d</mi><mn>2</mn></msup></mrow></math>, as well as displayed math via the
+<cite>math</cite> directive:</p>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mi>f</mi><mo>(</mo><mi>ϵ</mi><mo>)</mo><mo>=</mo><mfrac>
+<mrow><mn>1</mn></mrow>
+<mrow><mn>1</mn><mo>+</mo><mo>exp</mo><mfenced open="(" close=")">
+<mrow><mfrac>
+<mrow><mi>ε</mi></mrow>
+<mrow><msub><mi>k</mi><mtext>B</mtext></msub><mi>T</mi></mrow></mfrac></mrow></mfenced></mrow></mfrac></mtd></mtr></mtable></math>
+</div>
+<p>Content may start on the first line of the directive, e.g.</p>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mi>N</mi><mo>=</mo><mfrac>
+<mrow><mtext>number of apples</mtext></mrow>
+<mrow><mn>7</mn></mrow></mfrac></mtd></mtr></mtable></math>
+</div>
+<p>Equations can be labeled with a reference name using the <span class="docutils literal">:name:</span> option.
+See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference internal" href="#eq-schrodinger">eq:schrödinger</a> below.</p>
+<p>The determinant of the matrix</p>
+<div id="eq-m">
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mstyle mathvariant="bold">
+<mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
+<mrow>
+<mtable>
+<mtr>
+<mtd><mi>a</mi></mtd>
+<mtd><mi>b</mi></mtd></mtr>
+<mtr>
+<mtd><mi>c</mi></mtd>
+<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" displaystyle="false">
+<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>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><munderover><mo>∫</mo><mn>0</mn><mn>1</mn></munderover><msup><mi>x</mi><mi>n</mi></msup><mi>d</mi><mi>x</mi><mo>=</mo><mfrac>
+<mrow><mn>1</mn></mrow>
+<mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mtd></mtr></mtable></math>
+</div>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><munderover><mo>∑</mo>
+<mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>m</mi></munderover><mi>n</mi><mo>=</mo><mfrac>
+<mrow><mi>m</mi><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
+<mrow><mn>2</mn></mrow></mfrac></mtd></mtr></mtable></math>
+</div>
+<p>LaTeX-supported Unicode math symbols can be used in math roles and
+directives:</p>
+<p>The Schrödinger equation</p>
+<div id="eq-schrodinger">
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mi>i</mi><mi>ℏ</mi><mfrac>
+<mrow><mo>∂</mo></mrow>
+<mrow><mo>∂</mo><mi>t</mi></mrow></mfrac><mo>Ψ</mo><mo>=</mo><mover>
+<mrow><mi>H</mi></mrow><mo>^</mo></mover><mo>Ψ</mo><mo>,</mo></mtd></mtr></mtable></math>
+</div>
+<p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mo>Ψ</mo></mrow></math>, describes how the quantum state of a
+physical system changes in time.</p>
+<dl>
+<dt>Math-Accents:</dt>
+<dd><table class="colwidths-given borderless">
+<colgroup>
+<col style="width: 33%" />
+<col style="width: 33%" />
+<col style="width: 33%" />
+</colgroup>
+<tbody>
+<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <span class="docutils literal">\acute{a}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <span class="docutils literal">\dot{t}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\hat{\gamma}</span></span></p></td>
+</tr>
+<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <span class="docutils literal">\grave{a}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <span class="docutils literal">\ddot{t}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\tilde{\alpha}</span></span></p></td>
+</tr>
+<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <span class="docutils literal">\breve{x}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>t</mi></mrow><mo>⃛</mo></mover></mrow></math> <span class="docutils literal">\dddot{t}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>ı</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\vec{\imath}</span></span></p></td>
+</tr>
+<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <span class="docutils literal">\check{a}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <span class="docutils literal">\bar{a}</span></p></td>
+<td><p><math xmlns="http://www.w3.org/1998/Math/MathML" displaystyle="false">
+<mrow><mover>
+<mrow><mi>R</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal">\vec{R}</span></p></td>
+</tr>
+</tbody>
+</table>
+</dd>
+</dl>
+<!-- \widetilde{xxx}
+\widehat{xxx} -->
+<p>Modulation Transfer Function:</p>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mtext>MTF</mtext><mo>=</mo><mfenced open="|" close="|">
+<mrow><mfrac>
+<mrow><mi>ℱ</mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo></mrow>
+<mrow><mi>ℱ</mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo><msub><mo>|</mo>
+<mrow><msub><mi>ω</mi>
+<mrow><mi>x</mi></mrow></msub><mo>=</mo><mn>0</mn></mrow></msub></mrow></mfrac></mrow></mfenced><mo>=</mo><mtext>abs</mtext><mfenced open="(" close=")">
+<mrow><mfrac>
+<mrow><munderover><mo>∫</mo>
+<mrow><mo>-</mo><mo>∞</mo></mrow>
+<mrow><mo>∞</mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><msup><mtext>e</mtext>
+<mrow><mtext>i</mtext><msub><mi>ω</mi>
+<mrow><mi>x</mi></mrow></msub><mi>x</mi></mrow></msup><mtext>d</mtext>
+<mrow><mi>x</mi></mrow></mrow>
+<mrow><munderover><mo>∫</mo>
+<mrow><mo>-</mo><mo>∞</mo></mrow>
+<mrow><mo>∞</mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mtext>d</mtext>
+<mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
+</div>
+<p>Math split over two lines: If a double backslash is detected outside a
+<span class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></span> pair, the math code is wrapped in an <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a>
+<span class="docutils literal">align</span> environment:</p>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><msub><mi>s</mi>
+<mrow><mtext>out</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>)</mo></mtd>
+<mtd><mo>=</mo><msub><mi>s</mi>
+<mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><mo>*</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo></mtd></mtr>
+<mtr>
+<mtd></mtd>
+<mtd><mo>=</mo><mo>∫</mo><msub><mi>s</mi>
+<mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo><mtext>d</mtext><mi>x</mi><mo>'</mo></mtd></mtr></mtable></math>
+</div>
+<p>Cases ("manually", with <span class="docutils literal">matrix</span> environment):</p>
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mtable>
+<mtr>
+<mtd><mtext>sgn</mtext><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mfenced open="{" close="">
+<mrow>
+<mtable>
+<mtr>
+<mtd><mo>-</mo><mn>1</mn></mtd>
+<mtd><mi>x</mi><mo><</mo><mn>0</mn></mtd></mtr>
+<mtr>
+<mtd><mn>1</mn></mtd>
+<mtd><mi>x</mi><mo>></mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
+</div>
+<p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <span class="docutils literal">cases</span> environment (not (yet) supported by
+HTML writers with <span class="docutils literal"><span class="pre">--math-output=MathML</span></span>):</p>
+<div class="system-message">
+<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/math.txt</span>, line 108)</p>
+<p>
+Environment not supported! Supported environment: "matrix".</p>
+<pre class="literal-block">
+\mathrm{sgn}(x) = \begin{cases}
+ -1 & x<0\\
+ 1 & x>0
+ \end{cases}
+</pre>
+</div>
+</main>
+</body>
+</html>
Property changes on: trunk/docutils/test/functional/expected/math_output_mathml.html
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Deleted: trunk/docutils/test/functional/expected/math_output_mathml.xhtml
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.xhtml 2021-05-20 10:08:11 UTC (rev 8735)
+++ trunk/docutils/test/functional/expected/math_output_mathml.xhtml 2021-05-20 12:18:55 UTC (rev 8736)
@@ -1,221 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta charset="utf-8"/>
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
-<title>Mathematics</title>
-<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
-<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
-</head>
-<body>
-<main id="mathematics">
-<h1 class="title">Mathematics</h1>
-
-<p>Docutils supports inline math with the prefix or postfix <span class="docutils literal">:math:</span>
-role specificator, <math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mi>n</mi><mo>!</mo><mo>+</mo><mo>sin</mo><mo>(</mo><msubsup><mi>x</mi><mi>n</mi><mn>2</mn></msubsup><mo>)</mo></mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><msub><mi>A</mi><mtext>c</mtext></msub><mo>=</mo><mfrac>
-<mrow><mi>π</mi></mrow>
-<mrow><mn>4</mn></mrow></mfrac><msup><mi>d</mi><mn>2</mn></msup></mrow></math>, as well as displayed math via the
-<cite>math</cite> directive:</p>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mi>f</mi><mo>(</mo><mi>ϵ</mi><mo>)</mo><mo>=</mo><mfrac>
-<mrow><mn>1</mn></mrow>
-<mrow><mn>1</mn><mo>+</mo><mo>exp</mo><mfenced open="(" close=")">
-<mrow><mfrac>
-<mrow><mi>ε</mi></mrow>
-<mrow><msub><mi>k</mi><mtext>B</mtext></msub><mi>T</mi></mrow></mfrac></mrow></mfenced></mrow></mfrac></mtd></mtr></mtable></math>
-</div>
-<p>Content may start on the first line of the directive, e.g.</p>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mi>N</mi><mo>=</mo><mfrac>
-<mrow><mtext>number of apples</mtext></mrow>
-<mrow><mn>7</mn></mrow></mfrac></mtd></mtr></mtable></math>
-</div>
-<p>Equations can be labeled with a reference name using the <span class="docutils literal">:name:</span> option.
-See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference internal" href="#eq-schrodinger">eq:schrödinger</a> below.</p>
-<p>The determinant of the matrix</p>
-<div id="eq-m">
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mstyle mathvariant="bold">
-<mrow><mi>M</mi></mrow></mstyle><mo>=</mo><mfenced open="(" close=")">
-<mrow>
-<mtable>
-<mtr>
-<mtd><mi>a</mi></mtd>
-<mtd><mi>b</mi></mtd></mtr>
-<mtr>
-<mtd><mi>c</mi></mtd>
-<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 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>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><munderover><mo>∫</mo><mn>0</mn><mn>1</mn></munderover><msup><mi>x</mi><mi>n</mi></msup><mi>d</mi><mi>x</mi><mo>=</mo><mfrac>
-<mrow><mn>1</mn></mrow>
-<mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mtd></mtr></mtable></math>
-</div>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><munderover><mo>∑</mo>
-<mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>m</mi></munderover><mi>n</mi><mo>=</mo><mfrac>
-<mrow><mi>m</mi><mo>(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
-<mrow><mn>2</mn></mrow></mfrac></mtd></mtr></mtable></math>
-</div>
-<p>LaTeX-supported Unicode math symbols can be used in math roles and
-directives:</p>
-<p>The Schrödinger equation</p>
-<div id="eq-schrodinger">
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mi>i</mi><mi>ℏ</mi><mfrac>
-<mrow><mo>∂</mo></mrow>
-<mrow><mo>∂</mo><mi>t</mi></mrow></mfrac><mo>Ψ</mo><mo>=</mo><mover>
-<mrow><mi>H</mi></mrow><mo>^</mo></mover><mo>Ψ</mo><mo>,</mo></mtd></mtr></mtable></math>
-</div>
-<p>with the <em>wave function</em> <math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mo>Ψ</mo></mrow></math>, describes how the quantum state of a
-physical system changes in time.</p>
-<dl>
-<dt>Math-Accents:</dt>
-<dd><table class="colwidths-given borderless">
-<colgroup>
-<col style="width: 33%" />
-<col style="width: 33%" />
-<col style="width: 33%" />
-</colgroup>
-<tbody>
-<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <span class="docutils literal">\acute{a}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <span class="docutils literal">\dot{t}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\hat{\gamma}</span></span></p></td>
-</tr>
-<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <span class="docutils literal">\grave{a}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <span class="docutils literal">\ddot{t}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\tilde{\alpha}</span></span></p></td>
-</tr>
-<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <span class="docutils literal">\breve{x}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>⃛</mo></mover></mrow></math> <span class="docutils literal">\dddot{t}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>ı</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\vec{\imath}</span></span></p></td>
-</tr>
-<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <span class="docutils literal">\check{a}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <span class="docutils literal">\bar{a}</span></p></td>
-<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
-<mrow><mover>
-<mrow><mi>R</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal">\vec{R}</span></p></td>
-</tr>
-</tbody>
-</table>
-</dd>
-</dl>
-<!-- \widetilde{xxx}
-\widehat{xxx} -->
-<p>Modulation Transfer Function:</p>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mtext>MTF</mtext><mo>=</mo><mfenced open="|" close="|">
-<mrow><mfrac>
-<mrow><mi>ℱ</mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo></mrow>
-<mrow><mi>ℱ</mi><mo>{</mo><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>}</mo><msub><mo>|</mo>
-<mrow><msub><mi>ω</mi>
-<mrow><mi>x</mi></mrow></msub><mo>=</mo><mn>0</mn></mrow></msub></mrow></mfrac></mrow></mfenced><mo>=</mo><mtext>abs</mtext><mfenced open="(" close=")">
-<mrow><mfrac>
-<mrow><munderover><mo>∫</mo>
-<mrow><mo>-</mo><mo>∞</mo></mrow>
-<mrow><mo>∞</mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><msup><mtext>e</mtext>
-<mrow><mtext>i</mtext><msub><mi>ω</mi>
-<mrow><mi>x</mi></mrow></msub><mi>x</mi></mrow></msup><mtext>d</mtext>
-<mrow><mi>x</mi></mrow></mrow>
-<mrow><munderover><mo>∫</mo>
-<mrow><mo>-</mo><mo>∞</mo></mrow>
-<mrow><mo>∞</mo></mrow></munderover><mi>s</mi><mo>(</mo><mi>x</mi><mo>)</mo><mtext>d</mtext>
-<mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
-</div>
-<p>Math split over two lines: If a double backslash is detected outside a
-<span class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></span> pair, the math code is wrapped in an <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a>
-<span class="docutils literal">align</span> environment:</p>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><msub><mi>s</mi>
-<mrow><mtext>out</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>)</mo></mtd>
-<mtd><mo>=</mo><msub><mi>s</mi>
-<mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><mo>*</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo></mtd></mtr>
-<mtr>
-<mtd></mtd>
-<mtd><mo>=</mo><mo>∫</mo><msub><mi>s</mi>
-<mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo><mtext>d</mtext><mi>x</mi><mo>'</mo></mtd></mtr></mtable></math>
-</div>
-<p>Cases ("manually", with <span class="docutils literal">matrix</span> environment):</p>
-<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
-<mtable>
-<mtr>
-<mtd><mtext>sgn</mtext><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mfenced open="{" close="">
-<mrow>
-<mtable>
-<mtr>
-<mtd><mo>-</mo><mn>1</mn></mtd>
-<mtd><mi>x</mi><mo><</mo><mn>0</mn></mtd></mtr>
-<mtr>
-<mtd><mn>1</mn></mtd>
-<mtd><mi>x</mi><mo>></mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
-</div>
-<p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <span class="docutils literal">cases</span> environment (not (yet) supported by
-HTML writers with <span class="docutils literal"><span class="pre">--math-output=MathML</span></span>):</p>
-<div class="system-message">
-<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/math.txt</span>, line 108)</p>
-<p>
-Environment not supported! Supported environment: "matrix".</p>
-<pre class="literal-block">
-\mathrm{sgn}(x) = \begin{cases}
- -1 & x<0\\
- 1 & x>0
- \end{cases}
-</pre>
-</div>
-</main>
-</body>
-</html>
Modified: trunk/docutils/test/functional/tests/math_output_mathml.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_mathml.py 2021-05-20 10:08:11 UTC (rev 8735)
+++ trunk/docutils/test/functional/tests/math_output_mathml.py 2021-05-20 12:18:55 UTC (rev 8736)
@@ -1,6 +1,6 @@
# Source and destination file names.
test_source = "data/math.txt"
-test_destination = "math_output_mathml.xhtml"
+test_destination = "math_output_mathml.html"
# Keyword parameters passed to publish_file.
reader_name = "standalone"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|