|
From: <mi...@us...> - 2021-07-12 21:23:34
|
Revision: 8798
http://sourceforge.net/p/docutils/code/8798
Author: milde
Date: 2021-07-12 21:23:31 +0000 (Mon, 12 Jul 2021)
Log Message:
-----------
math2html: Prefer STIX fonts for formulas.
STIX is free, widely supported, and comprehensive.
(On the downside: it is considerably smaller than DejaVu:
no problem with Chromium/Chrome but in Firefox a larger font-size
might be advised.)
Work around bugs/problems in STIX:
"medium mathematical space" is too wide,
"vertical line" glyphs leave gaps when stacked,
upright integrals provide better alignment of limits.
Modified Paths:
--------------
trunk/docutils/docs/ref/rst/mathematics.txt
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/writers/html5_polyglot/math.css
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
Modified: trunk/docutils/docs/ref/rst/mathematics.txt
===================================================================
--- trunk/docutils/docs/ref/rst/mathematics.txt 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/docs/ref/rst/mathematics.txt 2021-07-12 21:23:31 UTC (rev 8798)
@@ -16,7 +16,6 @@
__ https://docutils.sourceforge.io/docs/ref/rst/directives.html#math
__ https://docutils.sourceforge.io/docs/ref/rst/roles.html#math
-
Inline formulas and displayed equations
=======================================
@@ -24,7 +23,7 @@
``: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. [#math-syntax]_
-
+
.. tip::
If you put ``.. default-role:: math`` at the top of your
@@ -992,15 +991,27 @@
Variable-sized operators:
-Inline: `\sum\ \int\ \oint\ \smallint\ \prod\ \coprod\ \bigwedge\
-\bigvee\ \bigcap\ \bigcup\ \biguplus\ \bigsqcup\ \bigodot\ \bigoplus\
-\bigotimes` and Display:
+Inline: `\sum\ \int\ \iint\ \iiint\ \iiiint\ \idotsint\ \oint\ \smallint\
+\prod\ \coprod\ \bigwedge\ \bigvee\ \bigcap\ \bigcup\ \biguplus\
+\bigsqcup\ \bigodot\ \bigoplus\ \bigotimes` and Display:
-.. math:: \sum\ \int\ \oint\ \smallint\ \prod\ \coprod\ \bigwedge
- \ \bigvee\ \bigcap\ \bigcup\ \biguplus\ \bigsqcup\ \bigodot
- \ \bigoplus\ \bigotimes
- \ \iiint\ \iiiint
+.. math:: \int\ \iint\ \iiint\ \iiiint\ \idotsint\ \oint\ \smallint\
+ \sum\ \prod\ \coprod\ \bigwedge\ \bigvee\ \bigcap\ \bigcup\
+ \biguplus\ \bigsqcup\ \bigodot\ \bigoplus\ \bigotimes
+.. math:: \int_1 f\ \intop_1 f\ \iint_1 f\ \smallint_1 f\ \sum_1 \
+ \prod_1 \ \bigwedge_1 \ \bigcap_1 \ \biguplus_1 \ \bigodot_1 \ \int^N
+ \ \intop^N \ \iiiint^N \ \oint^N \ \smallint^N \ \sum^N \ \coprod^N \
+ \bigvee^N \ \bigcup^N \ \bigsqcup^N \ \bigotimes^N \
+
+.. math:: \int_1^N \ \intop_1^N \ \iint_1^N \ \iiint_1^N \ \iiiint_1^N \
+ \idotsint_1^N \ \oint_1^N \ \smallint_1^N \ \sum_1^N \ \prod_1^N \
+ \coprod_1^N \ \bigwedge_1^N \ \bigvee_1^N \ \bigcap_1^N \ \bigcup_1^N
+ \ \biguplus_1^N \ \bigsqcup_1^N \ \bigodot_1^N \ \bigoplus_1^N \
+ \bigotimes_1^N \
+
+
+
Text
~~~~
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/docutils/utils/math/math2html.py 2021-07-12 21:23:31 UTC (rev 8798)
@@ -171,15 +171,18 @@
u'{': [u'⎧', u'⎪', u'⎨', u'⎩',],
u'}': [u'⎫', u'⎪', u'⎬', u'⎭',],
# TODO: 2-row brackets with ⎰⎱ (\lmoustache \rmoustache)
- u'|': [u'|',],
- u'∥': [u'∥',],
+ u'|': [u'|',], # 007C VERTICAL LINE
+ # u'|': [u'⎮',], # 23AE INTEGRAL EXTENSION
+ # u'|': [u'⎪',], # 23AA CURLY BRACKET EXTENSION
+ u'‖': [u'‖'], # 2016 DOUBLE VERTICAL LINE
+ # u'∥': [u'∥'], # 2225 PARALLEL TO
}
bracketcommands = {
- u'\\left': u'span class="bigdelimiter size2"',
+ u'\\left': u'span class="stretchy"',
u'\\left.': u'<span class="leftdot"></span>',
- u'\\middle': u'span class="bigdelimiter size2"',
- u'\\right': u'span class="bigdelimiter size2"',
+ u'\\middle': u'span class="stretchy"',
+ u'\\right': u'span class="stretchy"',
u'\\right.': u'<span class="rightdot"></span>',
}
@@ -215,25 +218,16 @@
'\\euro': u'€',
'\\guillemotleft': u'«',
'\\guillemotright': u'»',
- '\\idotsint': u'<span class="bigoperator">∫⋯∫</span>',
- '\\iiiint': u'<span class="bigoperator">⨌</span>',
- '\\iiint': u'<span class="bigoperator">∭</span>',
- '\\iint': u'<span class="bigoperator">∬</span>',
- '\\lVert': u'∥',
+ '\\lVert': u'‖',
'\\Arrowvert': u'\u2016', # ‖
- '\\lvert': u'∣',
+ '\\lvert': u'|',
'\\newline': u'<br/>',
'\\nobreakspace': u' ',
'\\nolimits': u'',
'\\nonumber': u'',
- '\\oiiint': u'<span class="bigoperator">∰</span>',
- '\\oiint': u'<span class="bigoperator">∯</span>',
- '\\oint': u'<span class="bigoperator">∮</span>',
- '\\ointclockwise': u'<span class="bigoperator">∲</span>',
- '\\ointctrclockwise': u'<span class="bigoperator">∳</span>',
'\\qquad': u' ',
- '\\rVert': u'∥',
- '\\rvert': u'∣',
+ '\\rVert': u'‖',
+ '\\rvert': u'|',
'\\shortmid': u'<span class="smallsymbol">∣</span>',
'\\shortparallel': u'<span class="smallsymbol">∥</span>',
'\\nshortmid': u'<span class="smallsymbol">∤</span>',
@@ -240,7 +234,6 @@
'\\nshortparallel': u'<span class="smallsymbol">∦</span>',
'\\smallfrown': u'<span class="smallsymbol">⌢</span>',
'\\smallsmile': u'<span class="smallsymbol">⌣</span>',
- '\\smallint': u'<span class="smallsymbol">∫</span>',
'\\textasciicircum': u'^',
'\\textasciitilde': u'~',
'\\textbackslash': u'\\',
@@ -409,6 +402,7 @@
u'\\rule': [u'[$v!]{$w!}{$h!}', u'f0/', u'hr class="line" style="width: $w; height: $h;"',],
u'\\scriptscriptstyle': [u'{$1}', u'f0{$1}', u'span class="scriptscriptstyle"',],
u'\\scriptstyle': [u'{$1}', u'f0{$1}', u'span class="scriptstyle"',],
+ # TODO: increase √-size with argument (\frac in display mode, ...)
u'\\sqrt': [u'[$0]{$1}', u'f0{f1{$0}f2{√}f4{(}f3{$1}f4{)}}', u'span class="sqrt"', u'sup class="root"', u'span class="radical"', u'span class="root"', u'span class="ignored"',],
u'\\stackrel': [u'{$1}{$2}', u'f0{f1{$1}f2{$2}}', u'span class="stackrel"', u'span class="upstackrel"', u'span class="downstackrel"',],
u'\\tbinom': [u'{$1}{$2}', u'(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', u'span class="binomial"', u'span class="binomrow"', u'span class="binomcell"',],
@@ -439,7 +433,7 @@
'\\max': u'max',
'\\min': u'min',
'\\sup': u'sup',
- '\\ointop': u'<span class="bigoperator">∮</span>',
+ '\\ointop': u'<span class="bigoperator integral">∮</span>',
'\\bigcap': u'<span class="bigoperator">⋂</span>',
'\\bigcup': u'<span class="bigoperator">⋃</span>',
'\\bigodot': u'<span class="bigoperator">⨀</span>',
@@ -451,7 +445,7 @@
'\\bigvee': u'<span class="bigoperator">⋁</span>',
'\\bigwedge': u'<span class="bigoperator">⋀</span>',
'\\coprod': u'<span class="bigoperator">∐</span>',
- '\\intop': u'<span class="bigoperator">∫</span>',
+ '\\intop': u'<span class="bigoperator integral">∫</span>',
'\\prod': u'<span class="bigoperator">∏</span>',
'\\sum': u'<span class="bigoperator">∑</span>',
'\\varprod': u'<span class="bigoperator">⨉</span>',
@@ -458,16 +452,26 @@
'\\zcmp': u'⨟', '\\zhide': u'⧹', '\\zpipe': u'⨠', '\\zproject': u'⨡',
# integrals have limits in index position with LaTeX default settings
# TODO: move to commands?
- '\\int': u'<span class="bigoperator">∫</span>',
- '\\fint': u'<span class="bigoperator">⨏</span>',
- '\\sqint': u'<span class="bigoperator">⨖</span>',
- '\\varointclockwise': u'<span class="bigoperator">∲</span>',
+ '\\int': u'<span class="bigoperator integral">∫</span>',
+ '\\iint': u'<span class="bigoperator integral">∬</span>',
+ '\\iiint': u'<span class="bigoperator integral">∭</span>',
+ '\\iiiint': u'<span class="bigoperator integral">⨌</span>',
+ '\\fint': u'<span class="bigoperator integral">⨏</span>',
+ '\\idotsint': u'<span class="bigoperator integral">∫⋯∫</span>',
+ '\\oint': u'<span class="bigoperator integral">∮</span>',
+ '\\oiint': u'<span class="bigoperator integral">∯</span>',
+ '\\oiiint': u'<span class="bigoperator integral">∰</span>',
+ '\\ointclockwise': u'<span class="bigoperator integral">∲</span>',
+ '\\ointctrclockwise': u'<span class="bigoperator integral">∳</span>',
+ '\\smallint': u'<span class="smallsymbol integral">∫</span>',
+ '\\sqint': u'<span class="bigoperator integral">⨖</span>',
+ '\\varointclockwise': u'<span class="bigoperator integral">∲</span>',
}
modified = {
- u'\n': u'', u' ': u'', u'$': u'', u'&': u' ', u'\'': u'’', u'+': u' + ',
- u',': u', ', u'-': u' − ', u'/': u' ⁄ ', u':': u' : ', u'<': u' < ',
- u'=': u' = ', u'>': u' > ', u'@': u'', u'~': u'\u00a0',
+ u'\n': u'', u' ': u'', u'$': u'', u'&': u' ', u'\'': u'’', u'+': u'\u2009+\u2009',
+ u',': u',\u2009', u'-': u'\u2009−\u2009', u'/': u'\u2009⁄\u2009', u':': u' : ', u'<': u'\u2009<\u2009',
+ u'=': u'\u2009=\u2009', u'>': u'\u2009>\u2009', u'@': u'', u'~': u'\u00a0',
}
onefunctions = {
@@ -1954,7 +1958,7 @@
if bit.type == 'alpha':
self.italicize(bit, contents)
elif bit.type == 'font' and last and last.type == 'number':
- bit.contents.insert(0, FormulaConstant(u' '))
+ bit.contents.insert(0, FormulaConstant(u'\u2009'))
last = bit
def traverse(self, bit):
@@ -2299,8 +2303,10 @@
def parsebit(self, pos):
"Place as contents the command translated and spaced."
- # pad with MEDIUM MATHEMATICAL SPACE
- self.contents = [FormulaConstant(u'\u205f' + self.translated + u'\u205f')]
+ # pad with MEDIUM MATHEMATICAL SPACE (4/18 em): too wide in STIX fonts :(
+ # self.contents = [FormulaConstant(u'\u205f' + self.translated + u'\u205f')]
+ # pad with THIN SPACE (1/5 em)
+ self.contents = [FormulaConstant(u'\u2009' + self.translated + u'\u2009')]
class AlphaCommand(EmptyCommand):
"""A command without paramters whose result is alphabetical."""
@@ -2460,7 +2466,7 @@
"Return the bracket as a single sign."
if self.original == '.':
return [TaggedBit().constant('', 'span class="emptydot"')]
- return [TaggedBit().constant(self.original, 'span class="bigdelimiter size2"')]
+ return [TaggedBit().constant(self.original, 'span class="stretchy"')]
class FormulaEquation(CommandBit):
@@ -2683,8 +2689,8 @@
return
# Trace.message(' basechar: %r' % parameter.string)
# Insert combining character after the first character:
- if parameter.string.startswith(u'\u205f'):
- i = 2 # skip padding by SpacedCommand
+ if parameter.string.startswith(u'\u2009'):
+ i = 2 # skip padding by SpacedCommand and FormulaConfig.modified
else:
i = 1
parameter.string = parameter.string[:i] + combining + parameter.string[i:]
@@ -2793,7 +2799,7 @@
if self.checkscript(contents, index + 1):
superscript = self.getlimit(contents, index + 1)
else:
- superscript = TaggedBit().constant(u' ', 'sup class="limit"')
+ superscript = TaggedBit().constant(u'\u2009', 'sup class="limit"')
# fix order if source is x^i
if subscript.command == '^':
superscript, subscript = subscript, superscript
Modified: trunk/docutils/docutils/writers/html5_polyglot/math.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-07-12 21:23:31 UTC (rev 8798)
@@ -25,8 +25,6 @@
/* Formulas */
.formula {
text-align: center;
- font-family: "DejaVu Serif", STIX, serif;
- /* "DejaVu Math TeX Gyre", (brace pieces don't fit) */
margin: 1.2em 0;
line-height: 1.4;
}
@@ -97,7 +95,7 @@
padding: 0ex;
border-top: thin solid;
}
-math sub, math sup {
+.formula sub, .formula sup {
font-size: 80%;
}
sup.numerator, sup.unit {
@@ -108,6 +106,7 @@
}
span.smallsymbol {
font-size: 75%;
+ line-height: 75%;
}
span.sqrt {
display: inline-block;
@@ -121,7 +120,7 @@
span.radical {
display: inline-block;
padding: 0ex;
- font-size: 160%;
+ /* font-size: 160%; for DejaVu, not required with STIX */
line-height: 100%;
vertical-align: top;
vertical-align: middle;
@@ -133,41 +132,44 @@
padding: 0ex;
vertical-align: middle;
}
-span.symbol {
- line-height: 125%;
- font-size: 125%;
-}
div.formula .bigoperator,
.displaystyle .bigoperator,
.displaystyle .bigoperator {
- line-height: 150%;
+ line-height: 130%;
font-size: 150%;
+ padding-right: 0.2ex;
}
span.fraction .bigoperator,
span.scriptstyle .bigoperator {
line-height: inherit;
font-size: inherit;
+ padding-right: 0;
}
span.bigdelimiter {
display: inline-block;
- vertical-align: text-bottom;
}
span.bigdelimiter.size1 {
transform: scale(1, 1.2);
+ line-height: 1.2;
}
span.bigdelimiter.size2 {
transform: scale(1, 1.62);
+ line-height: 1.62%;
+
}
span.bigdelimiter.size3 {
transform: scale(1, 2.05);
+ line-height: 2.05%;
}
span.bigdelimiter.size4 {
transform: scale(1, 2.47);
+ line-height: 2.47%;
}
/* vertically stacked sub and superscript */
span.scripts {
display: inline-table;
vertical-align: middle;
+ padding-right: 0.2ex;
}
.script {
display: table-row;
@@ -221,10 +223,6 @@
.environment.align > .arrayrow > .arraycell.align-l {
padding-right: 2em;
}
-/*
-* CSS file for LaTeX formulas, extra stuff:
-* binomials, vertical braces, stackrel, fonts and colors.
-*/
/* Inline binomials */
span.binom {
@@ -267,6 +265,18 @@
}
/* Fonts */
+.formula {
+ font-family: STIX, "DejaVu Serif", "DejaVu Math TeX Gyre", serif;
+}
+span.radical, /* ensure correct size of square-root sign */
+span.integral { /* upright integral signs for better alignment of indices */
+ font-family: "STIXIntegralsUp", STIX;
+ /* font-size: 115%; match apparent size with DejaVu */
+}
+span.bracket {
+ /* some "STIX" and "DejaVu Math TeX Gyre" bracket pieces don't fit */
+ font-family: "DejaVu Serif", serif;
+}
span.mathsf, span.textsf {
font-style: normal;
font-family: sans-serif;
@@ -273,7 +283,7 @@
}
span.mathrm, span.textrm {
font-style: normal;
- font-family: serif;
+ font-family: STIX, "DejaVu Serif", "DejaVu Math TeX Gyre", serif;
}
span.mathtt, span.texttt {
font-style: normal;
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2021-07-12 21:23:31 UTC (rev 8798)
@@ -13,20 +13,20 @@
<h1 class="title">Mathematics</h1>
<p>Docutils supports inline math with the prefix or postfix <tt class="docutils literal">:math:</tt>
-role specificator, <span class="formula"><i>n</i>! + sin(<i>x</i><span class="scripts"><sup class="script">2</sup><sub class="script"><i>n</i></sub></span>)</span> and <span class="formula"><i>A</i><sub><span class="text">c</span></sub> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>π</i></span><span class="ignored">)/(</span><span class="denominator">4</span><span class="ignored">)</span></span><i>d</i><sup>2</sup></span>, as well as displayed math via the
+role specificator, <span class="formula"><i>n</i>! + sin(<i>x</i><span class="scripts"><sup class="script">2</sup><sub class="script"><i>n</i></sub></span>)</span> and <span class="formula"><i>A</i><sub><span class="text">c</span></sub> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>π</i></span><span class="ignored">)/(</span><span class="denominator">4</span><span class="ignored">)</span></span><i>d</i><sup>2</sup></span>, as well as displayed math via the
<cite>math</cite> directive:</p>
<div class="formula">
-<i>f</i>(<i>ϵ</i>) = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator">1 + exp<span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><i>ε</i></span><span class="ignored">)/(</span><span class="denominator"><i>k</i><sub><span class="text">B</span></sub><i>T</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">⎞</span></span><span class="arrayrow"><span class="bracket align-right">⎠</span></span></span></span><span class="ignored">)</span></span>
+<i>f</i>(<i>ϵ</i>) = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator">1 + exp<span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><i>ε</i></span><span class="ignored">)/(</span><span class="denominator"><i>k</i><sub><span class="text">B</span></sub><i>T</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">⎞</span></span><span class="arrayrow"><span class="bracket align-right">⎠</span></span></span></span><span class="ignored">)</span></span>
</div>
<p>Content may start on the first line of the directive, e.g.</p>
<div class="formula">
-<i>N</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="text">number of apples</span></span><span class="ignored">)/(</span><span class="denominator">7</span><span class="ignored">)</span></span>
+<i>N</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="text">number of apples</span></span><span class="ignored">)/(</span><span class="denominator">7</span><span class="ignored">)</span></span>
</div>
<p>Equations can be labeled with a reference name using the <tt class="docutils literal">:name:</tt> 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 class="formula" id="eq-m">
-<b>M</b> = <span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎜</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="array"><span class="arrayrow">
+<b>M</b> = <span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎜</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="array"><span class="arrayrow">
<span class="arraycell align-c">
<i>a</i>
</span>
@@ -55,20 +55,20 @@
</span>
</span><span class="array"><span class="arrayrow"><span class="bracket align-right">⎞</span></span><span class="arrayrow"><span class="bracket align-right">⎟</span></span><span class="arrayrow"><span class="bracket align-right">⎠</span></span></span>
</div>
-<p>is <span class="formula">|<b>M</b>| = <i>ad</i> − <i>bc</i></span>.</p>
+<p>is <span class="formula">|<b>M</b>| = <i>ad</i> − <i>bc</i></span>.</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 class="formula">
-<span class="limits"><sup class="limit">1</sup><span class="limit"><span class="bigoperator">∫</span></span><sub class="limit">0</sub></span><i>x</i><sup><i>n</i></sup><i>dx</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator"><i>n</i> + 1</span><span class="ignored">)</span></span>
+<span class="limits"><sup class="limit">1</sup><span class="limit"><span class="bigoperator integral">∫</span></span><sub class="limit">0</sub></span><i>x</i><sup><i>n</i></sup><i>dx</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator">1</span><span class="ignored">)/(</span><span class="denominator"><i>n</i> + 1</span><span class="ignored">)</span></span>
</div>
<div class="formula">
-<span class="limits"><sup class="limit"><i>m</i></sup><span class="limit"><span class="bigoperator">∑</span></span><sub class="limit"><i>n</i> = 1</sub></span><i>n</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>m</i>(<i>m</i> + 1)</span><span class="ignored">)/(</span><span class="denominator">2</span><span class="ignored">)</span></span>
+<span class="limits"><sup class="limit"><i>m</i></sup><span class="limit"><span class="bigoperator">∑</span></span><sub class="limit"><i>n</i> = 1</sub></span><i>n</i> = <span class="fraction"><span class="ignored">(</span><span class="numerator"><i>m</i>(<i>m</i> + 1)</span><span class="ignored">)/(</span><span class="denominator">2</span><span class="ignored">)</span></span>
</div>
<p>LaTeX-supported Unicode math symbols can be used in math roles and
directives:</p>
<p>The Schrödinger equation</p>
<div class="formula" id="eq-schrodinger">
-<i>i</i><i>ℏ</i><span class="fraction"><span class="ignored">(</span><span class="numerator">∂</span><span class="ignored">)/(</span><span class="denominator">∂<i>t</i></span><span class="ignored">)</span></span>Ψ = <i>Ĥ</i>Ψ,
+<i>i</i><i>ℏ</i><span class="fraction"><span class="ignored">(</span><span class="numerator">∂</span><span class="ignored">)/(</span><span class="denominator">∂<i>t</i></span><span class="ignored">)</span></span>Ψ = <i>Ĥ</i>Ψ,
</div>
<p>with the <em>wave function</em> <span class="formula">Ψ</span>, describes how the quantum state of a
physical system changes in time.</p>
@@ -105,7 +105,7 @@
\widehat{xxx} -->
<p>Modulation Transfer Function:</p>
<div class="formula">
-<span class="text">MTF</span> = <span class="array"><span class="arrayrow"><span class="bracket align-left">|</span></span><span class="arrayrow"><span class="bracket align-left">|</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator">ℱ{<i>s</i>(<i>x</i>)}</span><span class="ignored">)/(</span><span class="denominator">ℱ{<i>s</i>(<i>x</i>)}|<sub><i>ω</i><sub><i>x</i></sub> = 0</sub></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">|</span></span><span class="arrayrow"><span class="bracket align-right">|</span></span></span> = <span class="mathrm"> abs</span><span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="limits"><span class="limit"><span class="bigoperator">∫</span></span></span><span class="scripts"><sup class="script">∞</sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">e</span><sup><span class="mathrm">i</span><i>ω</i><sub><i>x</i></sub><i>x</i></sup><span class="mathrm">d</span><i>x</i></span><span class="ignored">)/(</span><span class="denominator"><span class="limits"><span class="limit"><span class="bigoperator">∫</span></span></span><span class="scripts"><sup class="script">∞</sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">d</span><i>x</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">⎞</span></span><span class="arrayrow"><span class="bracket align-right">⎠</span></span></span>.
+<span class="text">MTF</span> = <span class="array"><span class="arrayrow"><span class="bracket align-left">|</span></span><span class="arrayrow"><span class="bracket align-left">|</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator">ℱ{<i>s</i>(<i>x</i>)}</span><span class="ignored">)/(</span><span class="denominator">ℱ{<i>s</i>(<i>x</i>)}|<sub><i>ω</i><sub><i>x</i></sub> = 0</sub></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">|</span></span><span class="arrayrow"><span class="bracket align-right">|</span></span></span> = <span class="mathrm"> abs</span><span class="array"><span class="arrayrow"><span class="bracket align-left">⎛</span></span><span class="arrayrow"><span class="bracket align-left">⎝</span></span></span><span class="fraction"><span class="ignored">(</span><span class="numerator"><span class="limits"><span class="limit"><span class="bigoperator integral">∫</span></span></span><span class="scripts"><sup class="script">∞</sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">e</span><sup><span class="mathrm">i</span><i>ω</i><sub><i>x</i></sub><i>x</i></sup><span class="mathrm">d</span><i>x</i></span><span class="ignored">)/(</span><span class="denominator"><span class="limits"><span class="limit"><span class="bigoperator integral">∫</span></span></span><span class="scripts"><sup class="script">∞</sup><sub class="script"> − ∞</sub></span><i>s</i>(<i>x</i>)<span class="mathrm">d</span><i>x</i></span><span class="ignored">)</span></span><span class="array"><span class="arrayrow"><span class="bracket align-right">⎞</span></span><span class="arrayrow"><span class="bracket align-right">⎠</span></span></span>.
</div>
<p>Math split over two lines: If a double backslash is detected outside a
<tt class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></tt> 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>
@@ -116,7 +116,7 @@
<i>s</i><sub><span class="mathrm">out</span></sub>(<i>x</i>)
</span>
<span class="arraycell align-l">
- = <i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)*<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)
+ = <i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)*<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)
</span>
</span>
@@ -134,7 +134,7 @@
</span>
<span class="arraycell align-l">
- = <span class="limits"><span class="limit"><span class="bigoperator">∫</span></span></span><i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)<span class="mathrm">d</span><i>x</i>’
+ = <span class="limits"><span class="limit"><span class="bigoperator integral">∫</span></span></span><i>s</i><sub><span class="mathrm">in</span></sub>(<i>x</i>’)<i>s</i><sub><i>δ</i></sub>(<i>x</i> − <i>x</i>’)<span class="mathrm">d</span><i>x</i>’
</span>
</span>
@@ -142,13 +142,13 @@
</div>
<p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <tt class="docutils literal">cases</tt> environment:</p>
<div class="formula">
-<span class="mathrm">sgn</span>(<i>x</i>) = <span class="array"><span class="arrayrow"><span class="bracket align-l">⎧</span></span><span class="arrayrow"><span class="bracket align-l">⎨</span></span><span class="arrayrow"><span class="bracket align-l">⎩</span></span></span><span class="bracketcases">
+<span class="mathrm">sgn</span>(<i>x</i>) = <span class="array"><span class="arrayrow"><span class="bracket align-l">⎧</span></span><span class="arrayrow"><span class="bracket align-l">⎨</span></span><span class="arrayrow"><span class="bracket align-l">⎩</span></span></span><span class="bracketcases">
<span class="arrayrow">
<span class="case align-l">
- − 1
+ − 1
</span>
<span class="case align-l">
-<i>x</i> < 0
+<i>x</i> < 0
</span>
</span>
@@ -166,7 +166,7 @@
1
</span>
<span class="case align-l">
-<i>x</i> > 0
+<i>x</i> > 0
</span>
</span>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-07-12 21:23:31 UTC (rev 8798)
@@ -998,7 +998,7 @@
Inline markup is supported, e.g. <em>emphasis</em>, <strong>strong</strong>, <tt class="docutils literal">literal
text</tt>, <span class="subscript">sub-</span> and <span class="superscript">super</span>scripts,
-inline formulas: <span class="formula"><i>A</i> = 2<i>π</i><i>r</i><sup>2</sup></span>,
+inline formulas: <span class="formula"><i>A</i> = 2<i>π</i><i>r</i><sup>2</sup></span>,
footnotes <a class="footnote-reference" href="#footnote-1" id="footnote-reference-9">[1]</a>, <span class="target" id="hyperlink-targets">hyperlink targets</span>, and <a class="reference external" href="http://www.python.org/">references</a>.
</pre>
</div>
@@ -1025,7 +1025,7 @@
or as base for special code roles, e.g. the LaTeX code in the next
paragraph.</p>
<p>Docutils uses LaTeX syntax for math directives and roles:
-<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>.</p>
+<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>.</p>
<p>The <tt class="docutils literal">:code:</tt> option of the <cite>include</cite> directive sets the included content
as a code block, here the rst file <tt class="docutils literal">header_footer.txt</tt> with line numbers:</p>
<pre class="code rst literal-block">
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-07-12 21:23:19 UTC (rev 8797)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-07-12 21:23:31 UTC (rev 8798)
@@ -1015,7 +1015,7 @@
Inline markup is supported, e.g. <em>emphasis</em>, <strong>strong</strong>, <span class="docutils literal">literal
text</span>, <sub>sub-</sub> and <sup>super</sup>scripts,
-inline formulas: <span class="formula"><i>A</i> = 2<i>π</i><i>r</i><sup>2</sup></span>,
+inline formulas: <span class="formula"><i>A</i> = 2<i>π</i><i>r</i><sup>2</sup></span>,
footnotes <a class="footnote-reference brackets" href="#footnote-1" id="footnote-reference-9" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>, <span class="target" id="hyperlink-targets">hyperlink targets</span>, and <a class="reference external" href="http://www.python.org/">references</a>.</pre>
</section>
<section id="code">
@@ -1037,7 +1037,7 @@
or as base for special code roles, e.g. the LaTeX code in the next
paragraph.</p>
<p>Docutils uses LaTeX syntax for math directives and roles:
-<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>.</p>
+<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>.</p>
<p>The <span class="docutils literal">:code:</span> option of the <cite>include</cite> directive sets the included content
as a code block, here the rst file <span class="docutils literal">header_footer.txt</span> with line numbers:</p>
<pre class="code rst literal-block"><small class="ln">1 </small><code data-lineno="1 ">.. header:: Document header
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|