123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!doctype html>
- <html>
- <head>
- <title>Screenshotter test</title>
- <script src="../../katex.js" type="text/javascript"></script>
- <style type="text/css">
- #math, #pre, #post {
- font-size: 4em;
- }
- body {
- font-family: "DejaVu Serif",serif;
- }
- @font-face {
- font-family: "Mincho";
- src: url("/submodules/katex-test-fonts/mincho/font_1_honokamin.ttf") format("truetype");
- }
- @font-face {
- font-family: "Batang";
- src: url("/submodules/katex-test-fonts/batang/batang.ttf") format("truetype");
- }
- .katex .cjk_fallback {
- font-family: "Mincho",serif;
- }
- .katex .hangul_fallback {
- font-family: "Batang",serif;
- }
- </style>
- </head>
- <body>
- <span id="pre"></span>
- <span id="math"></span>
- <span id="post"></span>
- <script type="text/javascript">
- function handle_search_string(search, callback) {
- var query = {};
- var re = /(?:^\?|&)([^&=]+)(?:=([^&]+))?/g;
- var match;
- while (match = re.exec(search)) {
- query[match[1]] = decodeURIComponent(match[2]);
- }
- var mathNode = document.getElementById("math");
- var settings = {
- displayMode: !!query["display"],
- throwOnError: !query["noThrow"]
- };
- if (query["errorColor"]) {
- settings.errorColor = query["errorColor"];
- }
- var macros = {};
- var macroRegex = /(?:^\?|&)(?:\\|%5[Cc])([A-Za-z]+)=([^&]*)/g;
- while ((match = macroRegex.exec(search)) !== null) {
- settings.macros = macros;
- macros["\\" + match[1]] = decodeURIComponent(match[2]);
- }
- mathNode.setAttribute("style", query["styles"] || "");
- katex.render(query["tex"], mathNode, settings);
- document.getElementById("pre").innerHTML = query["pre"] || "";
- document.getElementById("post").innerHTML = query["post"] || "";
- if (callback && document.fonts && document.fonts.ready) {
- document.fonts.ready.then(callback);
- } else if (callback) {
- callback();
- }
- }
- handle_search_string(window.location.search);
- </script>
- </body>
- </html>
|