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 (\ne) sign doesn't render correctly the slash sign #2109

Closed
henrroga opened this issue Oct 4, 2019 · 6 comments
Closed

Not equal (\ne) sign doesn't render correctly the slash sign #2109

henrroga opened this issue Oct 4, 2019 · 6 comments

Comments

@henrroga
Copy link

henrroga commented Oct 4, 2019

It seems the slash sign on top of the equal sign is broken.

I have the latest version of Katex in my project. Below is a screenshot taken in the latest version of Firefox. Also in Chrome is the same thing.

Screenshot_2019-10-04 Ushtrimi 5 - Mësimi 2G - Matematika 12 Sputnik

@henrroga henrroga added the bug label Oct 4, 2019
@edemaine
Copy link
Member

edemaine commented Oct 4, 2019

If you go to the demo on katex.org, do you see the same thing? I see:

image

It looks like you either aren't including the font files, or they're getting overridden in the CSS. Note in particular how the numbers look very different. If you send a complete working example, we can try to help.

@henrroga
Copy link
Author

henrroga commented Oct 4, 2019

True, the font is overriden with a Google Font. Now that I removed it it's okay, but I have to use my font of choice. Everything else with math expressions seems fine with this font (and other; I also tried Roboto), but this equal sign is the only thing until now that I have found to render incorrectly. Anything else I can do?

@edemaine
Copy link
Member

edemaine commented Oct 4, 2019

KaTeX doesn't really support font overriding, I'm afraid. I'm not sure if it's currently possible to override just numbers and letters and avoid overriding symbols, but that's the behavior you'd want...

@edemaine
Copy link
Member

edemaine commented Oct 4, 2019

You could also try redefining the behavior of \neq to instead do \mathrel{\char`≠} which produces a literal not-equal character which should work in other fonts. You can do this easily via the macros functionality, or via a \def.

@henrroga
Copy link
Author

henrroga commented Oct 4, 2019

I see. Great, thank you so much!

@tony
Copy link

tony commented Aug 3, 2022

re: workaround from @edemaine, thank you!

macros looks like this for me:

katex.render(
  text,
  element,
  {
    macros: {
      '\\neq': '\\mathrel{\\char`≠}',
    },
  },
)

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