Page MenuHomePhabricator

Lots of space around the cells in matrix evironments in MathML mode
Closed, DeclinedPublicBUG REPORT

Assigned To
None
Authored By
SalixAlba
Sep 22 2024, 3:57 PM
Referenced Files
F57530368: image.png
Sep 22 2024, 3:59 PM
F57530357: image.png
Sep 22 2024, 3:57 PM
F57530341: image.png
Sep 22 2024, 3:57 PM
F57530323: image.png
Sep 22 2024, 3:57 PM
F57530326: image.png
Sep 22 2024, 3:57 PM

Description

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

  • Set Math rendering mode to MathML
  • Set font to Cambria Math
  • Enter the expressions
\begin{pmatrix} 
   \begin{pmatrix}a&b\\c&d\end{pmatrix} & 
   \begin{pmatrix}e&f\\g&h\end{pmatrix} \\ 
    0 &
   \begin{pmatrix}i&j\\k&l\end{pmatrix} 
\end{pmatrix}

and

\det
  \begin{vmatrix} 
     c_0 & c_1 & c_2 & \ldots & c_n \\ 
     c_1 & c_2 & c_3 & \ldots & c_{n+1} \\ 
     c_2 & c_3 & c_4 & \ldots & c_{n+2} \\
     \vdots & \vdots & \vdots & & \vdots \\ 
     c_n & c_{n+1} & c_{n+2} & \ldots & c_{2n} 
  \end{vmatrix}>0

What happens?:

image.png (384×476 px, 25 KB)

What should have happened instead?:

Rendered by Client Side MathJax

image.png (432×531 px, 32 KB)

Rendered in LaTeX

image.png (405×528 px, 23 KB)

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

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

Chrome: 129

Cause seems to be the padding around <mtd> elements.

image.png (367×481 px, 26 KB)

the <mtd> padding rule highlighted in Developer Tools.
User agent style sheet rules are:

mtd {
    display: table-cell;
    text-align: -webkit-center;
    padding: 0.5ex 0.4em;
}

A problem we may not be able to do anything about.

Event Timeline

SVG mode is also generous with space

image.png (454×566 px, 39 KB)

This is similar to T375340

I am uncertain what to do here. Do you, by chance, know what the generated MathML should look like to improve the situation?

SVG mode is also generous with space

image.png (454×566 px, 39 KB)

Ok. To me, it looks similar. Fine-tuning can be done with CSS. If one has a CSS in a wiki that should be the template for all other wikis, we could file a new task for that.