MathJaxSample.htm 1.8 KB

12345678910111213141516171819202122232425262728293031
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- This line adds MathJax to the page with default SVG output -->
  5. <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG"></script>
  6. </head>
  7. <body>
  8. <h3>The Cauchy-Schwarz Inequality (TeX)</h3>
  9. \[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]
  10. <h3>Standard Deviation (MathML)</h3>
  11. <math display="block"><mrow><mi>&#x03c3;</mi><mo>=</mo><msqrt><mrow><mfrac><mrow><mn>1</mn></mrow><mrow><mi>N</mi></mrow></mfrac><mstyle displaystyle="true"><mrow><munderover><mrow><mo>&#x2211;</mo></mrow><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi>N</mi></mrow></munderover><mrow><msup><mrow><mo stretchy="false">(</mo><msub><mrow><mi>x</mi></mrow><mrow><mi>i</mi></mrow></msub><mo>&#x2212;</mo><mi>&#x03bc;</mi><mo stretchy="false">)</mo></mrow><mrow><mn>2</mn></mrow></msup></mrow></mrow></mstyle></mrow></msqrt><mo>.</mo></mrow></math>
  12. <h3>Inline equation (TeX)</h3>
  13. <p>Finally, while display equations look good for a page of samples, the ability to mix math and text in a paragraph is also important. This expression \(\sqrt{3x-1}+(1+x)^2\) is an example of an inline equation. As you see, MathJax equations can be used this way as well, without unduly disturbing the spacing between lines.</p>
  14. <!-- This block of code adds a button to send the processed HTML code to your script: MathJaxProcess.php -->
  15. <div id="mpdf-create">
  16. <form autocomplete="off" action="MathJaxProcess.php" method="POST" id="pdfform" onSubmit="document.getElementById('bodydata').value=encodeURIComponent(document.body.innerHTML);">
  17. <input type="submit" value="PDF" name="PDF"/>
  18. <input type="submit" value="SVG" name="SVG"/>
  19. <input type="hidden" value="" id="bodydata" name="bodydata" />
  20. </form>
  21. </div>
  22. </body>
  23. </html>