|
From: <mi...@us...> - 2023-04-08 21:08:54
|
Revision: 9338
http://sourceforge.net/p/docutils/code/9338
Author: milde
Date: 2023-04-08 21:08:47 +0000 (Sat, 08 Apr 2023)
Log Message:
-----------
LaTeX to MathML: fix ``\mspace``.
LaTeX width unit "mu" (mathematical unit) must be converted for MathML.
Typo in the code resulted in wrong "width" argument for `<mspace>`.
Modified Paths:
--------------
trunk/docutils/docs/ref/rst/mathematics.txt
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/writers/html5_polyglot/plain.css
trunk/docutils/docutils/writers/html5_polyglot/responsive.css
Modified: trunk/docutils/docs/ref/rst/mathematics.txt
===================================================================
--- trunk/docutils/docs/ref/rst/mathematics.txt 2023-04-06 20:31:09 UTC (rev 9337)
+++ trunk/docutils/docs/ref/rst/mathematics.txt 2023-04-08 21:08:47 UTC (rev 9338)
@@ -652,7 +652,7 @@
====================== ======== ===================== ==================
.. [#] Whitespace characters are ignored in LaTeX math mode.
-.. [#] Unit must be 'mu' (1 mu = 1/18em).
+.. [#] In LaTeX, unit must be 'mu' (1 mu = 1/18em).
Negative spacing does not work with MathML (in Firefox 78).
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2023-04-06 20:31:09 UTC (rev 9337)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2023-04-08 21:08:47 UTC (rev 9338)
@@ -206,16 +206,16 @@
spaces = {'qquad': '2em', # two \quad
'quad': '1em', # 18 mu
'thickspace': '0.2778em', # 5mu = 5/18em
+ ';': '0.2778em', # 5mu thickspace
+ ' ': '0.25em', # inter word space
'medspace': '0.2222em', # 4mu = 2/9em
+ ':': '0.2222em', # 4mu medspace
'thinspace': '0.1667em', # 3mu = 1/6em
+ ',': '0.1667em', # 3mu thinspace
'negthinspace': '-0.1667em', # -3mu = -1/6em
+ '!': '-0.1667em', # negthinspace
'negmedspace': '-0.2222em', # -4mu = -2/9em
'negthickspace': '-0.2778em', # -5mu = -5/18em
- ' ': '0.25em', # inter word space
- ';': '0.2778em', # 5mu thickspace
- ':': '0.2222em', # 4mu medspace
- ',': '0.1667em', # 3mu thinspace
- '!': '-0.1667em', # negthinspace
}
# accents -> <mover stretchy="false">
@@ -1101,7 +1101,8 @@
if name in ('hspace', 'mspace'):
arg, string = tex_group(string)
- if arg.endswith('m'):
+ if arg.endswith('mu'):
+ # unit "mu" (1mu=1/18em) not supported by MathML
arg = '%sem' % (float(arg[:-2])/18)
node = node.append(mspace(width='%s'%arg))
return node, string
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2023-04-06 20:31:09 UTC (rev 9337)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2023-04-08 21:08:47 UTC (rev 9338)
@@ -281,7 +281,8 @@
font-weight: bold;
}
mstyle.mathscr, mi.mathscr {
- font-family: STIX;
+ font-family: STIX, XITSMathJax_Script, rsfs10,
+ "Asana Math", Garamond, cursive;
}
/* Epigraph */
Modified: trunk/docutils/docutils/writers/html5_polyglot/responsive.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/responsive.css 2023-04-06 20:31:09 UTC (rev 9337)
+++ trunk/docutils/docutils/writers/html5_polyglot/responsive.css 2023-04-08 21:08:47 UTC (rev 9338)
@@ -17,8 +17,8 @@
/* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
/* .. _CSS3: https://www.w3.org/Style/CSS/ */
-/* Note: */
-/* This style sheet is provisional: */
+/* Note: */
+/* This style sheet is provisional: */
/* the API is not settled and may change with any minor Docutils version. */
@@ -357,7 +357,8 @@
font-weight: bold;
}
mstyle.mathscr, mi.mathscr {
- font-family: STIX;
+ font-family: STIX, XITSMathJax_Script, rsfs10,
+ "Asana Math", Garamond, cursive;
}
/* Adaptive page layout */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|