|
From: <mi...@us...> - 2021-05-20 12:23:08
|
Revision: 8750
http://sourceforge.net/p/docutils/code/8750
Author: milde
Date: 2021-05-20 12:23:06 +0000 (Thu, 20 May 2021)
Log Message:
-----------
MathML: simplify node class interface, fix accent handling.
Instantiating functions for "math" class and descendents handle all
positional arguments as children/data and named arguments as attributes.
Set "accent" argument for <mover> according to LaTeX macro.
Influences dropping of i-dot and size of top character, defaults to
"automatic" (MathML 3) or "false" (MathML Core Draft).
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:22:52 UTC (rev 8749)
+++ trunk/docutils/docs/user/mathematics.txt 2021-05-20 12:23:06 UTC (rev 8750)
@@ -132,8 +132,7 @@
=========== ============= =========== ============= ============== ================
When adding an accent to an i or j in math, dotless variants can be
-obtained with ``\imath`` and ``\jmath``: `\bar \imath`, `\hat{\jmath}`
-(MathML drops the dot automatically).
+obtained with ``\imath`` and ``\jmath``: `\hat \imath`, `\vec{\jmath}`.
For embellishments that span multiple symbols, use:
@@ -669,23 +668,27 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~
The elements <msqrt>, <mstyle>, <merror>, <mpadded>, <mphantom>, <menclose>,
-<mtd, mscarry>, and <math> treat their contents as a single inferred mrow
+<mtd>, <mscarry>, and <math> treat their contents as a single inferred mrow
formed from all their children.
-.. math:: a = \sqrt 2, b = \sqrt{1+x^2}, c = \sqrt\frac{sin(x)}{23}
+.. math:: a = \sqrt 2 + x, b = \sqrt{1+x^2}, c = \sqrt\frac{sin(x)}{23},
-inline: :math:`a = \sqrt 2, b = \sqrt{1+x^2}, c = \sqrt\frac{sin(x)}{23}`.
+inline: :math:`a = \sqrt 2 + x, b = \sqrt{1+x^2}, c = \sqrt\frac{sin(x)}{23}`.
+
Accents vs. embellishments
--------------------------
-MathML with Firefox 78 drobs dots on "i" and "j" with accents:
+MathML with Firefox 78 drops dots on "i" and "j" with accents:
.. math:: \vec i \ne \overrightarrow i
\text{ and } \vec\lim \ne \overrightarrow\lim.
-Accents should be nearer to the base (in MathML Firefox 78, it's vice versa!):
+Accents should be nearer to the base (in MathML Firefox 78, it's vice versa!):
+`\vec a \overrightarrow a, \vec l \overrightarrow l, \vec i \overrightarrow i`
+and `\bar a \overline a, \bar l \overline l, \bar i \overline i`.
-.. math:: \vec a \vec l \ne \overrightarrow a \overrightarrow l
+In inline formulas and fractions, the limits on lim, sum and integral should
+move to index postions: `\lim_{c\to0} \oint_c f(x) \mathrm{d}x` vs.
- \bar a \bar l \ne \overline a \overline l
+.. math:: \lim_{c\to0} \oint_c f(x) \mathrm{d}x
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 12:22:52 UTC (rev 8749)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2021-05-20 12:23:06 UTC (rev 8750)
@@ -54,7 +54,7 @@
functions = ['arccos', 'arcsin', 'arctan', 'arg', 'cos', 'cosh',
'cot', 'coth', 'csc', 'deg', 'det', 'dim',
'exp', 'gcd', 'hom', 'inf', 'ker', 'lg',
- 'lim', 'ln', 'log', 'max', 'min', 'Pr',
+ 'ln', 'log', 'max', 'min', 'Pr',
'sec', 'sin', 'sinh', 'sup', 'tan', 'tanh']
functions = dict((name, name) for name in functions)
functions.update({# functions with a space in the name
@@ -100,11 +100,10 @@
'ngeqslant': u'\u2a7e\u0338', # ⩾̸
'nsubseteqq': u'\u2AC5\u0338', # ⫅̸
'nsupseteqq': u'\u2AC6\u0338', # ⫆̸
+ # use <mo> to allow "movablelimits" attribute
+ 'lim': u'lim',
})
-# >>> '{' in operators.values()
-# True
-
# special cases
thick_operators = {# style='font-weight: bold;'
@@ -132,12 +131,13 @@
'rVert': u'\u2016', # ‖ DOUBLE VERTICAL LINE
}
-sumintprod = ''.join([operators[symbol] for symbol in
- ['sum', 'int', 'oint', 'prod']])
+# operators with limits either over/under or in index position
+sumintprod = ['coprod', 'fatsemi', 'fint', 'iiiint', 'iiint',
+ 'iint', 'int', 'oiint', 'oint', 'ointctrclockwise',
+ 'prod', 'sqint', 'sum', 'varointclockwise']
+sumintprod += [operators[name] for name in sumintprod]
+sumintprod.append('lim')
-# >>> print(sumintprod)
-# ∑∫∮∏
-
# pre-composed characters for negated symbols
# see https://www.w3.org/TR/xml-entity-names/#combining
negatables = {'=': u'\u2260',
@@ -195,34 +195,35 @@
'!': '-0.1667em', # negthinspace
}
-# accents -> <mover>
+# accents -> <mover accent="true">
# TeX spacing combining
-over = {'acute': u'´', # u'\u0301',
- 'bar': u'-', # u'\u0304',
- 'breve': u'˘', # u'\u0306',
- 'check': u'ˇ', # u'\u030C',
- 'dot': u'·', # u'\u0307',
- 'ddot': u'··', # u'\u0308',
- 'dddot': u'···', # u'\u20DB',
- 'grave': u'`', # u'\u0300',
- 'hat': u'^', # u'\u0302',
- 'mathring': u'°', # u'\u030A',
- 'tilde': u'\u223C', # u'\u0303',
- 'vec': u'\u20D7',
+accents = {'acute': u'´', # u'\u0301',
+ 'bar': u'ˉ', # u'\u0304',
+ 'breve': u'˘', # u'\u0306',
+ 'check': u'ˇ', # u'\u030C',
+ 'dot': u'˙', # u'\u0307',
+ 'ddot': u'¨', # u'\u0308',
+ 'dddot': u'\u20DB', # '…' too wide
+ 'grave': u'`', # u'\u0300',
+ 'hat': u'ˆ', # u'\u0302',
+ 'mathring': u'˚', # u'\u030A',
+ 'tilde': u'˜', # u'\u0303',
}
-wideover = {'overbrace': u'\u23DE', # TOP CURLY BRACKET
- 'overleftarrow': u'\u2190',
- 'overleftrightarrow': u'\u2194',
- 'overline': u'¯',
- 'overrightarrow': u'\u2192',
- 'widehat': u'^',
- 'widetilde': u'~'}
-wideunder = {'underbrace': u'\u23DF',
- 'underleftarrow': u'\u2190',
- 'underleftrightarrow': u'\u2194',
- 'underline': u'_',
- 'underrightarrow': u'\u2192'}
+# limits etc. -> <mover> rsp. <munder>
+over = {'overbrace': u'\u23DE', # TOP CURLY BRACKET
+ 'overleftarrow': u'\u2190',
+ 'overleftrightarrow': u'\u2194',
+ 'overline': u'¯',
+ 'overrightarrow': u'\u2192',
+ 'vec': u'\u2192', # → (too heavy if accent="true")
+ 'widehat': u'^',
+ 'widetilde': u'~'}
+under = {'underbrace': u'\u23DF',
+ 'underleftarrow': u'\u2190',
+ 'underleftrightarrow': u'\u2194',
+ 'underline': u'_',
+ 'underrightarrow': u'\u2192'}
# Character translations
# ----------------------
@@ -257,32 +258,26 @@
"""Parent node in MathML DOM tree."""
_level = 0 # indentation level (static class variable)
- def __init__(self, children=None, inline=None, **kwargs):
- """math([children]) -> MathML element
+ def __init__(self, *children, **attributes):
+ """math(*children **attributes) -> MathML element
+ """
- children can be one child or a list of children."""
-
self.children = []
- if children is not None:
- if not isinstance(children, (list, tuple)):
- children = [children]
- for child in children:
- self.append(child)
+ for child in children:
+ self.append(child)
self.attributes = collections.OrderedDict()
- if inline is not None:
- self.attributes['xmlns'] = 'http://www.w3.org/1998/Math/MathML'
- if inline is False:
- self.attributes['display'] = 'block'
- # sort kwargs for predictable functional tests
- # as self.attributes.update(kwargs) does not keep order in Python < 3.6
- for key in sorted(kwargs.keys()):
- self.attributes.setdefault(key, kwargs[key])
+ # 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])
def __repr__(self):
content = [repr(item) for item in getattr(self, 'children', [])]
if hasattr(self, 'data'):
content.append(repr(self.data))
+ if isinstance(self, MathScriptOrLimit) and self.reversed:
+ content.append('reversed=True')
if hasattr(self, 'attributes'):
content += ["%s='%s'"%(k, v) for k, v in self.attributes.items()]
return self.__class__.__name__ + '(%s)' % ', '.join(content)
@@ -306,15 +301,6 @@
node = node.parent
return node
- def delete_child(self):
- """delete_child() -> child
-
- Delete last child and return it."""
-
- child = self.children[-1]
- del self.children[-1]
- return child
-
def close(self):
"""close() -> parent
@@ -335,13 +321,13 @@
# (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, mx): # token elements
+ if not isinstance(self, MathToken): # token elements
math._level += 1
return ['<%s>' % ' '.join([self.__class__.__name__] + attrs)]
def xml_end(self):
xml = []
- if not isinstance(self, mx): # except token elements
+ if not isinstance(self, MathToken): # except token elements
math._level -= 1
xml.append('\n' + ' ' * math._level)
xml.append('</%s>' % self.__class__.__name__)
@@ -351,7 +337,7 @@
xml = []
last_child = None
for child in self.children:
- if not (isinstance(last_child, mx) and isinstance(child, mx)):
+ if not (isinstance(last_child, MathToken) and isinstance(child, MathToken)):
xml.append('\n' + ' ' * math._level)
xml.extend(child.xml())
last_child = child
@@ -373,22 +359,11 @@
# >>> math(CLASS='test').xml()
# ['<math class="test">', '\n', '</math>']
-# >>> math(inline=True)
-# math(xmlns='http://www.w3.org/1998/Math/MathML')
-# >>> math(inline=True).xml()
+# >>> math(xmlns='http://www.w3.org/1998/Math/MathML').xml()
# ['<math xmlns="http://www.w3.org/1998/Math/MathML">', '\n', '</math>']
-# >>> math(inline=False)
-# math(xmlns='http://www.w3.org/1998/Math/MathML', display='block')
-# >>> math(inline=False).xml()
-# ['<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">', '\n', '</math>']
class mrow(math):
- """Group sub-expressions as a horizontal row.
- """
- def __init__(self, children=None, nchildren=None, **kwargs):
- self.nchildren = nchildren
- math.__init__(self, children)
- self.attributes = kwargs
+ """Group sub-expressions as a horizontal row."""
# >>> mrow(displaystyle='false')
# mrow(displaystyle='false')
@@ -409,23 +384,23 @@
class mtr(mrow): pass
class mtd(mrow): pass
-class mx(math):
+class MathToken(math):
"""Token Element: Base class for mo, mi, and mn.
"""
nchildren = 0
entity_table = {ord('<'): u'<', ord('>'): u'>'}
- def __init__(self, data, **kwargs):
+ def __init__(self, data, **attributes):
self.data = data
- super(mx, self).__init__(**kwargs)
+ super(MathToken, self).__init__(**attributes)
def xml_body(self):
return [unicode(self.data).translate(self.entity_table)]
-class mi(mx): pass
-class mn(mx): pass
-class mo(mx): pass
-class mtext(mx): pass
+class mi(MathToken): pass
+class mn(MathToken): pass
+class mo(MathToken): pass
+class mtext(MathToken): pass
# >>> mo(u'<')
# mo('<')
@@ -432,58 +407,50 @@
# >>> mo(u'<').xml()
# ['<mo>', '<', '</mo>']
-class msub(math):
+class MathScriptOrLimit(math):
+ """Base class for script and limit schemata."""
nchildren = 2
-class msup(math):
- nchildren = 2
+ def __init__(self, *children, **kwargs):
+ self.reversed = kwargs.pop('reversed', False)
+ math.__init__(self, *children, **kwargs)
-class mroot(math):
- nchildren = 2
-
-class mfrac(math):
- nchildren = 2
-
-class msubsup(math):
- nchildren = 3
- def __init__(self, children=None, reversed=False):
- self.reversed = reversed
- math.__init__(self, children)
-
def xml(self):
if self.reversed:
- ## self.children[1:3] = self.children[2:0:-1]
- self.children[1:3] = [self.children[2], self.children[1]]
+ self.children.reverse()
self.reversed = False
- return super(msubsup, self).xml()
+ return super(MathScriptOrLimit, self).xml()
-class mspace(math):
- nchildren = 0
+class msub(MathScriptOrLimit): pass
+class msup(MathScriptOrLimit): pass
+class msubsup(MathScriptOrLimit):
+ nchildren = 3
-class mover(math):
- nchildren = 2
- def __init__(self, children=None, reversed=False, **kwargs):
- self.reversed = reversed
- math.__init__(self, children, **kwargs)
+class munder(MathScriptOrLimit): pass
+class mover(MathScriptOrLimit): pass
+class munderover(MathScriptOrLimit):
+ nchildren = 3
- def xml(self):
- if self.reversed:
- self.children.reverse()
- self.reversed = False
- return math.xml(self)
+# >>> munder(mi('lim'), mo('-'), accent='false')
+# 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>'
+# >>> msub(mi('x'), mo('-'))
+# msub(mi('x'), mo('-'))
-# >>> mover(children=[mi('lim'), mo('-')], accent='false')
-# mover(mi('lim'), mo('-'), accent='false')
-class munder(mover):
+class mroot(math):
nchildren = 2
-class munderover(math):
- nchildren = 3
- def __init__(self, children=None):
- math.__init__(self, children)
+class mfrac(math):
+ nchildren = 2
+class mspace(math):
+ nchildren = 0
+
# LaTeX to MathML translation
# ---------------------------
@@ -584,13 +551,14 @@
# Set up: tree is the whole tree and node is the current element.
if inline:
- node = math(inline=True)
+ node = math(xmlns='http://www.w3.org/1998/Math/MathML')
tree = node
else:
# block: emulate align* environment with a math table
node = mtd()
- content = mtable(mtr(node), displaystyle='true', CLASS='align')
- tree = math(content, inline=False)
+ lines = mtable(mtr(node), displaystyle='true', CLASS='align')
+ tree = math(lines, display='block',
+ xmlns='http://www.w3.org/1998/Math/MathML')
while len(string) > 0:
# Take of first character:
@@ -614,10 +582,11 @@
elif c in "+*=<>,.!?';@":
node = node.append(mo(c))
elif c == '_':
- child = node.delete_child()
+ child = node.children.pop()
if isinstance(child, msup):
- sub = msubsup(child.children, reversed=True)
- elif isinstance(child, mo) and child.data in sumintprod:
+ sub = msubsup(*child.children, reversed=True)
+ elif isinstance(child, MathToken) and child.data in sumintprod:
+ child.attributes['movablelimits'] = 'true'
sub = munder(child)
else:
sub = msub(child)
@@ -624,14 +593,15 @@
node.append(sub)
node = sub
elif c == '^':
- child = node.delete_child()
+ child = node.children.pop()
if isinstance(child, msub):
- sup = msubsup(child.children)
- elif isinstance(child, mo) and child.data in sumintprod:
+ sup = msubsup(*child.children)
+ elif isinstance(child, MathToken) and child.data in sumintprod:
+ child.attributes['movablelimits'] = 'true'
sup = mover(child)
elif (isinstance(child, munder) and
child.children[0].data in sumintprod):
- sup = munderover(child.children)
+ sup = munderover(*child.children)
else:
sup = msup(child)
node.append(sup)
@@ -653,10 +623,14 @@
# Test:
+# >>> parse_latex_math('', inline=True)
+# math(xmlns='http://www.w3.org/1998/Math/MathML')
+# >>> parse_latex_math('', inline=False)
+# math(mtable(mtr(mtd()), CLASS='align', displaystyle='true'), display='block', xmlns='http://www.w3.org/1998/Math/MathML')
# >>> parse_latex_math(' \\sqrt{ \\alpha}')
# math(msqrt(mi('α')), xmlns='http://www.w3.org/1998/Math/MathML')
# >>> parse_latex_math('\\alpha', inline=False)
-# math(mtable(mtr(mtd(mi('α'))), CLASS='align', displaystyle='true'), xmlns='http://www.w3.org/1998/Math/MathML', display='block')
+# math(mtable(mtr(mtd(mi('α'))), CLASS='align', displaystyle='true'), display='block', xmlns='http://www.w3.org/1998/Math/MathML')
# >>> parse_latex_math('\\sqrt 2 \\ne 3')
# math(msqrt(mn('2')), mo('≠'), mn('3'), xmlns='http://www.w3.org/1998/Math/MathML')
# >>> parse_latex_math('\\sqrt{2 + 3} < 3')
@@ -701,13 +675,13 @@
identifier = mi(functions[name])
# functions with embellished names
if name == 'varliminf': # \underline\lim
- identifier = munder([identifier, mo(u'_')], accent='false')
+ identifier = munder(identifier, mo(u'_'))
elif name == 'varlimsup': # \overline\lim
- identifier = mover([identifier, mo(u'¯')], accent='false')
+ identifier = mover(identifier, mo(u'¯'), accent='false')
elif name == 'varprojlim': # \underleftarrow\lim
- identifier = munder([identifier, mo(u'\u2190')], accent='false')
+ identifier = munder(identifier, mo(u'\u2190'))
elif name == 'varinjlim': # \underrightarrow\lim
- identifier = munder([identifier, mo(u'\u2192')], accent='false')
+ identifier = munder(identifier, mo(u'\u2192'))
node = node.append(identifier)
# TODO: only add ApplyFunction when appropriate (not \sin ^2(x), say)
@@ -726,25 +700,26 @@
arg = letters.get(arg[1:], arg)
if name == 'boldsymbol':
- kwargs = {'style': 'font-weight: bold'}
+ attributes = {'style': 'font-weight: bold'}
else:
- kwargs = {'mathvariant': math_alphabets[name]}
+ attributes = {'mathvariant': math_alphabets[name]}
if name == 'mathscr':
- kwargs['style'] = 'font-family: STIX' # alternative script letter shapes
+ # alternative script letter shapes
+ attributes['style'] = 'font-family: STIX'
# one symbol (single letter, name, or number)
if arg.isalpha():
- node = node.append(mi(arg, **kwargs))
+ node = node.append(mi(arg, **attributes))
return node, remainder
if arg.replace('.', '').replace(',', '').isdigit():
- node = node.append(mn(arg, **kwargs))
+ node = node.append(mn(arg, **attributes))
return node, remainder
if len(arg) == 1 and arg != '{':
- node = node.append(mo(arg, **kwargs))
+ node = node.append(mo(arg, **attributes))
return node, remainder
# Wrap in <style>
- style = mstyle(**kwargs)
+ style = mstyle(**attributes)
node.append(style)
return style, string[1:] # take of the opening '{', <mrow> is inferred
@@ -771,6 +746,10 @@
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
@@ -823,11 +802,11 @@
# ==================================
if name == 'sqrt':
+ sqrt = msqrt()
if string.startswith('{'): # argument is a group
string = string[1:] # mrow implied, skip opening bracket
- sqrt = msqrt()
else: # no group, enclose only one element
- sqrt = msqrt(nchildren=1)
+ sqrt.nchildren = 1
node.append(sqrt)
return sqrt, string
@@ -840,23 +819,23 @@
entry = mtd()
row = mtr(entry)
node.close().close().append(row)
- node = entry
- return node, string
+ return entry, string
- if name in over or name in wideover:
+ if name in accents or name in over:
try:
- ovr = mover(mo(over[name]), reversed=True)
+ ch = over[name]
+ acc = 'false'
except KeyError:
- ovr = mover(mo(wideover[name]), reversed=True, accent='false')
+ ch = accents[name]
+ acc = 'true'
+ ovr = mover(mo(ch), reversed=True, accent=acc)
node.append(ovr)
- node = ovr
- return node, string
+ return ovr, string
- if name in wideunder:
- ovr = munder(mo(wideunder[name]), reversed=True, accent='false')
+ if name in under:
+ ovr = munder(mo(under[name]), reversed=True)
node.append(ovr)
- node = ovr
- return node, string
+ return ovr, string
if name == 'begin':
env_name, string = tex_token(string)
@@ -867,7 +846,7 @@
node = entry
elif env_name == 'cases':
entry = mtd()
- cases = mrow([mo('{'), mtable(mtr(entry))])
+ cases = mrow(mo('{'), mtable(mtr(entry)))
node.append(cases)
node = entry
else:
@@ -916,7 +895,9 @@
# >>> handle_keyword('mathrm', math(), '{out} = 3')
# (math(mi('out', mathvariant='normal')), ' = 3')
# >>> handle_keyword('overline', math(), '{981}')
-# (mover(mo('¯'), accent='false'), '{981}')
+# (mover(mo('¯'), reversed=True, accent='false'), '{981}')
+# >>> handle_keyword('bar', math(), '{x}')
+# (mover(mo('ˉ'), reversed=True, accent='true'), '{x}')
def tex2mathml(tex_math, inline=True):
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2021-05-20 12:22:52 UTC (rev 8749)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-05-20 12:23:06 UTC (rev 8750)
@@ -38,7 +38,7 @@
</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">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -73,7 +73,7 @@
</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">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -95,7 +95,7 @@
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">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -133,12 +133,12 @@
<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">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
<munderover>
- <mo>∫</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>
@@ -158,12 +158,12 @@
</math>
</div>
<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
<munderover>
- <mo>∑</mo>
+ <mo movablelimits="true">∑</mo>
<mrow>
<mi>n</mi><mo>=</mo><mn>1</mn>
</mrow>
@@ -187,7 +187,7 @@
directives:</p>
<p>The Schrödinger equation</p>
<div id="eq-schrodinger">
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -201,11 +201,11 @@
</mrow>
</mfrac>
<mi class="capital-greek">Ψ</mi><mo>=</mo>
- <mover>
+ <mover accent="true">
<mrow>
<mi>H</mi>
</mrow>
- <mo>^</mo>
+ <mo>ˆ</mo>
</mover>
<mi class="capital-greek">Ψ</mi><mo>,</mo>
</mtd>
@@ -227,7 +227,7 @@
</colgroup>
<tbody>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>a</mi>
</mrow>
@@ -235,24 +235,24 @@
</mover>
</math> <span class="docutils literal">\acute{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>t</mi>
</mrow>
- <mo>·</mo>
+ <mo>˙</mo>
</mover>
</math> <span class="docutils literal">\dot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>γ</mi>
</mrow>
- <mo>^</mo>
+ <mo>ˆ</mo>
</mover>
</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">
- <mover>
+ <mover accent="true">
<mrow>
<mi>a</mi>
</mrow>
@@ -260,24 +260,24 @@
</mover>
</math> <span class="docutils literal">\grave{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>t</mi>
</mrow>
- <mo>··</mo>
+ <mo>¨</mo>
</mover>
</math> <span class="docutils literal">\ddot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>α</mi>
</mrow>
- <mo>∼</mo>
+ <mo>˜</mo>
</mover>
</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">
- <mover>
+ <mover accent="true">
<mrow>
<mi>x</mi>
</mrow>
@@ -285,24 +285,24 @@
</mover>
</math> <span class="docutils literal">\breve{x}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>t</mi>
</mrow>
- <mo>···</mo>
+ <mo>⃛</mo>
</mover>
</math> <span class="docutils literal">\dddot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="false">
<mrow>
<mi>ı</mi>
</mrow>
- <mo>⃗</mo>
+ <mo>→</mo>
</mover>
</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">
- <mover>
+ <mover accent="true">
<mrow>
<mi>a</mi>
</mrow>
@@ -310,19 +310,19 @@
</mover>
</math> <span class="docutils literal">\check{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="true">
<mrow>
<mi>a</mi>
</mrow>
- <mo>-</mo>
+ <mo>ˉ</mo>
</mover>
</math> <span class="docutils literal">\bar{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
+ <mover accent="false">
<mrow>
<mi>R</mi>
</mrow>
- <mo>⃗</mo>
+ <mo>→</mo>
</mover>
</math> <span class="docutils literal">\vec{R}</span></p></td>
</tr>
@@ -334,7 +334,7 @@
\widehat{xxx} -->
<p>Modulation Transfer Function:</p>
<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -369,7 +369,7 @@
<mfrac>
<mrow>
<munderover>
- <mo>∫</mo>
+ <mo movablelimits="true">∫</mo>
<mrow>
<mo>−</mo><mo>∞</mo>
</mrow>
@@ -398,7 +398,7 @@
</mrow>
<mrow>
<munderover>
- <mo>∫</mo>
+ <mo movablelimits="true">∫</mo>
<mrow>
<mo>−</mo><mo>∞</mo>
</mrow>
@@ -424,7 +424,7 @@
<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">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
@@ -474,7 +474,7 @@
</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:</p>
<div>
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mtable class="align" displaystyle="true">
<mtr>
<mtd>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|