Mathpix / mathpix-markdown-it

Markdown rendering + Latex extras (equations, tables, ...), with conversion features, for the scientific community
MIT License
539 stars 45 forks source link

PR into master from dev/olga/mathjax-3-2-2 #337

Closed OlgaRedozubova closed 3 months ago

OlgaRedozubova commented 4 months ago

branch: dev/olga/mathjax-3-2-2

Updated mathjax-full@3.2.2

Fixes:

  1. [mmd] MathJax@3.0.1 the location of n-th root numbers is weird #10155
  2. [mmd] Update MathJax to v 3.2 #8385
  3. [mmd-converter] Export to DOCX #10156
  4. Fixed Underline using html tag "\<u>" does not support? #336
  5. Added cases MathJax package to support numcases.
  6. Set version 2.0.0

Latex: $\sqrt[4]{3 \cdot 3 \cdot 3 \cdot 3}=?$

Before:

Screenshot 2024-07-30 at 11 42 57

After:

Screenshot 2024-07-30 at 11 43 15

3. [mmd-converter] Export to DOCX #10156

mmd:

$$
\begin{aligned}
& R=\frac{\overline{i_g^2} g_m}{4 k T_0 \Delta f\left(\omega C_{g s}\right)^2} \\
& P=\frac{\overline{i_d^2}}{4 k T_0 g_m P \Delta f} \\
& \overline{i_g i_d^*}=\rho \sqrt{R P} 4 k T_0 \Delta f \omega C_{g s} \\
& \rho=\frac{\overline{i_g i_d^*}}{\sqrt{\overline{i_g^2} \cdot \overline{i_d^2}}}=j C
\end{aligned}
$$
Screenshot 2024-08-06 at 10 48 50

Copying with Math ML (MS Wrod):

Before:

Screenshot 2024-08-06 at 10 51 12

After:

Screenshot 2024-08-06 at 10 50 24

mmd:

$$
C_Y^{i n t}=\left[\begin{array}{cc}
\overline{i_g^2} & \overline{i_g i_d^*} \\
\overline{i_g^* i_d} & \overline{i_d^2}
\end{array}\right]
$$
Screenshot 2024-08-06 at 10 52 27

Copying with Math ML (MS Wrod):

Before:

Screenshot 2024-08-06 at 10 53 39

After:

Screenshot 2024-08-06 at 10 53 08

4. Fixed Underline using html tag "" does not support? #336

Screenshot 2024-08-07 at 10 56 05

5. Added cases MathJax package to support numcases environment.

Screenshot 2024-08-07 at 10 59 26
OlgaRedozubova commented 3 months ago

Do we have any breaking changes that we need to document @OlgaRedozubova ?

  • The internal mmd tree of MathJax has changed a little. This affected the export to asciimath and DOCX I'll prepare a description here.
OlgaRedozubova commented 3 months ago

The main changes in the internal tree in the updated version of MathJax@3.2.2:

  1. <mtr> tag for aligned, align*, align. The columnalign attribute now has the value "right left" instead of "right left right left right left right left right left right left".
  2. \operatorname{} - added grouping to <mrow data-mjx-texclass="OP"> $a \operatorname { m o d } b$ Before:
    <math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>a</mi>
    <mi data-mjx-texclass="OP">m o d</mi>
    <mo data-mjx-texclass="NONE">⁡</mo>
    <mi>b</mi>
    </math>

    After:

    <math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>a</mi>
    <mrow data-mjx-texclass="OP">
    <mi mathvariant="normal">m</mi>
    <mi mathvariant="normal">o</mi>
    <mi mathvariant="normal">d</mi>
    </mrow>
    <mi>b</mi>
    </math>
  3. Used instead of $\|$ <mo data-mjx-texclass="ORD" fence="false" stretchy="false">‖</mo> instead of <mo data-mjx-texclass="ORD">∥</mo>
  4. \begin{array} { c } 3 \frac { 1 } { 6 } \\ 3 \\\hline \end{array} <menclose notation="bottom"> instead of <menclose notation="bottom" isframe="true">
  5. $\overline{xyz}$ <mo accent="true">―</mo> instead of <mo accent="false">¯</mo>

With these changes in mind, changes have been made to the asciimath and mathml for word exports so that they do not break output and tests.