12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>试卷OCR</title>
- <link rel="stylesheet" type="text/css" href="../static/mathquill.css">
- </head>
- <body>
- {#<span style="white-space:normal;#}
- {#word-wrap:break-word;font-size: 10px;#}
- {#word-break:break-all; " class="math-field">这边汉字 x^2 \frac {1}{3} 啊 好多好多航 啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>#}
- <div id="container" style="width:{{ w }}px;">
- {% for content in contents %}
- <p class="math-field" style="font-size:{{content.size}}px ;margin-left:{{ content.left }}px;margin-top:{{ content.top }}px;position: absolute;width:{{content.w}};height: {{content.h}} ">
- {{ content.s }}</p>
- {% endfor %}
- <!--<img src="data:image/png;base64,{{ base64 }}"/>-->
- {% for image in images %}
- <img src="data:image/png;base64,{{ image.b64 }}"
- style="background-color:#FFA500;margin-left:{{ image.left }}px;margin-top:{{ image.top }}px;position: absolute;"/>
- <!--</p>-->
- {% endfor %}
- </div>
- <script src="../static/jquery-1.7.2.min.js"></script>
- <script src="../static/mathquill.js"></script>
- <script>
- var staticMathSpan = document.getElementById('static-math');
- var mathFieldSpan_list = document.getElementsByClassName('math-field');
- var latexSpan = document.getElementById('latex');
- var MQ = MathQuill.getInterface(2); // keeps the API stable
- // easily create static or editable math from a DOM element by calling the
- // appropriate constructor: http://docs.mathquill.com/en/latest/Api_Methods/
- MQ.StaticMath(staticMathSpan);
- for (var i = 0; i < mathFieldSpan_list.length; i++) {
- // you may pass in an options object:
- var mathField = MQ.MathField(mathFieldSpan_list[i], {
- spaceBehavesLikeTab: true, // an example config option, for more see:
- // http://docs.mathquill.com/en/latest/Config/
- handlers: {
- edit: function () {
- // retrieve, in LaTeX format, the math that was typed:
- latexSpan.textContent = mathField.latex();
- }
- }
- });
- }
- </script>
- </body>
- </html>
|