mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Adds math commands, HTML rendering, and screenshotter tests.
This is part 2 of 3. Part 1 added new fonts metrics. Part 2 will add MathML support and unit tests.
This commit is contained in:
committed by
Kevin Barabash
parent
f32d615813
commit
fd2d58fd80
@@ -215,6 +215,12 @@ var delimiters = [
|
||||
"."
|
||||
];
|
||||
|
||||
var fontAliases = {
|
||||
"\\Bbb": "\\mathbb",
|
||||
"\\bold": "\\mathbf",
|
||||
"\\frak": "\\mathfrak"
|
||||
};
|
||||
|
||||
/*
|
||||
* This is a list of functions which each have the same function but have
|
||||
* different names so that we don't have to duplicate the data a bunch of times.
|
||||
@@ -476,6 +482,33 @@ var duplicatedFunctions = [
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
funcs: [
|
||||
// styles
|
||||
"\\mathrm", "\\mathit", "\\mathbf",
|
||||
|
||||
// families
|
||||
"\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",
|
||||
"\\mathtt",
|
||||
|
||||
// aliases
|
||||
"\\Bbb", "\\bold", "\\frak"
|
||||
],
|
||||
data: {
|
||||
numArgs: 1,
|
||||
handler: function (func, body) {
|
||||
if (func in fontAliases) {
|
||||
func = fontAliases[func];
|
||||
}
|
||||
return {
|
||||
type: "font",
|
||||
font: func.slice(1),
|
||||
body: body
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Accents
|
||||
{
|
||||
funcs: [
|
||||
|
Reference in New Issue
Block a user