From 7e066c516f24677eb867b1b72d5c4f1cd36c4609 Mon Sep 17 00:00:00 2001
From: milde
Date: Sat, 2 Mar 2013 16:36:20 +0000
Subject: [PATCH] Small fixes to math-output=HTML.
git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7619 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
---
docutils/docutils/utils/math/math2html.py | 11 +++--------
docutils/docutils/writers/html4css1/math.css | 8 +++++---
docutils/test/functional/expected/math_output_html.html | 8 ++++----
docutils/test/functional/input/data/math.css | 8 +++++---
4 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py
index 4a425cea5..2d3149e9a 100644
--- a/docutils/docutils/utils/math/math2html.py
+++ b/docutils/docutils/utils/math/math2html.py
@@ -25,14 +25,6 @@
import sys
-if sys.version_info < (2,4):
- def reversed(sequence):
- i = len(sequence)
- while i > 0:
- i = i - 1
- yield sequence[i]
-
-
class Trace(object):
"A tracing class"
@@ -638,6 +630,9 @@ class FormulaConfig(object):
u'\\int':u'∫', u'\\intop':u'∫', u'\\lim':u'lim', u'\\prod':u'∏',
u'\\smallint':u'∫', u'\\sum':u'∑',
}
+ # TODO: setting for simple enlarged vs. piecewise symbols
+ for key in (u'\\int', u'\\intop', u'\\prod', u'\\sum'):
+ limitcommands[key] = '%s' % limitcommands[key]
misccommands = {
u'\\limits':u'LimitPreviousCommand', u'\\newcommand':u'MacroDefinition',
diff --git a/docutils/docutils/writers/html4css1/math.css b/docutils/docutils/writers/html4css1/math.css
index 4f43b37e0..e6eec6565 100644
--- a/docutils/docutils/writers/html4css1/math.css
+++ b/docutils/docutils/writers/html4css1/math.css
@@ -21,7 +21,7 @@
/* Formulas */
.formula {
text-align: center;
- font-family: "DejaVu Serif", serif;
+ font-family: "Droid Serif", "DejaVu Serif", "STIX", serif;
margin: 1.2em 0;
}
span.formula {
@@ -113,9 +113,11 @@ span.root {
vertical-align: middle;
}
span.symbol {
+ line-height: 125%;
font-size: 125%;
}
span.bigsymbol {
+ line-height: 150%;
font-size: 150%;
}
span.largesymbol {
@@ -139,10 +141,10 @@ span.limits {
}
.limit {
display: table-row;
- line-height: 95%;
+ line-height: 99%;
}
sup.limit, sub.limit {
- line-height: 150%;
+ line-height: 100%;
}
span.symbolover {
display: inline-block;
diff --git a/docutils/test/functional/expected/math_output_html.html b/docutils/test/functional/expected/math_output_html.html
index b3777d6ed..09ee5cc1f 100644
--- a/docutils/test/functional/expected/math_output_html.html
+++ b/docutils/test/functional/expected/math_output_html.html
@@ -62,10 +62,10 @@ See eq:M and
-∫10xndx = (1)/(n + 1)
+1∫0xndx = (1)/(n + 1)
-∑mn = 1n = (m(m + 1))/(2)
+m∑n = 1n = (m(m + 1))/(2)
LaTeX-supported Unicode math symbols can be used in math roles and
directives:
@@ -121,7 +121,7 @@ physical system changes in time.
\widehat{xxx} -->
Modulation Transfer Function:
-MTF = ||(ℱ{s(x)})/(ℱ{s(x)}|ωx = 0)|| = abs⎛⎝(∫∞ − ∞s(x)eiωxxdx)/(∫∞ − ∞s(x)dx)⎞⎠.
+MTF = ||(ℱ{s(x)})/(ℱ{s(x)}|ωx = 0)|| = abs⎛⎝(∫∞ − ∞s(x)eiωxxdx)/(∫∞ − ∞s(x)dx)⎞⎠.
Math split over two lines: If a double backslash is detected outside a
\begin{...} \end{...} pair, the math code is wrapped in an AMSmath
@@ -150,7 +150,7 @@ physical system changes in time.
- = ∫sin(x’)sδ(x − x’)dx’
+ = ∫sin(x’)sδ(x − x’)dx’
diff --git a/docutils/test/functional/input/data/math.css b/docutils/test/functional/input/data/math.css
index 4f43b37e0..e6eec6565 100644
--- a/docutils/test/functional/input/data/math.css
+++ b/docutils/test/functional/input/data/math.css
@@ -21,7 +21,7 @@
/* Formulas */
.formula {
text-align: center;
- font-family: "DejaVu Serif", serif;
+ font-family: "Droid Serif", "DejaVu Serif", "STIX", serif;
margin: 1.2em 0;
}
span.formula {
@@ -113,9 +113,11 @@ span.root {
vertical-align: middle;
}
span.symbol {
+ line-height: 125%;
font-size: 125%;
}
span.bigsymbol {
+ line-height: 150%;
font-size: 150%;
}
span.largesymbol {
@@ -139,10 +141,10 @@ span.limits {
}
.limit {
display: table-row;
- line-height: 95%;
+ line-height: 99%;
}
sup.limit, sub.limit {
- line-height: 150%;
+ line-height: 100%;
}
span.symbolover {
display: inline-block;
--
2.11.4.GIT