www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

test.html (1911B)


      1 <!doctype html>
      2 <html>
      3   <head>
      4     <title>Screenshotter test</title>
      5     <script src="../../katex.js" type="text/javascript"></script>
      6     <link href="../../katex.css" rel="stylesheet" type="text/css">
      7     <style type="text/css">
      8       #math, #pre, #post {
      9         font-size: 4em;
     10       }
     11       body {
     12         font-family: "DejaVu Serif",serif;
     13       }
     14       @font-face {
     15         font-family: "Mincho";
     16         src: url("unicode-fonts/mincho/font_1_honokamin.ttf") format("truetype");
     17       }
     18       @font-face {
     19         font-family: "Batang";
     20         src: url("unicode-fonts/batang/batang.ttf") format("truetype");
     21       }
     22       .katex .cjk_fallback {
     23           font-family: "Mincho",serif;
     24       }
     25       .katex .hangul_fallback {
     26           font-family: "Batang",serif;
     27       }
     28     </style>
     29   </head>
     30   <body>
     31     <span id="pre"></span>
     32     <span id="math"></span>
     33     <span id="post"></span>
     34     <script type="text/javascript">
     35       var query = {};
     36       var re = /(?:^\?|&)([^&=]+)(?:=([^&]+))?/g;
     37       var match;
     38       while (match = re.exec(window.location.search)) {
     39           query[match[1]] = decodeURIComponent(match[2]);
     40       }
     41       var mathNode = document.getElementById("math");
     42 
     43       var settings = {
     44           displayMode: !!query["display"],
     45           throwOnError: !query["noThrow"]
     46       };
     47       if (query["errorColor"]) {
     48           settings.errorColor = query["errorColor"];
     49       }
     50       var macros = {};
     51       var macroRegex = /(?:^\?|&)(?:\\|%5[Cc])([A-Za-z]+)=([^&]*)/g;
     52       while ((match = macroRegex.exec(window.location.search)) !== null) {
     53           settings.macros = macros;
     54           macros["\\" + match[1]] = decodeURIComponent(match[2]);
     55       }
     56 
     57       katex.render(query["tex"], mathNode, settings);
     58       document.getElementById("pre").innerHTML = query["pre"] || "";
     59       document.getElementById("post").innerHTML = query["post"] || "";
     60     </script>
     61   </body>
     62 </html>