From b148d5da71363278b771661ffd4c399498863aed Mon Sep 17 00:00:00 2001 From: Ron Kok Date: Sat, 10 Mar 2018 10:19:13 -0800 Subject: [PATCH] =?UTF-8?q?Support=20Unicode=20=C2=B0=20(#1203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oddly, `unicode-math-table.txt` does not contain an entry for U+00B0. But `\degree` is surely the correct mapping. --- src/symbols.js | 5 ++++- test/katex-spec.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/symbols.js b/src/symbols.js index 1700dc7a..dc93abe2 100644 --- a/src/symbols.js +++ b/src/symbols.js @@ -696,8 +696,11 @@ defineSymbol(text, main, textord, "\u201c", "``"); defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft"); defineSymbol(text, main, textord, "\u201d", "''"); defineSymbol(text, main, textord, "\u201d", "\\textquotedblright"); -defineSymbol(math, main, textord, "\u00b0", "\\degree"); +// \degree from gensymb package +defineSymbol(math, main, textord, "\u00b0", "\\degree", true); defineSymbol(text, main, textord, "\u00b0", "\\degree"); +// \textdegree from inputenc package +defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true); // TODO: In LaTeX, \pounds can generate a different character in text and math // mode, but among our fonts, only Main-Italic defines this character "163". defineSymbol(math, main, mathord, "\u00a3", "\\pounds"); diff --git a/test/katex-spec.js b/test/katex-spec.js index b490c13b..d5214e62 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -2936,7 +2936,7 @@ describe("Unicode", function() { }); it("should parse symbols", function() { - expect("£¥ðℂℍℑℓℕ℘ℙℚℜℝℤℲℵℶℷℸ⅁∀∁∂∃∇∞∠∡∢♠♡♢♣♭♮♯✓\u00b7").toParse(); + expect("£¥ðℂℍℑℓℕ℘ℙℚℜℝℤℲℵℶℷℸ⅁∀∁∂∃∇∞∠∡∢♠♡♢♣♭♮♯✓°\u00b7").toParse(); }); it("should parse arrows", function() {