43 lines
1.2 KiB
HTML
43 lines
1.2 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Huxley test</title>
|
|
<script src="/katex.js" type="text/javascript"></script>
|
|
<link href="/katex.css" rel="stylesheet" type="text/css">
|
|
<style type="text/css">
|
|
#math, #pre, #post {
|
|
font-size: 4em;
|
|
}
|
|
body {
|
|
font-family: "DejaVu Serif",serif;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<span id="pre"></span>
|
|
<span id="math"></span>
|
|
<span id="post"></span>
|
|
<script type="text/javascript">
|
|
var query = {};
|
|
var re = /(?:^\?|&)([^&=]+)(?:=([^&]+))?/g;
|
|
var match;
|
|
while (match = re.exec(window.location.search)) {
|
|
query[match[1]] = decodeURIComponent(match[2]);
|
|
}
|
|
var mathNode = document.getElementById("math");
|
|
|
|
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>
|
|
</body>
|
|
</html>
|