Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The output latex is getting   and commas. #31

Open
devraj112 opened this issue Nov 15, 2024 · 2 comments
Open

The output latex is getting   and commas. #31

devraj112 opened this issue Nov 15, 2024 · 2 comments

Comments

@devraj112
Copy link

devraj112 commented Nov 15, 2024

Adding unnecessary &nbsb; and comma(",") while rendering longer math equations.

Example 1:
mathml:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <msub>
      <mi>C</mi>
      <mrow>
        <mtext>Component&nbsp;</mtext>
        <mi>j</mi>
      </mrow>
    </msub>
    <mo>=</mo>
    <mfenced close=")" open="(" separators="">
      <munderover>
        <mstyle displaystyle="true" mathsize="140%">
          <mo>∑</mo>
        </mstyle>
        <mrow>
          <mi>i</mi>
          <mo>=</mo>
          <mn>1</mn>
        </mrow>
        <mi>n</mi>
      </munderover>
      <mspace width="0.167em"></mspace>
      <mspace width="0.167em"></mspace>
      <msub>
        <mi>x</mi>
        <mi>i</mi>
      </msub>
    </mfenced>
    <mo>*</mo>
    <mi>C</mi>
    <mi>f</mi>
    <mo>;</mo>
    <mtext>&nbsp;</mtext>
    <mn>1</mn>
    <mo>≥</mo>
    <msub>
      <mi>x</mi>
      <mi>i</mi>
    </msub>
    <mo>≥</mo>
    <mn>5</mn>
    <mo>;</mo>
    <mo>∀</mo>
    <mi>i</mi>
  </mrow>
</math>

Expectation:

big euation

codepen:
bigeqn1output

Output:
output

Example 2:
mathml:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <msub>
      <mi>A</mi>
      <mrow>
        <mi>i</mi>
        <mi>j</mi>
      </mrow>
    </msub>
    <mo>=</mo>
    <mfenced close="}" open="{" separators="">
      <mtable columnalign="rightright" class="matrix">
        <mtr>
          <mtd>
            <mn>1</mn>
          </mtd>
          <mtd>
            <mo>∀</mo>
            <mfenced close="]" open="[" separators="">
              <mfenced close=")" open="(" separators="">
                <mi>i</mi>
                <mo>,</mo>
                <mi>j</mi>
              </mfenced>
              <mo>∣</mo>
              <mfenced close=")" open="(" separators="">
                <mi>i</mi>
                <mo>≠</mo>
                <mi>j</mi>
              </mfenced>
              <mtext></mtext>
              <mi>a</mi>
              <mi>n</mi>
              <mi>d</mi>
              <mi></mi>
              <mspace width="0.2em" />
              <mfenced close=")" open="(" separators="">
                <mi>i</mi>
                <mo>,</mo>
                <mi>j</mi>
              </mfenced>
              <mo>∈</mo>
              <mi>A</mi>
            </mfenced>
          </mtd>
        </mtr>
        <mtr>
          <mtd>
            <mn>0</mn>
          </mtd>
          <mtd>
            <mtext></mtext>
            <mi>o</mi>
            <mi>t</mi>
            <mi>h</mi>
            <mi>e</mi>
            <mi>r</mi>
            <mi>w</mi>
            <mi>i</mi>
            <mi>s</mi>
            <mi>e</mi>
            <mtext></mtext>
          </mtd>
        </mtr>
      </mtable>
    </mfenced>
  </mrow>
</math>

bigEqn2

codepen:
outputbigEqn2

renderedOutputeqn2

I have updated to the latest version.
Version: "mathml-to-latex": "^1.4.2",

@devraj112
Copy link
Author

Any leads would be helpful. @asnunes

Thanks.

@devraj112 devraj112 changed the title Adding unnecessary &nbsp; and commas. The output latex is getting &nbsp; and commas. Nov 29, 2024
@devraj112
Copy link
Author

#32 I have updated the issue in details as a new issue. If required you can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant