-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement \neq and \notin via macros like LaTeX's #1400
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1400 +/- ##
==========================================
+ Coverage 82.33% 82.33% +<.01%
==========================================
Files 77 77
Lines 4239 4241 +2
Branches 731 731
==========================================
+ Hits 3490 3492 +2
Misses 647 647
Partials 102 102
Continue to review full report at Codecov.
|
I think this is a move in the right direction. I'm confused though why the slant of the slash is different in |
defineMacro("\\neq", "\\not="); | ||
defineMacro("\\ne", "\\neq"); | ||
defineMacro("\u2260", "\\neq"); | ||
defineMacro("\\notin", "\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the /
be a \not
? It seems weird to use a different glyph for \notin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinbarabash If I remember correctly, \notin
was created shortly before \not
was available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what LaTeX does; see the definition in comments. I believe it's a conscious decision because the \in
glyph is relatively narrow. So I think we should follow suit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They seem visually very close to LaTeX's; here's a texcmp for the tweaked Not test (only third line is new):
SGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...unless there's another LaTeX package that redefines \notin
differently? I know AMS doesn't redefine it. I'm on a phone so can't easily check symbols-a4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a rather large variety of \notin
symbols listed in symbols-a4, from packages fdsymbol
, stix
, txfonts
, mathabx
, MnSymbol
.
Not sure what to make of all this. I guess I lean toward matching LaTeX's default behavior, but I'm also happy to design a \not
-based macro if that's the preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd lean towards LaTeX
's default behaviour as well.
For what it's worth, here is the MathML from (1) font-based
|
@ronkok Yes, this is a downside to the macro approach in general. I was thinking we could fix all of these with a |
Now that would be cool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for posting a texcmp screenshot.
As discussed in KaTeX/katex-fonts#47 (comment), I simplified LaTeX's definitions of
\neq
and\notin
into KaTeX macros.They seem visually very close to LaTeX's; here's a texcmp for the tweaked
Not
test (only third line is new):I assume this will remain true after #1267 but it would be good to test.
This PR removes the need for the
\neq
and\notin
symbols from the fonts, so it would fix KaTeX/katex-fonts#47The new
\neq
should be essentially the same as the font-based one. Here is a comparison of the new\notin
symbol (top) vs. the old\notin
symbol (bottom):