Page MenuHomePhabricator

Use stretchy="false" for \langle and \rangle in MathML mode
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
SalixAlba
Sep 28 2024, 7:45 PM
Referenced Files
F57711082: image.png
Nov 16 2024, 7:26 PM
F57690400: image.png
Nov 9 2024, 6:45 AM
F57690382: image.png
Nov 9 2024, 6:27 AM
F57611236: image.png
Oct 13 2024, 2:44 PM
F57566274: image.png
Sep 28 2024, 7:45 PM
F57566259: image.png
Sep 28 2024, 7:45 PM
F57566250: image.png
Sep 28 2024, 7:45 PM

Description

Steps to replicate the issue (include links if applicable):

  • Set math rendering mode to MathML
  • Enter the formula <math> B^b |\psi\rangle</math>

What happens?:

Rendered as

image.png (74×107 px, 2 KB)

What should have happened instead?:

For consistency with ) it should be rendered as

image.png (69×154 px, 2 KB)

Using <mo stretchy="false">⟩</mo>. This is the behavious in LaTeX and SVG mode.

Larger brackets could then be specified with \left and \right

<math> B^b \left|\psi\right\rangle</math>

Producing

image.png (90×133 px, 2 KB)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Chrome 129.

This is mentioned in https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:WikiProject_Mathematics&oldid=1248043485

Event Timeline

Wondering if we need to look again at T137788 which is really needed for good rendering of bra-ket notation.

Probably also for |, \lbrace, \rbrace.

Also a problem in Client side MathJax.

\langle \psi | B^b \quad \lbrace \psi | B^b \quad \lbrack \psi | B^b fail
as do B^b |\psi\rangle \quad B^b | \psi \rbrace \quad B^b | \psi \rbrack \quad B^b \vert\psi\rangle.

image.png (214×429 px, 10 KB)

The problem is that \rangle is a delimiter and | is an operator. Thus | doesn't stretch even if we stretch all delimiters.

image.png (182×251 px, 9 KB)

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

[mediawiki/extensions/Math@master] Don't stretch delimiters when used as literals

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

image.png (175×262 px, 9 KB)

works well with non-stretchy operators

Change #1088693 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Don't stretch delimiters and operators when used as literals

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