Page MenuHomePhabricator

<math>\mathbf{\Lambda}</math> not bold
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Assigned To
Authored By
Dexxor
Mar 28 2025, 8:24 AM
Referenced Files
F65981047: Screenshot 2025-09-07 at 21.05.04.png
Sep 7 2025, 7:06 PM
F65756025: image.png
Aug 15 2025, 12:41 PM
F65755920: image.png
Aug 15 2025, 12:23 PM
F65755787: image.png
Aug 15 2025, 12:06 PM

Description

Enable "MathML (experimental; no images)" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>\mathbf{\Lambda}</math>. This should renders as bold Λ but it's actually just an ordinary Λ (lowercase Greek letters are not affected by this). Firefox correctly displays it as bold when you change mathvariant="normal" to mathvariant="bold" in the generated MathML.

I took a look at the MediaWiki code and found two possible issues:

  1. The function getFontArgs in MMLmappings/Util/MMLParsingUtil.php gets called with $name = \mathbf but compares it against case "mathbf" without the leading backslash.
  2. The function checkAndParseMathCharacter in MMLmappings/BaseMethods.php changes "mathvariant" back to "normal" anyway.

Event Timeline

Physikerwelt triaged this task as Medium priority.
Physikerwelt set the point value for this task to 1.
Physikerwelt subscribed.

mathvariant="bold" is not part of MathML core and thus not supported by Chrome and chorium-based browsers.
https://www.w3.org/TR/mathml-core/#bold-mappings lists the character in the mapping table
Λ U+039B 𝚲 U+1D6B2 1D317
thus, we 'just' need to ensure that this mapping table is used.

Change #1162172 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] WIP bold lambda

https://gerrit.wikimedia.org/r/1162172

Change #1162172 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Add a test for bold lambda

https://gerrit.wikimedia.org/r/1162172

This seems to impact numbers as well. For

<math>1\textbf{1}1 A\textbf{B}C</math>

We get

image.png (170×167 px, 6 KB)

This could be a chrome bug. On Firefox we have

image.png (395×547 px, 17 KB)

\mathbf{\Lambda} and \Lambda are indistinguishable, but we can distinguish between \mathbf{1} and 1.

Change #1185106 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Use identifier to render greek letters

https://gerrit.wikimedia.org/r/1185106

Change #1185161 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Unescape unicode symbols for identifiers

https://gerrit.wikimedia.org/r/1185161

Change #1185106 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Use identifier to render greek letters

https://gerrit.wikimedia.org/r/1185106

Change #1185161 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Unescape unicode symbols for identifiers

https://gerrit.wikimedia.org/r/1185161

Change #1185238 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Use unicode symbols to render boldsymbol

https://gerrit.wikimedia.org/r/1185238

Change #1185238 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Use unicode symbols to render boldsymbol

https://gerrit.wikimedia.org/r/1185238

There is a chrome bug-report https://issues.chromium.org/issues/415094811 . However, what I read in the latest version of the MathML core spec is that the feature is now optimal, and one should use UTF-8 symbols instead of the mathvariant. So I think we need to fix the numbers in an additional step. Maybe it's better to make an extra ticket for that.

Screenshot 2025-09-07 at 21.05.04.png (2×4 px, 1 MB)

This works with chrome and firefox. However, numbers (T397120) don't work with chrome.