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

"not equal sign" didn't render properly #16

Open
azophy opened this issue Mar 8, 2020 · 6 comments
Open

"not equal sign" didn't render properly #16

azophy opened this issue Mar 8, 2020 · 6 comments

Comments

@azophy
Copy link

azophy commented Mar 8, 2020

When I tried to write \ne in latex format or != in asciimath format, the strike in the equal sign was misaligned. This happen even on the demo page on https://obedm503.github.io/showdown-katex/#sandbox

2020-03-08_55

@obedm503
Copy link
Owner

obedm503 commented Mar 9, 2020

I've confirmed this is an issue. I tried quickly figuring out what may be causing it, but have not been able to. It seems to be related to KaTeX/KaTeX#1842. Any help is appreciated.

Until this issue is fixed, you can use \cancel{=} instead (even in asciimath blocks).

What browser and OS are you using?

@lriuui0x0
Copy link

It's interesting that if we use renderMathInElement from katex directly, this error doesn't seem to occur.

@obedm503
Copy link
Owner

@lriuui0x0 can you provide some more details? you mentioned using renderMathInElement directly, but this package already uses renderMathInElement

I've been looking into this issue without much success. how did you get renderMathInElement to work?

@lriuui0x0
Copy link

lriuui0x0 commented Mar 24, 2020

@obedm503 Yep I had code like below to render maths. code.math is the class that's assigned when you do ```math with showdown.

Array.from(text_root.querySelectorAll('code.math')).forEach(code => {
    let p = document.createElement('p');
    katex_html = katex.renderToString(code.innerText, {
        displayMode: true,
        throwOnError: false,
    });
    p.innerHTML = katex_html;
    code.replaceWith(p);
});
renderMathInElement(text_root, {
    throwOnError: false,
    delimiters: [
        {left: "$", right: "$", display: false},
    ]
});

@obedm503
Copy link
Owner

what version of katex are you using?

@lriuui0x0
Copy link

lriuui0x0 commented Mar 25, 2020

@obedm503 Latest. I'm using <script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script>

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

No branches or pull requests

3 participants