mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 05:58:40 +00:00
unicodeTextInMathMode setting (#1117)
* unicodeTextInMathMode setting * When `unicodeTextInMathMode` is `true`, accented letters from `unicodeSymbols.js`, and CJK and other supported languages, get added support in math mode (as requested in #895). * When `unicodeTextInMathMode` is `false, all of these stop working in math mode, and are only supported in text mode (matching XeTeX behavior). Note that this is a backwards incompatibility with some 0.9.0 alpha/betas. * Fix handling of Unicode characters ð, Å, å * Fix double handling of ð (math maps to \eth, not special Unicode character) * Remove Åå special math handling, thanks to #1125 * Forbid extraLatin when unicodeTextInMathMode is false
This commit is contained in:
committed by
Kevin Barabash
parent
7de91f73eb
commit
aed1c1e564
@@ -14,6 +14,7 @@ export type SettingsOptions = {
|
||||
errorColor?: string;
|
||||
macros?: MacroMap;
|
||||
colorIsTextColor?: boolean;
|
||||
unicodeTextInMathMode?: boolean;
|
||||
maxSize?: number;
|
||||
};
|
||||
|
||||
@@ -33,6 +34,7 @@ class Settings {
|
||||
errorColor: string;
|
||||
macros: MacroMap;
|
||||
colorIsTextColor: boolean;
|
||||
unicodeTextInMathMode: boolean;
|
||||
maxSize: number;
|
||||
|
||||
constructor(options: SettingsOptions) {
|
||||
@@ -43,6 +45,8 @@ class Settings {
|
||||
this.errorColor = utils.deflt(options.errorColor, "#cc0000");
|
||||
this.macros = options.macros || {};
|
||||
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false);
|
||||
this.unicodeTextInMathMode =
|
||||
utils.deflt(options.unicodeTextInMathMode, false);
|
||||
this.maxSize = Math.max(0, utils.deflt(options.maxSize, Infinity));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user