Merge pull request #317 from JeffEverett/unsupported_commands

Added support for visual depiction of unsupported commands
This commit is contained in:
Kevin Barabash
2015-07-29 10:55:04 -07:00
9 changed files with 152 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -38,5 +38,6 @@
"SupSubHorizSpacing": "http://localhost:7936/test/screenshotter/test.html?m=x^{x^{x}}\\Big|x_{x_{x_{x_{x}}}}\\bigg|x^{x^{x_{x_{x_{x_{x}}}}}}\\bigg|",
"SupSubOffsets": "http://localhost:7936/test/screenshotter/test.html?m=\\displaystyle \\int_{2+3}x f^{2+3}+3\\lim_{2+3+4+5}f",
"Text": "http://localhost:7936/test/screenshotter/test.html?m=\\frac{a}{b}\\text{c~ {ab} \\ e}+fg",
"UnsupportedCmds": "http://localhost:7936/test/screenshotter/test.html?m=\\err\\,\\frac\\fracerr3\\,2^\\superr_\\suberr\\,\\sqrt\\sqrterr&doNotBreak=1&errorColor=%23dd4c4c",
"VerticalSpacing": "http://localhost:7936/test/screenshotter/test.html?pre=potato<br>blah&post=<br>moo&m=x^{\\Huge y}z"
}

View File

@@ -25,9 +25,16 @@
query[match[1]] = decodeURIComponent(match[2]);
}
var mathNode = document.getElementById("math");
katex.render(query["m"], mathNode, {
displayMode: !!query["display"]
});
var settings = {
displayMode: !!query["display"],
breakOnUnsupportedCmds: !query["doNotBreak"]
};
if (query["errorColor"]) {
settings.errorColor = query["errorColor"];
}
katex.render(query["m"], mathNode, settings);
document.getElementById("pre").innerHTML = query["pre"] || "";
document.getElementById("post").innerHTML = query["post"] || "";
</script>