-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.html
46 lines (46 loc) · 1.49 KB
/
main.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<!-- Thanks to MathJax examples for some of this code -->
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript"
src="MathJax/MathJax.js?config=TeX-AMS-MML_SVG"
></script>
</head>
<body>
<script>
MathJax.Hub.signal.Interest( function ( message ) {
if ( message[0] == 'End Update' )
qtapp.MathJaxDone();
else if ( /error/.test( message[0] ) )
qtapp.MathJaxError( message[1] );
// else
// qtapp.MathJaxError( message.join( ';' ) );
} );
window.UpdateMath = function ( TeX ) {
try {
if ( ( TeX.substr( 0, 2 ) == '$$' )
&& ( TeX.substr( TeX.length-2 ) == '$$' ) )
TeX = "\\displaystyle{" + TeX.substr( 2, TeX.length-4 )
+ "}";
else if ( ( TeX[0] == '$' )
&& ( TeX[TeX.length-1] == '$' ) )
TeX = "\\textstyle{" + TeX.substr( 1, TeX.length-2 )
+ "}";
else
TeX = "\\displaystyle{" + TeX + "}";
MathJax.Hub.queue.Push(
[ "Text",
MathJax.Hub.getAllJax( "MathOutput" )[0],
TeX ] );
} catch ( e ) {
throw e + '\nmath = ' + math + '\nTeX = ' + TeX;
}
return 'started';
}
</script>
<div id="MathOutput" class="output">$${}$$</div>
</body>
</html>