commit 3601dbd0422afbcae46847a76963c36eccbfb440
parent f0a8d82f579ea39341b74b708535430b1e13c20e
Author: Davide P. Cervone <dpvc@union.edu>
Date: Mon, 7 Mar 2011 21:13:26 -0500
Merge branch 'updated-tests' into new-docs
Diffstat:
9 files changed, 414 insertions(+), 211 deletions(-)
diff --git a/test/index-images.html b/test/index-images.html
@@ -1,12 +1,12 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<HTML xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
-<HEAD>
-<TITLE>MathJax Test Page</TITLE>
-<!-- Copyright (c) 2009 Design Science, Inc. -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
-<META HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=EmulateIE7" >
-
-<SCRIPT SRC="../MathJax.js">
+<!DOCTYPE html>
+<html>
+<head>
+<title>MathJax Test Page</title>
+<!-- Copyright (c) 2009-2011 Design Science, Inc. -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+
+<script type="text/x-mathjax-config">
//
// Do NOT use this page as a template for your own pages. It includes
// code that is needed for testing your site's installation of MathJax,
@@ -36,68 +36,103 @@
};
if (!HUB.Browser.versionAtLeast(MINVERSION[HUB.Browser]||0.0)) {
- HUB.config.jax = []; // don't load any Jax
- HUB.config.extensions = []; // don't load any extensions
- alert("The browser you are using does not support MathJax, so we can't test if if is working. Please try a different browser.");
+ HUB.Config({
+ jax: [], // don't load any Jax
+ extensions: [], // don't load any extensions
+ "v1.0-compatible": false // skip warning message due to no jax
+ });
+ setTimeout('document.getElementById("badBrowser").style.display = ""',0);
}
if (HUB.Browser.isMSIE && !HUB.Browser.versionAtLeast("7.0")) {
- alert("Internet Explorer 6 does not display images with alpha-channel transparency very\n" +
- "well, so this test will not look good. But in practice, IE6 will use web-based\n" +
- "fonts rather than image fonts (unless the page forces images, as this one does)\n" +
- "so the poor quality rendering on this test page does not indicate a problem\n" +
- "with MathJax.");
+ setTimeout('document.getElementById("MSIE6").style.display = ""');
}
})(MathJax.Hub);
-</SCRIPT>
-</HEAD>
-<BODY>
+</script>
+<script type="text/javascript" src="../MathJax.js"></script>
+
+<style>
+.warning {
+ color: #800020;
+ background-color: #FFF8F8;
+ border: 2px solid red;
+ margin: 1em 5em;
+ padding: 1em;
+}
+</style>
+</head>
+<body>
-<NOSCRIPT>
-<DIV STYLE="color:#CC0000; text-align:center">
-<B>Warning: <A HREF="http://www.mathjax.org/">MathJax</A>
-requires JavaScript to process the mathematics on this page.<BR>
-If your browser supports JavaScript, be sure it is enabled.<B>
-</DIV>
-<HR>
-</NOSCRIPT>
+<noscript>
+<div style="color:#CC0000; text-align:center">
+<b>Warning: <a href="http://www.mathjax.org/">MathJax</a>
+requires JavaScript to process the mathematics on this page.<br />
+If your browser supports JavaScript, be sure it is enabled.</b>
+</div>
+<hr>
+</noscript>
-<BLOCKQUOTE>
+<blockquote>
-<H1>MathJax Test Page</H1>
+<h1>MathJax Test Page</h1>
+<p>
If you see typeset mathematics below, then MathJax is working. If you see
TeX code instead, MathJax is not working for you.
-<p>
+</p>
<!------------------------------------------------------------------------>
-<HR>
-
+<hr>
+<p>
\[
\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\]
-<p>
+</p>
-<DIV STYLE="color:green">
-<DIV STYLE="text-align:center; color:red; font-size:120%" CLASS="MathJax_Preview">
+<div style="color:green">
+<div style="text-align:center; color:red; font-size:120%" class="MathJax_Preview">
MathJax is not working!
-</DIV><SCRIPT TYPE="math/tex; mode=display">
+</div><script type="math/tex; mode=display">
\bf MathJax\ Image\ Fonts\ Appear\ to\ be\ Working!
-</SCRIPT>
-</DIV>
+</script>
+</div>
+
+<hr>
+
+<!------------------------------------------------------------------------>
+
+<div id="badBrowser" style="display:none">
+<div class="warning">
+<b>WARNING</b>: The browser you are using does not appear to support
+MathJax, so we can't test if MathJax is working. Please try a different
+browser, or a newer version of your browser in order to test MathJax.
+</div>
+<hr>
+</div>
+
+<!------------------------------------------------------------------------>
+
+<div id="MSIE6" style="display:none">
+<div class="warning">
+<b>WARNING</b>: Internet Explorer 6 does not display images with
+alpha-channel transparency very well, so this test will not look good.
+But in practice, IE6 will use web-based fonts rather than image fonts
+(unless the page forces images, as this one does) so the poor quality
+rendering on this test page does not indicate a problem with MathJax.
+</div>
+<hr>
+</div>
<!------------------------------------------------------------------------>
-<HR>
-<p>
If the mathematics does not show up properly, you may not have not
installed the MathJax web fonts correctly. Follow the steps in the
-<A HREF="../docs/html/installation.html">installation instructions</A>.
+<a href="../docs/html/installation.html">installation instructions</a>.
<p>
-</BLOCKQUOTE>
+</blockquote>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/test/index.html b/test/index.html
@@ -1,12 +1,12 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<HTML xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
-<HEAD>
-<TITLE>MathJax Test Page</TITLE>
-<!-- Copyright (c) 2009-2010 Design Science, Inc. -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
-<META HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=EmulateIE7" >
-
-<SCRIPT SRC="../MathJax.js">
+<!DOCTYPE html>
+<html>
+<head>
+<title>MathJax Test Page</title>
+<!-- Copyright (c) 2009-2011 Design Science, Inc. -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+
+<script type="text/x-mathjax-config">
//
// Do NOT use this page as a template for your own pages. It includes
// code that is needed for testing your site's installation of MathJax,
@@ -47,97 +47,133 @@
};
if (!HUB.Browser.versionAtLeast(MINVERSION[HUB.Browser]||0.0)) {
- HUB.config.jax = []; // don't load any Jax
- HUB.config.extensions = []; // don't load any extensions
- alert("The browser you are using does not support MathJax, " +
- "so we can't test if MathJax is working.\n\n"+
- "Please try a different browser, or a newer version of your browser.");
+ HUB.Config({
+ jax: [], // don't load any Jax
+ extensions: [], // don't load any extensions
+ "v1.0-compatible": false // skip warning message due to no jax
+ });
+ setTimeout('document.getElementById("badBrowser").style.display = ""',0);
}
})(MathJax.Hub);
MathJax.Hub.Register.StartupHook("End",function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"];
- if (HTMLCSS.imgFonts) {
- alert("The browser you are using does not seem to support web-based " +
- "fonts, so we can't test the MathJax web fonts with this browser " +
- "(image fonts have been used instead)\n\n" +
- "Please try a different browser, or a newer version of your browser.");
- }
+ if (HTMLCSS && HTMLCSS.imgFonts) {document.getElementById("imageFonts").style.display = ""}
});
-</SCRIPT>
-</HEAD>
-<BODY>
-
-<NOSCRIPT>
-<DIV STYLE="color:#CC0000; text-align:center">
-<B>Warning: <A HREF="http://www.mathjax.org/">MathJax</A>
-requires JavaScript to process the mathematics on this page.<BR>
-If your browser supports JavaScript, be sure it is enabled.<B>
-</DIV>
-<HR>
-</NOSCRIPT>
-
-<BLOCKQUOTE>
-<H1>MathJax Test Page</H1>
+</script>
+<script type="text/javascript" src="../MathJax.js"></script>
+
+<style>
+.warning {
+ color: #800020;
+ background-color: #FFF8F8;
+ border: 2px solid red;
+ margin: 1em 5em;
+ padding: 1em;
+}
+</style>
+</head>
+<body>
+
+<noscript>
+<div style="color:#CC0000; text-align:center">
+<b>Warning: <a href="http://www.mathjax.org/">MathJax</a>
+requires JavaScript to process the mathematics on this page.<br />
+If your browser supports JavaScript, be sure it is enabled.</b>
+</div>
+<hr>
+</noscript>
+
+<blockquote>
+
+<h1>MathJax Test Page</h1>
+<p>
If you see typeset mathematics below, then MathJax is working. If you see
TeX code instead, MathJax is not working for you.
-<p>
+</p>
<!------------------------------------------------------------------------>
-<HR>
+<hr>
+<p>
\[
\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\]
-<p>
+</p>
-<DIV STYLE="color:green">
-<DIV STYLE="text-align:center; color:red; font-size:120%" CLASS="MathJax_Preview">
+<div style="color:green">
+<div style="text-align:center; color:red; font-size:120%" class="MathJax_Preview">
MathJax is not working!
-</DIV><SCRIPT TYPE="math/tex; mode=display">
+</div><script type="math/tex; mode=display">
\bf MathJax\ Appears\ to\ be\ Working!
-</SCRIPT>
-</DIV>
+</script>
+</div>
+
+<hr>
<!------------------------------------------------------------------------>
-<HR>
-<p>
-<DIV ID="noWebFont" STYLE="display:none; color:red">
-<B>WARNING</B>: The web fonts don't seem to be available. Be sure you have
-the <code>MathJax/fonts</code> in place before continuing.
+<div id="badBrowser" style="display:none">
+<div class="warning">
+<b>WARNING</b>: The browser you are using does not appear to support
+MathJax, so we can't test if MathJax is working. Please try a different
+browser, or a newer version of your browser in order to test MathJax.
+</div>
+<hr>
+</div>
+
+<!------------------------------------------------------------------------>
+
+<div id="imageFonts" style="display:none">
+<div class="warning">
+<b>WARNING</b>: The browser you are using does not seem to support web-based
+fonts, so we can't test the MathJax web fonts with this browser (image fonts
+have been used instead). Please try a different browser, or a newer version
+of your browser in order to test MathJax's web-based fonts.
+</div>
+<hr>
+</div>
+
+<!------------------------------------------------------------------------>
+
+<div id="noWebFont" style="display:none">
+<div class="warning">
+<b>WARNING</b>: MathJax's web fonts don't seem to be available. Be sure you have
+the <code>MathJax/fonts</code> directory in place before continuing.
If you fail to install these fonts, MathJax will not
work properly with some browsers. If you can't install the image fonts,
-be sure to set the noImageFonts parameter in your MathJax configuration
+be sure to set the <code>noImageFonts</code> parameter in your MathJax configuration
(either <code>MathJax/config/MathJax.js</code>, or the
<code>MathJax.Hub.Config()</code> call in your web page).
-<p>
-<HR>
-</DIV>
-<p>
+</div>
+<hr>
+</div>
<!------------------------------------------------------------------------>
-<DIV ID="webfonts" STYLE="display:none; color:red">
-<B>WARNING</B>: You are trying to load MathJax from a remote site where the
+<div id="ffWebFont" style="display:none">
+<div class="warning">
+<b>WARNING</b>: You are trying to load MathJax from a remote site where the
web-based fonts are not set up to be shipped to Firefox properly. See the
-<A HREF="../docs/html/installation.html#notes-about-shared-installations">discussion
-of Firefox's same-origin policy</A> in the MathJax documentation.
-<p>
-<HR>
-</DIV>
-<p>
+<a href="../docs/html/installation.html#notes-about-shared-installations">discussion
+of Firefox's same-origin policy</a> in the MathJax documentation for more
+details.
+</div>
+<hr>
+</div>
<!------------------------------------------------------------------------>
-Once you have MathJax working properly, view the <A
-HREF="index-images.html">image mode test page</A> to make sure that the
+<p>
+Once you have MathJax working properly, view the <a
+href="index-images.html">image mode test page</a> to make sure that the
image fallback mode is working as well.
+</p>
-</BLOCKQUOTE>
+</blockquote>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/test/sample-dynamic-steps.html b/test/sample-dynamic-steps.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>MathJax Dynamic Steps Test Page</title>
+<!-- Copyright (c) 2011 Design Science, Inc. -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+
+<script type="text/x-mathjax-config">
+ //
+ // Make displayed equations be aligned left and indented
+ //
+ MathJax.Hub.Config({
+ displayAlign: "left",
+ displayIndent: "2em"
+ });
+ //
+ // Enable the step button after the equation is typeset
+ //
+ MathJax.Hub.Queue(function () {
+ document.getElementById("step").disabled = false;
+ });
+</script>
+<script type="text/javascript" src="../MathJax.js?config=TeX-AMS_HTML-full"></script>
+
+<script type="text/javascript">
+//
+// Use a closure to hide the local variable
+//
+(function () {
+ var n = 1;
+
+ //
+ // Make the current step be visible, and increment the step.
+ // If it is the last step, disable the step button.
+ // Once a step is taken, the reset button is made available.
+ //
+ window.ShowStep = function () {
+ document.getElementById("Step"+n).style.visibility = "visible"; n++;
+ if (!document.getElementById("Step"+n)) {document.getElementById("step").disabled = true}
+ document.getElementById("reset").disabled = false;
+ }
+
+ //
+ // Enable the step button and disable the reset button.
+ // Hide the steps.
+ //
+ window.ResetSteps = function () {
+ document.getElementById("step").disabled = false;
+ document.getElementById("reset").disabled = true;
+ var i = 1, step; n = 1;
+ while (step = document.getElementById("Step"+i)) {step.style.visibility = "hidden"; i++}
+ }
+})();
+</script>
+
+<style>
+/*
+ * Start with the steps being hidden
+ */
+#Step1, #Step2, #Step3, #Step4, #Step5 {
+ visibility: hidden;
+}
+
+h1 {
+ background: #CCCCCC;
+ padding: .2em 1em;
+ border-top: 3px solid #666666;
+ border-bottom: 3px solid #999999;
+}
+</style>
+
+</head>
+<body>
+
+<h1>Dynamic Equations in MathJax</h1>
+
+<blockquote>
+<p>
+Expand the following:
+\begin{align}
+ (x+1)^2
+ &\cssId{Step1}{= (x+1)(x+1)}\\
+ &\cssId{Step2}{= x(x+1) + 1(x+1)}\\
+ &\cssId{Step3}{= (x^2+x) + (x+1)}\\
+ &\cssId{Step4}{= x^2 + (x + x) + 1}\\
+ &\cssId{Step5}{= x^2+2x+1}\\
+\end{align}
+</p>
+
+<input type="button" onclick="ShowStep()" value="Show Next Step" id="step" disabled="true" />
+<input type="button" onclick="ResetSteps()" value="Reset" id="reset" disabled="true" />
+</blockquote>
+
+</body>
+</html>
diff --git a/test/sample-dynamic.html b/test/sample-dynamic.html
@@ -1,18 +1,30 @@
+<!DOCTYPE html>
<html>
<head>
<title>MathJax Dynamic Math Test Page</title>
-<!-- Copyright (c) 2010 Design Science, Inc. -->
+<!-- Copyright (c) 2010-2011 Design Science, Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
-<script src="../MathJax.js">
+<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
- tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
+ jax: ["input/TeX","output/HTML-CSS"]
});
</script>
+<script type="text/javascript" src="../MathJax.js"></script>
+<style>
+input {margin-top: .7em}
+.output {
+ border: 1px solid black;
+ padding: 1em;
+ width: auto;
+ position: absolute; top: 0; left: 2em;
+ min-width: 20em;
+}
+.box {position: relative}
+</style>
</head>
<body>
@@ -23,13 +35,21 @@
//
(function () {
var QUEUE = MathJax.Hub.queue; // shorthand for the queue
- var math = null; // the element jax for the math output.
+ var math = null, box = null; // the element jax for the math output, and the box it's in
+
+ //
+ // Hide and show the box (so it doesn't flicker as much)
+ //
+ var HIDEBOX = function () {box.style.visibility = "hidden"}
+ var SHOWBOX = function () {box.style.visibility = "visible"}
//
// Get the element jax when MathJax has produced it.
//
QUEUE.Push(function () {
math = MathJax.Hub.getAllJax("MathOutput")[0];
+ box = document.getElementById("box");
+ SHOWBOX(); // box is initially hidden so the braces don't show
});
//
@@ -37,31 +57,31 @@
// math entered by the user
//
window.UpdateMath = function (TeX) {
- QUEUE.Push(["Text",math,"\\displaystyle{"+TeX+"}"]);
+ QUEUE.Push(HIDEBOX,["Text",math,"\\displaystyle{"+TeX+"}"],SHOWBOX);
+ }
+
+ //
+ // IE doesn't fire onchange events for RETURN, so
+ // use onkeypress to do a blur (and refocus) to
+ // force the onchange to occur
+ //
+ if (MathJax.Hub.Browser.isMSIE) {
+ window.MathInput.onkeypress = function () {
+ if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
+ }
}
})();
</script>
-Type some TeX code and press RETURN:<br/>
-<input id="MathInput" size="50" onchange="UpdateMath(this.value)" />
<p>
+Type some $\rm\TeX$ code and press RETURN:<br />
+<input id="MathInput" size="80" onchange="UpdateMath(this.value)" />
+</p>
-<div id="MathOutput">
-You typed: ${}$
+<p>You typed:</p>
+<div class="box" id="box" style="visibility:hidden">
+<div id="MathOutput" class="output">$${}$$</div>
</div>
-<script>
-//
-// IE doesn't fire onchange events for RETURN, so
-// use onkeypress to do a blur (and refocus) to
-// force the onchange to occur
-//
-if (MathJax.Hub.Browser.isMSIE) {
- window.MathInput.onkeypress = function () {
- if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
- }
-}
-</script>
-
</body>
</html>
diff --git a/test/sample-mml.html b/test/sample-mml.html
@@ -1,19 +1,17 @@
+<!DOCTYPE html>
<html>
<head>
<title>MathJax MathML Test Page</title>
-<!-- Copyright (c) 2010 Design Science, Inc. -->
+<!-- Copyright (c) 2010-2011 Design Science, Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+
+<script type="text/javascript" src="../MathJax.js?config=MML_HTMLorMML-full"></script>
-<script src="../MathJax.js">
- MathJax.Hub.Config({
- extensions: ["mml2jax.js"],
- jax: ["input/MathML","output/HTML-CSS"]
- });
-</script>
</head>
<body>
+<p>
When <math><mi>a</mi><mo>≠</mo><mn>0</mn></math>,
there are two solutions to <math>
<mi>a</mi><msup><mi>x</mi><mn>2</mn></msup>
@@ -39,6 +37,7 @@ there are two solutions to <math>
</mrow>
<mtext>.</mtext>
</math>
+</p>
</body>
</html>
diff --git a/test/sample-signals.html b/test/sample-signals.html
@@ -1,9 +1,10 @@
+<!DOCTYPE html>
<html>
<head>
<title>MathJax Signals Test Page</title>
-<!-- Copyright (c) 2010 Design Science, Inc. -->
+<!-- Copyright (c) 2010-2011 Design Science, Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<!--
| This example shows how to use MathJax's signal mechanism to find out
@@ -11,16 +12,27 @@
| occur.
-->
-<script src="../MathJax.js">
+<script type="text/x-mathjax-config">
//
// Configure MathJax
//
MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
+ extensions: ["tex2jax.js","TeX/noUndefined.js"],
jax: ["input/TeX","output/HTML-CSS"],
- tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
+ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
+ TeX: {extensions: ["AMSmath.js","AMSsymbols.js"]}
});
+ //
+ // Display messages when these files are loaded
+ // (Note the difference between extensions and TeX.extensions,
+ // and the difference between when noUndefind is loaded compared
+ // to when it signals that it is ready)
+ //
+ MathJax.Hub.Register.LoadHook("[MathJax]/extensions/TeX/noUndefined.js",
+ function () {MathJax.Hub.Startup.signal.Post("*** noUndefined Loaded ***")});
+ MathJax.Hub.Register.LoadHook("[MathJax]/extensions/TeX/AMSmath.js",
+ function () {MathJax.Hub.Startup.signal.Post("*** AMSmath Loaded ***")});
//
// Display a message that we are in the configuration code
@@ -52,6 +64,7 @@
MathJax.Hub.Queue(function () {Message("*** MathJax is done ***")});
</script>
+<script type="text/javascript" src="../MathJax.js"></script>
<style>
.output {
@@ -61,19 +74,26 @@
padding: 3px 1em;
}
</style>
+
</head>
<body>
+<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
+</p>
+<p>
Messages about mathematics:
<pre id="MathMessages" class="output">
</pre>
+</p>
+<p>
All Messages:
<pre id="AllMessages" class="output">
</pre>
+</p>
<script>
(function () {
diff --git a/test/sample-tex.html b/test/sample-tex.html
@@ -1,22 +1,25 @@
+<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
-<!-- Copyright (c) 2010 Design Science, Inc. -->
+<!-- Copyright (c) 2010-2011 Design Science, Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
-<script src="../MathJax.js">
+<script type="text/x-mathjax-config">
MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
});
</script>
+<script type="text/javascript" src="../MathJax.js?config=TeX-AMS_HTML-full"></script>
+
</head>
<body>
-When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
+<p>
+When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
+</p>
</body>
</html>
diff --git a/test/sample-tex2mml.html b/test/sample-tex2mml.html
@@ -1,23 +0,0 @@
-<html>
-<head>
-<title>MathJax TeX input with MathML output Test Page</title>
-<!-- Copyright (c) 2010 Design Science, Inc. -->
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
-
-<script src="../MathJax.js">
- MathJax.Hub.Config({
- config: ["MMLorHTML.js"],
- extensions: ["tex2jax.js"],
- jax: ["input/TeX"],
- tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
- });
-</script>
-</head>
-<body>
-
-When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
-$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
-
-</body>
-</html>
diff --git a/test/sample.html b/test/sample.html
@@ -1,33 +1,48 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<HTML xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
-<HEAD>
-<TITLE>MathJax Test Page</TITLE>
-<!-- Copyright (c) 2009 Design Science, Inc. -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
-<META HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=EmulateIE7" >
-
-<SCRIPT SRC="../MathJax.js">
+<!DOCTYPE html>
+<html>
+<head>
+<title>MathJax Test Page</title>
+<!-- Copyright (c) 2009-2011 Design Science, Inc. -->
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+
+<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
});
-</SCRIPT>
-</HEAD>
-<BODY>
-
-<NOSCRIPT>
-<DIV STYLE="color:#CC0000; text-align:center">
-<B>Warning: <A HREF="http://www.mathjax.org/">MathJax</A>
-requires JavaScript to process the mathematics on this page.<BR>
-If your browser supports JavaScript, be sure it is enabled.<B>
-</DIV>
-<HR>
-</NOSCRIPT>
-
-<BLOCKQUOTE>
-
-<p><b>The Lorenz Equations</b></p>
+</script>
+<script type="text/javascript" src="../MathJax.js"></script>
+
+<style>
+h1 {text-align:center}
+h2 {
+ font-weight: bold;
+ background-color: #DDDDDD;
+ padding: .2em .5em;
+ margin-top: 1.5em;
+ border-top: 3px solid #666666;
+ border-bottom: 2px solid #999999;
+}
+</style>
+</head>
+<body>
+
+<noscript>
+<div style="color:#CC0000; text-align:center">
+<b>Warning: <a href="http://www.mathjax.org/">MathJax</a>
+requires JavaScript to process the mathematics on this page.<br />
+If your browser supports JavaScript, be sure it is enabled.</b>
+</div>
+<hr>
+</noscript>
+
+<h1>Sample MathJax Equations</h1>
+
+<blockquote>
+
+<h2>The Lorenz Equations</h2>
<p>
\begin{align}
@@ -37,14 +52,14 @@ If your browser supports JavaScript, be sure it is enabled.<B>
\end{align}
</p>
-<p><b>The Cauchy-Schwarz Inequality</b></p>
+<h2>The Cauchy-Schwarz Inequality</h2>
<p>\[
\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)
\]</p>
-<p><b>A Cross Product Formula</b></p>
+<h2>A Cross Product Formula</h2>
<p>\[
\mathbf{V}_1 \times \mathbf{V}_2 =
@@ -55,11 +70,11 @@ If your browser supports JavaScript, be sure it is enabled.<B>
\end{vmatrix}
\]</p>
-<p><b>The probability of getting \(k\) heads when flipping \(n\) coins is:</b></p>
+<h2>The probability of getting \(k\) heads when flipping \(n\) coins is:</h2>
<p>\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]</p>
-<p><b>An Identity of Ramanujan</b></p>
+<h2>An Identity of Ramanujan</h2>
<p>\[
\frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} =
@@ -67,7 +82,7 @@ If your browser supports JavaScript, be sure it is enabled.<B>
{1+\frac{e^{-8\pi}} {1+\ldots} } } }
\]</p>
-<p><b>A Rogers-Ramanujan Identity</b></p>
+<h2>A Rogers-Ramanujan Identity</h2>
<p>\[
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
@@ -75,7 +90,7 @@ If your browser supports JavaScript, be sure it is enabled.<B>
\quad\quad \text{for $|q|<1$}.
\]</p>
-<p><b>Maxwell's Equations</b></p>
+<h2>Maxwell's Equations</h2>
<p>
\begin{align}
@@ -86,6 +101,8 @@ If your browser supports JavaScript, be sure it is enabled.<B>
\end{align}
</p>
+<h2>In-line Mathematics</h2>
+
<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
@@ -93,7 +110,7 @@ you see, MathJax equations can be used this way as well, without unduly
disturbing the spacing between lines.</p>
-</BLOCKQUOTE>
+</blockquote>
-</BODY>
-</HTML>
+</body>
+</html>