GithubHelp home page GithubHelp logo

Rendering bug about asciimathml HOT 6 OPEN

asciimath avatar asciimath commented on May 3, 2024
Rendering bug

from asciimathml.

Comments (6)

pkra avatar pkra commented on May 3, 2024

Not quite a rendering but rather a conversion issue -- the generated MathML is

    <math>
      <mstyle mathcolor="blue" fontfamily="serif" displaystyle="true">
        <mrow>
          <mo>{</mo>
          <mi>w</mi>
          <mrow>
            <mo>|</mo>
            <mi>w</mi>
            <mo>&isin;</mo>
            <msup>
              <mrow>
                <mo>{</mo>
                <mi>a</mi>
                <mo>,</mo>
                <mi>b</mi>
                <mo>}</mo>
              </mrow>
              <mo>+</mo>
            </msup>
            <mo>,</mo>
            <mo>|</mo>
          </mrow>
          <mi>w</mi>
          <mrow>
            <mo>|</mo>

            <mo>_</mo>

            <mi>a</mi>
            <mo>=</mo>
            <mo>|</mo>
          </mrow>
          <mi>w</mi>
          <msub>
            <mrow>
              <mo>|</mo>
            </mrow>
            <mi>b</mi>
          </msub>
          <mo>}</mo>
        </mrow>
      </mstyle>
    </math>

which seems wrong. The matching of the | seems to be the problem.

from asciimathml.

dpvc avatar dpvc commented on May 3, 2024

Peter is right, the problem is that AsciiMath matches the | that you are using as "such that" with the first one for the absolute values.

One way to prevent that is to put the initial | into invisible delimiters, so that it won't match anything. E.g.

{w {:|:} w in {a, b}^+, |w|_a = |w|_b}

from asciimathml.

drlippman avatar drlippman commented on May 3, 2024

Yeah, sadly the absolute value / "such that" handling in AsciiMath is a bit ambiguous, due to the ambiguous nature of the notation itself.  I've been thinking about it off and on for years, and I still haven't come up with any ideas for how to better parse an expression like that.

Recently we added functionality that causes abs(x) to be rendered as |x|, and that provides a way to avoid the mismatched symbol issue.  But that change hasn't made it into MathJax yet.

from asciimathml.

pkra avatar pkra commented on May 3, 2024

@drlippman you wrote

Recently we added functionality that causes abs(x) to be rendered as |x|, and that provides a way to avoid the mismatched symbol issue. But that change hasn't made it into MathJax yet.

Ah! When did that happen? We should think about a workflow to pull in such updates. Darn, we could have done that with 2.4 recently...

from asciimathml.

drlippman avatar drlippman commented on May 3, 2024

It happened in March.  Peter made several changes.  There are a couple others I still haven't gotten around to committing. Hopefully we can figure a process and get them into 2.5 :)

from asciimathml.

pkra avatar pkra commented on May 3, 2024

Thanks, @drlippman . I've created an issue on MathJax's issue tracker to keep track of this. Moving forward, it might make sense to add release tags to this repository and simply post an issue on our thread with each release. It would also be very helpful to add tests to the MathJax test suite for new features and bug fixes.

from asciimathml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.