sample-all-at-once.html (3696B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Wait Until MathJax is Finished Before Showing Page</title> 5 <!-- Copyright (c) 2012-2015 The MathJax Consortium --> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 7 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 8 <meta name="viewport" content="width=device-width, initial-scale=1"> 9 10 <!-- 11 | 12 | This shows how to prevent the page from being displayed until after 13 | MathJax has finished typesetting all the math. This avoids the 14 | "flicker" that occurs as source TeX code is removed from the page and 15 | then typeset. You probably don't want to do this on a page with lots 16 | of math. 17 | 18 |--> 19 20 <script type="text/x-mathjax-config"> 21 // 22 // The document is hidden until MathJax is finished, then 23 // this function runs, making it visible again. 24 // 25 MathJax.Hub.Queue(function () { 26 document.getElementById("hide_page").style.visibility = ""; 27 }); 28 </script> 29 <script type="text/javascript" src="../MathJax.js?config=TeX-AMS_HTML-full"></script> 30 31 <style> 32 h1 {text-align:center} 33 h2 { 34 font-weight: bold; 35 background-color: #DDDDDD; 36 padding: .2em .5em; 37 margin-top: 1.5em; 38 border-top: 3px solid #666666; 39 border-bottom: 2px solid #999999; 40 } 41 </style> 42 </head> 43 <body> 44 45 <!-- 46 | 47 | This DIV keeps the page blank until after the math is typeset. 48 |--> 49 <div id="hide_page" style="visibility:hidden"> 50 51 <noscript> 52 <div style="color:#CC0000; text-align:center"> 53 <b>Warning: <a href="http://www.mathjax.org/">MathJax</a> 54 requires JavaScript to process the mathematics on this page.<br /> 55 If your browser supports JavaScript, be sure it is enabled.</b> 56 </div> 57 <hr> 58 </noscript> 59 60 <h1>Sample MathJax Equations</h1> 61 62 <blockquote> 63 64 <h2>The Lorenz Equations</h2> 65 66 <p> 67 \begin{align} 68 \dot{x} & = \sigma(y-x) \\ 69 \dot{y} & = \rho x - y - xz \\ 70 \dot{z} & = -\beta z + xy 71 \end{align} 72 </p> 73 74 <h2>The Cauchy-Schwarz Inequality</h2> 75 76 <p>\[ 77 \left( \sum_{k=1}^n a_k b_k \right)^{\!\!2} \leq 78 \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) 79 \]</p> 80 81 <h2>A Cross Product Formula</h2> 82 83 <p>\[ 84 \mathbf{V}_1 \times \mathbf{V}_2 = 85 \begin{vmatrix} 86 \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 87 \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ 88 \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ 89 \end{vmatrix} 90 \]</p> 91 92 <h2>The probability of getting \(k\) heads when flipping \(n\) coins is:</h2> 93 94 <p>\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]</p> 95 96 <h2>An Identity of Ramanujan</h2> 97 98 <p>\[ 99 \frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} = 100 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} 101 {1+\frac{e^{-8\pi}} {1+\ldots} } } } 102 \]</p> 103 104 <h2>A Rogers-Ramanujan Identity</h2> 105 106 <p>\[ 107 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = 108 \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, 109 \quad\quad \text{for $|q|<1$}. 110 \]</p> 111 112 <h2>Maxwell's Equations</h2> 113 114 <p> 115 \begin{align} 116 \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ 117 \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ 118 \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ 119 \nabla \cdot \vec{\mathbf{B}} & = 0 120 \end{align} 121 </p> 122 123 <h2>In-line Mathematics</h2> 124 125 <p>Finally, while display equations look good for a page of samples, the 126 ability to mix math and text in a paragraph is also important. This 127 expression \(\sqrt{3x-1}+(1+x)^2\) is an example of an inline equation. As 128 you see, MathJax equations can be used this way as well, without unduly 129 disturbing the spacing between lines.</p> 130 131 132 </blockquote> 133 134 </div> 135 136 </body> 137 </html>