Add support for \mathring (#1125)

Fix #1124. \mathring is the math-mode equivalent to the \r accent.
Support follows from a rather trivial symbol aliasing,
plus (for Unicode support) listing it in `unicodeAccents.js`.
This commit is contained in:
Erik Demaine
2018-01-31 19:48:23 -05:00
committed by Kevin Barabash
parent 58c4c7c4a4
commit 684df05a86
3 changed files with 4 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ const mathmlBuilder = (group, options) => {
const NON_STRETCHY_ACCENT_REGEX = new RegExp([
"\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
"\\check", "\\hat", "\\vec", "\\dot",
"\\check", "\\hat", "\\vec", "\\dot", "\\mathring",
].map(accent => `\\${accent}`).join("|"));
// Accents
@@ -182,7 +182,7 @@ defineFunction({
type: "accent",
names: [
"\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
"\\check", "\\hat", "\\vec", "\\dot",
"\\check", "\\hat", "\\vec", "\\dot", "\\mathring",
"\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow",
"\\Overrightarrow", "\\overleftrightarrow", "\\overgroup",
"\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon",

View File

@@ -646,6 +646,7 @@ defineSymbol(math, main, accent, "\u02c7", "\\check");
defineSymbol(math, main, accent, "\u005e", "\\hat");
defineSymbol(math, main, accent, "\u20d7", "\\vec");
defineSymbol(math, main, accent, "\u02d9", "\\dot");
defineSymbol(math, main, accent, "\u02da", "\\mathring");
defineSymbol(math, main, mathord, "\u0131", "\\imath", true);
defineSymbol(math, main, mathord, "\u0237", "\\jmath", true);
defineSymbol(text, main, textord, "\u0131", "\\i", true);

View File

@@ -13,6 +13,6 @@ module.exports = {
'\u030c': {text: '\\v', math: '\\check'},
'\u0302': {text: '\\^', math: '\\hat'},
'\u0307': {text: '\\.', math: '\\dot'},
'\u030a': {text: '\\r'},
'\u030a': {text: '\\r', math: '\\mathring'},
'\u030b': {text: '\\H'},
};