mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 12:18:39 +00:00
Merge pull request #317 from JeffEverett/unsupported_commands
Added support for visual depiction of unsupported commands
This commit is contained in:
BIN
test/screenshotter/images/UnsupportedCmds-chrome.png
Normal file
BIN
test/screenshotter/images/UnsupportedCmds-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
test/screenshotter/images/UnsupportedCmds-firefox.png
Normal file
BIN
test/screenshotter/images/UnsupportedCmds-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@@ -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"
|
||||
}
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user