mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
add \ae, \AE, \oe, \OE, \o, \O, \ss with unicode support for those characters in text mode (#1030)
This commit is contained in:
@@ -64,6 +64,13 @@ $map{cmr10} = {
|
||||
0x7E => [0x303,-500,0], # \tilde (combining)
|
||||
0x7F => 0xA8, # \ddot
|
||||
0x7F => [0x308,-500,0], # \ddot (combining)
|
||||
0x19 => 0xDF, # sharp S
|
||||
0x1A => 0xE6, # ae ligature
|
||||
0x1B => 0x153, # oe ligature
|
||||
0x1C => 0xF8, # o with slash
|
||||
0x1D => 0xC6, # AE ligature
|
||||
0x1E => 0x152, # OE ligature
|
||||
0x1F => 0xD8, # O with slash
|
||||
],
|
||||
};
|
||||
|
||||
|
@@ -103,7 +103,6 @@ const extraCharacterMap = {
|
||||
'Ã': 'A',
|
||||
'Ä': 'A',
|
||||
'Å': 'A',
|
||||
'Æ': 'A',
|
||||
'Ç': 'C',
|
||||
'È': 'E',
|
||||
'É': 'E',
|
||||
@@ -120,21 +119,18 @@ const extraCharacterMap = {
|
||||
'Ô': 'O',
|
||||
'Õ': 'O',
|
||||
'Ö': 'O',
|
||||
'Ø': 'O',
|
||||
'Ù': 'U',
|
||||
'Ú': 'U',
|
||||
'Û': 'U',
|
||||
'Ü': 'U',
|
||||
'Ý': 'Y',
|
||||
'Þ': 'o',
|
||||
'ß': 'B',
|
||||
'à': 'a',
|
||||
'á': 'a',
|
||||
'â': 'a',
|
||||
'ã': 'a',
|
||||
'ä': 'a',
|
||||
'å': 'a',
|
||||
'æ': 'a',
|
||||
'ç': 'c',
|
||||
'è': 'e',
|
||||
'é': 'e',
|
||||
@@ -151,7 +147,6 @@ const extraCharacterMap = {
|
||||
'ô': 'o',
|
||||
'õ': 'o',
|
||||
'ö': 'o',
|
||||
'ø': 'o',
|
||||
'ù': 'u',
|
||||
'ú': 'u',
|
||||
'û': 'u',
|
||||
|
@@ -865,9 +865,16 @@ module.exports = {
|
||||
"176": [0, 0.69444, 0, 0],
|
||||
"177": [0.08333, 0.58333, 0, 0],
|
||||
"180": [0, 0.69444, 0, 0],
|
||||
"198": [0, 0.68333, 0, 0],
|
||||
"215": [0.08333, 0.58333, 0, 0],
|
||||
"216": [0.04861, 0.73194, 0, 0],
|
||||
"223": [0, 0.69444, 0, 0],
|
||||
"230": [0, 0.43056, 0, 0],
|
||||
"247": [0.08333, 0.58333, 0, 0],
|
||||
"248": [0.09722, 0.52778, 0, 0],
|
||||
"305": [0, 0.43056, 0, 0],
|
||||
"338": [0, 0.68333, 0, 0],
|
||||
"339": [0, 0.43056, 0, 0],
|
||||
"567": [0.19444, 0.43056, 0, 0],
|
||||
"710": [0, 0.69444, 0, 0],
|
||||
"711": [0, 0.62847, 0, 0],
|
||||
|
@@ -648,6 +648,14 @@ defineSymbol(math, main, mathord, "\u0131", "\\imath");
|
||||
defineSymbol(math, main, mathord, "\u0237", "\\jmath");
|
||||
defineSymbol(text, main, textord, "\u0131", "\\i");
|
||||
defineSymbol(text, main, textord, "\u0237", "\\j");
|
||||
defineSymbol(text, main, textord, "\u00df", "\\ss", true);
|
||||
defineSymbol(text, main, textord, "\u00e6", "\\ae", true);
|
||||
defineSymbol(text, main, textord, "\u00e6", "\\ae", true);
|
||||
defineSymbol(text, main, textord, "\u0153", "\\oe", true);
|
||||
defineSymbol(text, main, textord, "\u00f8", "\\o", true);
|
||||
defineSymbol(text, main, textord, "\u00c6", "\\AE", true);
|
||||
defineSymbol(text, main, textord, "\u0152", "\\OE", true);
|
||||
defineSymbol(text, main, textord, "\u00d8", "\\O", true);
|
||||
defineSymbol(text, main, accent, "\u02ca", "\\'"); // acute
|
||||
defineSymbol(text, main, accent, "\u02cb", "\\`"); // grave
|
||||
defineSymbol(text, main, accent, "\u02c6", "\\^"); // circumflex
|
||||
|
@@ -2843,4 +2843,10 @@ describe("Symbols", function() {
|
||||
it("should parse \\text{\\i\\j}", () => {
|
||||
expect("\\text{\\i\\j}").toParse();
|
||||
});
|
||||
|
||||
it("should render ligature commands like their unicode characters", () => {
|
||||
const commands = getBuilt("\\text{\\ae\\AE\\oe\\OE\\o\\O\\ss}");
|
||||
const unicode = getBuilt("\\text{æÆœŒøØß}");
|
||||
expect(commands).toEqual(unicode);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user