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:
Kevin Barabash
2015-07-04 15:28:18 -06:00
committed by Kevin Barabash
parent f32d615813
commit fd2d58fd80
18 changed files with 338 additions and 34 deletions

View File

@@ -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: [