diff --git a/src/macros.js b/src/macros.js index d79b9b1e..c331daad 100644 --- a/src/macros.js +++ b/src/macros.js @@ -223,6 +223,17 @@ defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); +// Negated symbols from base/fontmath.ltx: +// \def\neq{\not=} \let\ne=\neq +// \DeclareRobustCommand +// \notin{\mathrel{\m@th\mathpalette\c@ncel\in}} +// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}} +defineMacro("\\neq", "\\not="); +defineMacro("\\ne", "\\neq"); +defineMacro("\u2260", "\\neq"); +defineMacro("\\notin", "\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}"); +defineMacro("\u2209", "\\notin"); + // Unicode stacked relations defineMacro("\u2258", "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}"); diff --git a/src/symbols.js b/src/symbols.js index cac8db0a..c8bb9581 100644 --- a/src/symbols.js +++ b/src/symbols.js @@ -552,7 +552,6 @@ defineSymbol(math, main, rel, "\u2265", "\\geq", true); defineSymbol(math, main, rel, "\u2190", "\\gets"); defineSymbol(math, main, rel, ">", "\\gt"); defineSymbol(math, main, rel, "\u2208", "\\in", true); -defineSymbol(math, main, rel, "\u2209", "\\notin", true); defineSymbol(math, main, rel, "\u0338", "\\not"); defineSymbol(math, main, rel, "\u2282", "\\subset", true); defineSymbol(math, main, rel, "\u2283", "\\supset", true); @@ -565,8 +564,6 @@ defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true); defineSymbol(math, main, rel, "\u2264", "\\le"); defineSymbol(math, main, rel, "\u2264", "\\leq", true); defineSymbol(math, main, rel, "<", "\\lt"); -defineSymbol(math, main, rel, "\u2260", "\\ne", true); -defineSymbol(math, main, rel, "\u2260", "\\neq"); defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true); defineSymbol(math, main, rel, "\u2192", "\\to"); defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true); diff --git a/test/katex-spec.js b/test/katex-spec.js index 07c9acb9..a849e9f0 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -1404,13 +1404,12 @@ describe("A font parser", function() { expect(nestedParse.value.font).toEqual("mathbb"); expect(nestedParse.value.type).toEqual("font"); - expect(nestedParse.value.body.value.length).toEqual(3); + expect(nestedParse.value.body.value.length).toEqual(4); const bbBody = nestedParse.value.body.value; expect(bbBody[0].type).toEqual("mathord"); - expect(bbBody[1].type).toEqual("rel"); - expect(bbBody[2].type).toEqual("font"); - expect(bbBody[2].value.font).toEqual("mathrm"); - expect(bbBody[2].value.type).toEqual("font"); + expect(bbBody[3].type).toEqual("font"); + expect(bbBody[3].value.font).toEqual("mathrm"); + expect(bbBody[3].value.type).toEqual("font"); }); it("should work with \\textcolor", function() { diff --git a/test/screenshotter/images/Not-chrome.png b/test/screenshotter/images/Not-chrome.png index df3d0d41..9b587107 100644 Binary files a/test/screenshotter/images/Not-chrome.png and b/test/screenshotter/images/Not-chrome.png differ diff --git a/test/screenshotter/images/Not-firefox.png b/test/screenshotter/images/Not-firefox.png index 1460d504..9a639c75 100644 Binary files a/test/screenshotter/images/Not-firefox.png and b/test/screenshotter/images/Not-firefox.png differ diff --git a/test/screenshotter/ss_data.yaml b/test/screenshotter/ss_data.yaml index 01dcb8fa..7b83c2bf 100644 --- a/test/screenshotter/ss_data.yaml +++ b/test/screenshotter/ss_data.yaml @@ -224,7 +224,8 @@ NewLine: | Not: | \begin{array}{l} \not=\not>\not\geq\not\in\not<\not\leq\not{abc} \\ - \not xy + ab \not xy + \not xy + ab \not xy \\ + a \neq b \notin c \end{array} NullDelimiterInteraction: a \bigl. + 2 \quad \left. + a \right) OldFont: |