|
From: <mi...@us...> - 2021-05-20 12:23:27
|
Revision: 8751
http://sourceforge.net/p/docutils/code/8751
Author: milde
Date: 2021-05-20 12:23:24 +0000 (Thu, 20 May 2021)
Log Message:
-----------
MathML: Refactor XML output routines.
Modified Paths:
--------------
trunk/docutils/docs/user/mathematics.txt
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/test/functional/expected/math_output_mathml.html
Modified: trunk/docutils/docs/user/mathematics.txt
===================================================================
--- trunk/docutils/docs/user/mathematics.txt 2021-05-20 12:23:06 UTC (rev 8750)
+++ trunk/docutils/docs/user/mathematics.txt 2021-05-20 12:23:24 UTC (rev 8751)
@@ -40,7 +40,7 @@
The **math role** can be used for inline mathematical expressions:
``:math:`\psi(r) = \exp(-2r)``` will produce :m:`\psi(r)=\exp(-2r)`.
Inside the backtics you can write anything you would write between dollar
-signs in a LaTeX document.
+signs in a LaTeX document. [#math-syntax]_
.. tip::
@@ -286,14 +286,6 @@
For mathematical variables where style variations are important semantically,
select an appropriate *math alphabet* [#]_.
-.. [#] TeX’s *math alphabets* correspond to the `mathematical
- alphanumeric symbols`__ block in Unicode and the "mathvariant" `style
- attribute`__ in MathML.
-
-
-__ https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
-__ https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
-
.. class:: colwidths-auto
=============== ============================ ==========================
@@ -309,6 +301,13 @@
``\mathtt`` ``\mathtt{0.12}`` `\mathtt{0.12}`
=============== ============================ ==========================
+.. [#] TeX’s *math alphabets* correspond to the `mathematical
+ alphanumeric symbols`__ block in Unicode and the "mathvariant" `style
+ attribute`__ in MathML.
+
+ __ https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
+ __ https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
+
Additional alphabets are defined in LaTeX packages, e.g.
.. class:: colwidths-auto
@@ -324,7 +323,7 @@
.. _isomath: https://www.ctan.org/pkg/isomath
.. _mathrsfs: https://www.ctan.org/pkg/mathrsfs
-This can be used to typeset vector symbols in **bold** *italic*
+This can be used to typeset vector symbols in bold italic
in line with the International Standard [ISO-80000-2].
.. ``\mathbfit{r}^2=x^2+y^2+z^2`` becomes
@@ -397,7 +396,7 @@
======== ===============
.. [#] Punctuation (not ratio):
- Compare spacing in `a\colon b\to c` and `a:b = c`.
+ Compare spacing in `a\colon b\to c` to `a:b = c`.
Relation symbols
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 12:23:06 UTC (rev 8750)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 12:23:24 UTC (rev 8751)
@@ -15,8 +15,7 @@
# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
-"""Convert LaTex maths code into presentational MathML.
-"""
+"""Convert LaTex maths code into presentational MathML."""
# .. [1] the original `rst2mathml.py` in `sandbox/jensj/latex_math`
#
@@ -50,7 +49,7 @@
'Upsilon':u'\u03d2', 'Pi':u'\u03a0', 'Omega':u'\u03a9',
'Gamma':u'\u0393', 'Lambda':u'\u039b'}
-# functions -> <mi> + ApplyFunction
+# functions -> <mi>
functions = ['arccos', 'arcsin', 'arctan', 'arg', 'cos', 'cosh',
'cot', 'coth', 'csc', 'deg', 'det', 'dim',
'exp', 'gcd', 'hom', 'inf', 'ker', 'lg',
@@ -250,7 +249,7 @@
# ----------------------
class math(object):
- """Base class for MathML elements."""
+ """Base class for MathML elements and root of MathML trees."""
nchildren = None
"""Expected number of children or None"""
@@ -259,9 +258,7 @@
_level = 0 # indentation level (static class variable)
def __init__(self, *children, **attributes):
- """math(*children **attributes) -> MathML element
- """
-
+ """Set up node with `children` and `attributes`."""
self.children = []
for child in children:
self.append(child)
@@ -270,7 +267,7 @@
# sort attributes for predictable functional tests
# as self.attributes.update(attributes) does not keep order in Python < 3.6
for key in sorted(attributes.keys()):
- self.attributes.setdefault(key, attributes[key])
+ self.attributes[key] = attributes[key]
def __repr__(self):
content = [repr(item) for item in getattr(self, 'children', [])]
@@ -283,16 +280,16 @@
return self.__class__.__name__ + '(%s)' % ', '.join(content)
def full(self):
- """Room for more children?"""
+ """Return boolean indicating whether children may be appended."""
return (self.nchildren is not None
and len(self.children) >= self.nchildren)
def append(self, child):
- """append(child) -> element
-
- Appends child and returns self if self is not full or first
- non-full parent."""
-
+ """Append child and return self or first non-full parent.
+
+ If self is full, go up the tree and return first non-full node or
+ `None`.
+ """
assert not self.full()
self.children.append(child)
child.parent = self
@@ -302,65 +299,53 @@
return node
def close(self):
- """close() -> parent
-
- Close element and return first non-full element."""
-
+ """Close element and return first non-full parent."""
parent = self.parent
while parent.full():
parent = parent.parent
return parent
+
+ def toprettyxml(self):
+ """Return XML representation of self as string."""
+ return ''.join(self._xml())
+
+ def _xml(self, level=0):
+ return ([self.xml_starttag()]
+ + self._xml_body(level)
+ + ['</%s>' % self.__class__.__name__])
- def xml(self):
- """xml() -> xml-string"""
-
- return self.xml_start() + self.xml_body() + self.xml_end()
-
- def xml_start(self):
+ def xml_starttag(self):
# Use k.lower() to allow argument `CLASS` for attribute `class`
# (Python keyword). MathML uses only lowercase attributes.
- attrs = ['%s="%s"'%(k.lower(), v) for k, v
- in getattr(self, 'attributes', {}).items()]
- if not isinstance(self, MathToken): # token elements
- math._level += 1
- return ['<%s>' % ' '.join([self.__class__.__name__] + attrs)]
+ attrs = ['%s="%s"'%(k.lower(), v) for k, v in self.attributes.items()]
+ return '<%s>' % ' '.join([self.__class__.__name__] + attrs)
- def xml_end(self):
+ def _xml_body(self, level=0):
xml = []
- if not isinstance(self, MathToken): # except token elements
- math._level -= 1
- xml.append('\n' + ' ' * math._level)
- xml.append('</%s>' % self.__class__.__name__)
- return xml
-
- def xml_body(self):
- xml = []
- last_child = None
for child in self.children:
- if not (isinstance(last_child, MathToken) and isinstance(child, MathToken)):
- xml.append('\n' + ' ' * math._level)
- xml.extend(child.xml())
- last_child = child
+ xml.extend(['\n', ' ' * (level+1)])
+ xml.extend(child._xml(level+1))
+ xml.extend(['\n', ' ' * level])
return xml
# >>> math(mn(2))
# math(mn(2))
-# >>> math(mn(2)).xml()
-# ['<math>', '\n ', '<mn>', '2', '</mn>', '\n', '</math>']
+# >>> math(mn(2)).toprettyxml()
+# '<math>\n <mn>2</mn>\n</math>'
#
# >>> math(id='eq3')
# math(id='eq3')
-# >>> math(id='eq3').xml()
-# ['<math id="eq3">', '\n', '</math>']
+# >>> math(id='eq3').toprettyxml()
+# '<math id="eq3">\n</math>'
#
# use CLASS to get "class" in XML
# >>> math(CLASS='test')
# math(CLASS='test')
-# >>> math(CLASS='test').xml()
-# ['<math class="test">', '\n', '</math>']
+# >>> math(CLASS='test').toprettyxml()
+# '<math class="test">\n</math>'
-# >>> math(xmlns='http://www.w3.org/1998/Math/MathML').xml()
-# ['<math xmlns="http://www.w3.org/1998/Math/MathML">', '\n', '</math>']
+# >>> math(xmlns='http://www.w3.org/1998/Math/MathML').toprettyxml()
+# '<math xmlns="http://www.w3.org/1998/Math/MathML">\n</math>'
class mrow(math):
"""Group sub-expressions as a horizontal row."""
@@ -372,10 +357,9 @@
# >>> mtable(displaystyle='true')
# mtable(displaystyle='true')
-# >>> math(mtable(displaystyle='true')).xml()
-# ['<math>', '\n ', '<mtable displaystyle="true">', '\n ', '</mtable>', '\n', '</math>']
+# >>> math(mtable(displaystyle='true')).toprettyxml()
+# '<math>\n <mtable displaystyle="true">\n </mtable>\n</math>'
-
# The elements <msqrt>, <mstyle>, <merror>, <mpadded>, <mphantom>, <menclose>,
# <mtd>, <mscarry>, and <math> treat their contents as a single inferred mrow
# formed from all their children.
@@ -385,8 +369,7 @@
class mtd(mrow): pass
class MathToken(math):
- """Token Element: Base class for mo, mi, and mn.
- """
+ """Token Element: Base class for mo, mi, and mn."""
nchildren = 0
entity_table = {ord('<'): u'<', ord('>'): u'>'}
@@ -394,7 +377,7 @@
self.data = data
super(MathToken, self).__init__(**attributes)
- def xml_body(self):
+ def _xml_body(self, level=0):
return [unicode(self.data).translate(self.entity_table)]
class mi(MathToken): pass
@@ -404,7 +387,7 @@
# >>> mo(u'<')
# mo('<')
-# >>> mo(u'<').xml()
+# >>> mo(u'<')._xml()
# ['<mo>', '<', '</mo>']
class MathScriptOrLimit(math):
@@ -412,14 +395,20 @@
nchildren = 2
def __init__(self, *children, **kwargs):
+ """Set up sub/superscript or limit elements.
+
+ The special attribute `reversed` tells that the
+ base and index sub-elements are in reversed order
+ (i.e. as in LaTeX) and will be switched on XML-export.
+ """
self.reversed = kwargs.pop('reversed', False)
math.__init__(self, *children, **kwargs)
-
- def xml(self):
+
+ def _xml(self, level=0):
if self.reversed:
self.children.reverse()
self.reversed = False
- return super(MathScriptOrLimit, self).xml()
+ return super(MathScriptOrLimit, self)._xml(level)
class msub(MathScriptOrLimit): pass
class msup(MathScriptOrLimit): pass
@@ -435,8 +424,8 @@
# munder(mi('lim'), mo('-'), accent='false')
# >>> munder(mo('-'), mi('lim'), accent='false', reversed=True)
# munder(mo('-'), mi('lim'), reversed=True, accent='false')
-# >>> ''.join(munder(mo('-'), mi('lim'), accent='false', reversed=True).xml())
-# '<munder accent="false">\n <mi>lim</mi><mo>-</mo>\n</munder>'
+# >>> munder(mo('-'), mi('lim'), accent='false', reversed=True).toprettyxml()
+# '<munder accent="false">\n <mi>lim</mi>\n <mo>-</mo>\n</munder>'
# >>> msub(mi('x'), mo('-'))
# msub(mi('x'), mo('-'))
@@ -458,14 +447,14 @@
# ~~~~~~~~~~~~~~~~~~~
def tex_cmdname(string):
- """Return leading TeX command name from `string`.
+ """Return leading TeX command name and remainder of `string`.
- >>> tex_cmdname('name2') # up to first non-letter
- ('name', '2')
- >>> tex_cmdname('name 2') # strip trailing whitespace
- ('name', '2')
- >>> tex_cmdname('_2') # single non-letter character
- ('_', '2')
+ >>> tex_cmdname('mymacro2') # up to first non-letter
+ ('mymacro', '2')
+ >>> tex_cmdname('name 2') # strip trailing whitespace
+ ('name', '2')
+ >>> tex_cmdname('_2') # single non-letter character
+ ('_', '2')
"""
m = re.match(r'([a-zA-Z]+) *(.*)', string)
@@ -488,17 +477,15 @@
# --- https://www.w3.org/TR/MathML3/chapter3.html#id.3.1.3.2
def tex_token(string):
- """Take first simple TeX token from `string`.
+ """Return first simple TeX token and remainder of `string`.
- Return token and remainder.
-
- >>> tex_token('{first simple group} {without brackets}')
- ('first simple group', ' {without brackets}')
- >>> tex_token('\\command{without argument}')
- ('\\command', '{without argument}')
- >>> tex_token(' first non-white character')
- ('f', 'irst non-white character')
-
+ >>> tex_token('{first simple group} returned without brackets')
+ ('first simple group', ' returned without brackets')
+ >>> tex_token('\\command{without argument}')
+ ('\\command', '{without argument}')
+ >>> tex_token(' first non-white character')
+ ('f', 'irst non-white character')
+
"""
m = re.match(r"""\s* # leading whitespace
{(?P<token>(\\}|[^{}]|\\{)*)} # {group} without nested groups
@@ -536,14 +523,12 @@
def parse_latex_math(string, inline=True):
- """parse_latex_math(string [,inline]) -> MathML-tree
+ """Return a MathML-tree parsed from `string`.
- Return a MathML-tree parsed from `string`.
+ >>> parse_latex_math('\\alpha')
+ math(mi('α'), xmlns='http://www.w3.org/1998/Math/MathML')
+
Set `inline` to False for displayed math.
-
- >>> parse_latex_math('\\alpha')
- math(mi('α'), xmlns='http://www.w3.org/1998/Math/MathML')
-
"""
# Normalize white-space:
@@ -620,7 +605,6 @@
raise SyntaxError(u'Illegal character: "%s"' % c)
return tree
-
# Test:
# >>> parse_latex_math('', inline=True)
@@ -640,12 +624,12 @@
"""Process LaTeX macro `name` followed by `string`.
If needed, parse `string` for macro argument.
- Return updated current node and remainder:
+ Return updated current node and remainder of `string`:
- >>> handle_keyword('hbar', math(), r' \frac')
- (math(mi('ℏ')), ' \\frac')
- >>> handle_keyword('hspace', math(), r'{1ex} (x)')
- (math(mspace(width='1ex')), ' (x)')
+ >>> handle_keyword('hbar', math(), r' \frac')
+ (math(mi('ℏ')), ' \\frac')
+ >>> handle_keyword('hspace', math(), r'{1ex} (x)')
+ (math(mspace(width='1ex')), ' (x)')
"""
@@ -685,7 +669,9 @@
node = node.append(identifier)
# TODO: only add ApplyFunction when appropriate (not \sin ^2(x), say)
- node = node.append(mo('⁡')) # '\u2061'
+ arg, remainder = tex_token(string)
+ if arg not in ('^', '_'):
+ node = node.append(mo('⁡')) # '\u2061'
return node, string
@@ -746,10 +732,6 @@
node = node.append(mo(small_operators[name], mathsize='75%'))
return node, string
- if name in sumintprod:
- node = node.append(mo(operators[name]))
- return node, string
-
if name in operators:
node = node.append(mo(operators[name]))
return node, string
@@ -903,8 +885,8 @@
def tex2mathml(tex_math, inline=True):
"""Return string with MathML code corresponding to `tex_math`.
- `inline`=True is for inline math and `inline`=False for displayed math.
+ Set `inline` to False for displayed math.
"""
mathml_tree = parse_latex_math(tex_math, inline=inline)
- return ''.join(mathml_tree.xml())
+ return mathml_tree.toprettyxml()
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2021-05-20 12:23:06 UTC (rev 8750)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-05-20 12:23:24 UTC (rev 8751)
@@ -14,14 +14,22 @@
<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">
- <mi>n</mi><mo>!</mo><mo>+</mo><mi>sin</mi><mo>⁡</mo><mo stretchy="false">(</mo>
+ <mi>n</mi>
+ <mo>!</mo>
+ <mo>+</mo>
+ <mi>sin</mi>
+ <mo>⁡</mo>
+ <mo stretchy="false">(</mo>
<msubsup>
- <mi>x</mi><mi>n</mi><mn>2</mn>
+ <mi>x</mi>
+ <mi>n</mi>
+ <mn>2</mn>
</msubsup>
<mo stretchy="false">)</mo>
</math> and <math xmlns="http://www.w3.org/1998/Math/MathML">
<msub>
- <mi>A</mi><mtext>c</mtext>
+ <mi>A</mi>
+ <mtext>c</mtext>
</msub>
<mo>=</mo>
<mfrac>
@@ -33,7 +41,8 @@
</mrow>
</mfrac>
<msup>
- <mi>d</mi><mn>2</mn>
+ <mi>d</mi>
+ <mn>2</mn>
</msup>
</math>, as well as displayed math via the
<cite>math</cite> directive:</p>
@@ -42,13 +51,20 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mi>f</mi><mo stretchy="false">(</mo><mi>ϵ</mi><mo stretchy="false">)</mo><mo>=</mo>
+ <mi>f</mi>
+ <mo stretchy="false">(</mo>
+ <mi>ϵ</mi>
+ <mo stretchy="false">)</mo>
+ <mo>=</mo>
<mfrac>
<mrow>
<mn>1</mn>
</mrow>
<mrow>
- <mn>1</mn><mo>+</mo><mi>exp</mi><mo>⁡</mo>
+ <mn>1</mn>
+ <mo>+</mo>
+ <mi>exp</mi>
+ <mo>⁡</mo>
<mrow>
<mo>(</mo>
<mfrac>
@@ -57,7 +73,8 @@
</mrow>
<mrow>
<msub>
- <mi>k</mi><mtext>B</mtext>
+ <mi>k</mi>
+ <mtext>B</mtext>
</msub>
<mi>T</mi>
</mrow>
@@ -77,7 +94,8 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mi>N</mi><mo>=</mo>
+ <mi>N</mi>
+ <mo>=</mo>
<mfrac>
<mrow>
<mtext>number of apples</mtext>
@@ -99,7 +117,8 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mi mathvariant="bold">M</mi><mo>=</mo>
+ <mi mathvariant="bold">M</mi>
+ <mo>=</mo>
<mrow>
<mo>(</mo>
<mtable>
@@ -128,7 +147,15 @@
</math>
</div>
<p>is <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mo stretchy="false">|</mo><mi mathvariant="bold">M</mi><mo stretchy="false">|</mo><mo>=</mo><mi>a</mi><mi>d</mi><mo>−</mo><mi>b</mi><mi>c</mi>
+ <mo stretchy="false">|</mo>
+ <mi mathvariant="bold">M</mi>
+ <mo stretchy="false">|</mo>
+ <mo>=</mo>
+ <mi>a</mi>
+ <mi>d</mi>
+ <mo>−</mo>
+ <mi>b</mi>
+ <mi>c</mi>
</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>
@@ -138,18 +165,25 @@
<mtr>
<mtd>
<munderover>
- <mo movablelimits="true">∫</mo><mn>0</mn><mn>1</mn>
+ <mo movablelimits="true">∫</mo>
+ <mn>0</mn>
+ <mn>1</mn>
</munderover>
<msup>
- <mi>x</mi><mi>n</mi>
+ <mi>x</mi>
+ <mi>n</mi>
</msup>
- <mi>d</mi><mi>x</mi><mo>=</mo>
+ <mi>d</mi>
+ <mi>x</mi>
+ <mo>=</mo>
<mfrac>
<mrow>
<mn>1</mn>
</mrow>
<mrow>
- <mi>n</mi><mo>+</mo><mn>1</mn>
+ <mi>n</mi>
+ <mo>+</mo>
+ <mn>1</mn>
</mrow>
</mfrac>
</mtd>
@@ -165,14 +199,22 @@
<munderover>
<mo movablelimits="true">∑</mo>
<mrow>
- <mi>n</mi><mo>=</mo><mn>1</mn>
+ <mi>n</mi>
+ <mo>=</mo>
+ <mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
- <mi>n</mi><mo>=</mo>
+ <mi>n</mi>
+ <mo>=</mo>
<mfrac>
<mrow>
- <mi>m</mi><mo stretchy="false">(</mo><mi>m</mi><mo>+</mo><mn>1</mn><mo stretchy="false">)</mo>
+ <mi>m</mi>
+ <mo stretchy="false">(</mo>
+ <mi>m</mi>
+ <mo>+</mo>
+ <mn>1</mn>
+ <mo stretchy="false">)</mo>
</mrow>
<mrow>
<mn>2</mn>
@@ -191,16 +233,19 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mi>i</mi><mi>ℏ</mi>
+ <mi>i</mi>
+ <mi>ℏ</mi>
<mfrac>
<mrow>
<mo>∂</mo>
</mrow>
<mrow>
- <mo>∂</mo><mi>t</mi>
+ <mo>∂</mo>
+ <mi>t</mi>
</mrow>
</mfrac>
- <mi class="capital-greek">Ψ</mi><mo>=</mo>
+ <mi class="capital-greek">Ψ</mi>
+ <mo>=</mo>
<mover accent="true">
<mrow>
<mi>H</mi>
@@ -207,7 +252,8 @@
</mrow>
<mo>ˆ</mo>
</mover>
- <mi class="capital-greek">Ψ</mi><mo>,</mo>
+ <mi class="capital-greek">Ψ</mi>
+ <mo>,</mo>
</mtd>
</mtr>
</mtable>
@@ -338,15 +384,28 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mtext>MTF</mtext><mo>=</mo>
+ <mtext>MTF</mtext>
+ <mo>=</mo>
<mrow>
<mo>|</mo>
<mfrac>
<mrow>
- <mi mathvariant="script">F</mi><mo>{</mo><mi>s</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>}</mo>
+ <mi mathvariant="script">F</mi>
+ <mo>{</mo>
+ <mi>s</mi>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
+ <mo>}</mo>
</mrow>
<mrow>
- <mi mathvariant="script">F</mi><mo>{</mo><mi>s</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>}</mo>
+ <mi mathvariant="script">F</mi>
+ <mo>{</mo>
+ <mi>s</mi>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
+ <mo>}</mo>
<msub>
<mo stretchy="false">|</mo>
<mrow>
@@ -356,7 +415,8 @@
<mi>x</mi>
</mrow>
</msub>
- <mo>=</mo><mn>0</mn>
+ <mo>=</mo>
+ <mn>0</mn>
</mrow>
</msub>
</mrow>
@@ -363,7 +423,8 @@
</mfrac>
<mo>|</mo>
</mrow>
- <mo>=</mo><mi mathvariant="normal">abs</mi>
+ <mo>=</mo>
+ <mi mathvariant="normal">abs</mi>
<mrow>
<mo>(</mo>
<mfrac>
@@ -371,13 +432,17 @@
<munderover>
<mo movablelimits="true">∫</mo>
<mrow>
- <mo>−</mo><mo>∞</mo>
+ <mo>−</mo>
+ <mo>∞</mo>
</mrow>
<mrow>
<mo>∞</mo>
</mrow>
</munderover>
- <mi>s</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo>
+ <mi>s</mi>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
<msup>
<mi mathvariant="normal">e</mi>
<mrow>
@@ -400,13 +465,18 @@
<munderover>
<mo movablelimits="true">∫</mo>
<mrow>
- <mo>−</mo><mo>∞</mo>
+ <mo>−</mo>
+ <mo>∞</mo>
</mrow>
<mrow>
<mo>∞</mo>
</mrow>
</munderover>
- <mi>s</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mi mathvariant="normal">d</mi>
+ <mi>s</mi>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
+ <mi mathvariant="normal">d</mi>
<mrow>
<mi>x</mi>
</mrow>
@@ -434,7 +504,9 @@
<mi mathvariant="normal">out</mi>
</mrow>
</msub>
- <mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
</mtd>
<mtd>
<mo>=</mo>
@@ -444,11 +516,21 @@
<mi mathvariant="normal">in</mi>
</mrow>
</msub>
- <mo stretchy="false">(</mo><mi>x</mi><mo>'</mo><mo stretchy="false">)</mo><mo>*</mo>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo>'</mo>
+ <mo stretchy="false">)</mo>
+ <mo>*</mo>
<msub>
- <mi>s</mi><mi>δ</mi>
+ <mi>s</mi>
+ <mi>δ</mi>
</msub>
- <mo stretchy="false">(</mo><mi>x</mi><mo>−</mo><mi>x</mi><mo>'</mo><mo stretchy="false">)</mo>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo>−</mo>
+ <mi>x</mi>
+ <mo>'</mo>
+ <mo stretchy="false">)</mo>
</mtd>
</mtr>
<mtr>
@@ -455,7 +537,8 @@
<mtd>
</mtd>
<mtd>
- <mo>=</mo><mo>∫</mo>
+ <mo>=</mo>
+ <mo>∫</mo>
<msub>
<mi>s</mi>
<mrow>
@@ -462,11 +545,23 @@
<mi mathvariant="normal">in</mi>
</mrow>
</msub>
- <mo stretchy="false">(</mo><mi>x</mi><mo>'</mo><mo stretchy="false">)</mo>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo>'</mo>
+ <mo stretchy="false">)</mo>
<msub>
- <mi>s</mi><mi>δ</mi>
+ <mi>s</mi>
+ <mi>δ</mi>
</msub>
- <mo stretchy="false">(</mo><mi>x</mi><mo>−</mo><mi>x</mi><mo>'</mo><mo stretchy="false">)</mo><mi mathvariant="normal">d</mi><mi>x</mi><mo>'</mo>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo>−</mo>
+ <mi>x</mi>
+ <mo>'</mo>
+ <mo stretchy="false">)</mo>
+ <mi mathvariant="normal">d</mi>
+ <mi>x</mi>
+ <mo>'</mo>
</mtd>
</mtr>
</mtable>
@@ -478,16 +573,23 @@
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
- <mi mathvariant="normal">sgn</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo>
+ <mi mathvariant="normal">sgn</mi>
+ <mo stretchy="false">(</mo>
+ <mi>x</mi>
+ <mo stretchy="false">)</mo>
+ <mo>=</mo>
<mrow>
<mo>{</mo>
<mtable>
<mtr>
<mtd>
- <mo>−</mo><mn>1</mn>
+ <mo>−</mo>
+ <mn>1</mn>
</mtd>
<mtd>
- <mi>x</mi><mo><</mo><mn>0</mn>
+ <mi>x</mi>
+ <mo><</mo>
+ <mn>0</mn>
</mtd>
</mtr>
<mtr>
@@ -495,7 +597,9 @@
<mn>1</mn>
</mtd>
<mtd>
- <mi>x</mi><mo>></mo><mn>0</mn>
+ <mi>x</mi>
+ <mo>></mo>
+ <mn>0</mn>
</mtd>
</mtr>
</mtable>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|