From 7cd52a1ead86c4577b614d305349d04c82cebfb0 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 1 Mar 2011 12:48:55 -0500 Subject: [PATCH 01/10] Update test pages to do better error reporting, and to use current configuration blocks --- test/index-images.html | 123 ++++++++++++++++++++----------- test/index.html | 162 +++++++++++++++++++++++++---------------- 2 files changed, 178 insertions(+), 107 deletions(-) diff --git a/test/index-images.html b/test/index-images.html index 4388b3204..c0480cb70 100644 --- a/test/index-images.html +++ b/test/index-images.html @@ -1,12 +1,12 @@ - - - -MathJax Test Page - - - + + + +MathJax Test Page + + + - - - + + - + + + -
+ -

MathJax Test Page

+
+

MathJax Test Page

+ +

If you see typeset mathematics below, then MathJax is working. If you see TeX code instead, MathJax is not working for you. -

+

-
- +
+

\[ \frac{-b\pm\sqrt{b^2-4ac}}{2a} \] -

+

-
-
+
+
MathJax is not working! -
-
+ +
+ +
+ + + + + + + + -
-

If the mathematics does not show up properly, you may not have not installed the MathJax web fonts correctly. Follow the steps in the -installation instructions. +installation instructions.

-

+
- - + + diff --git a/test/index.html b/test/index.html index 68d7540f8..df61ee285 100644 --- a/test/index.html +++ b/test/index.html @@ -1,12 +1,12 @@ - - - -MathJax Test Page - - - + + + +MathJax Test Page + + + - - - - + + -
+ + + -

MathJax Test Page

+ +
+ +

MathJax Test Page

+ +

If you see typeset mathematics below, then MathJax is working. If you see TeX code instead, MathJax is not working for you. -

+

-
+
+

\[ \frac{-b\pm\sqrt{b^2-4ac}}{2a} \] -

+

-
-
+
+
MathJax is not working! -
-
+ +
+ +
-
-

-

- -Once you have MathJax working properly, view the image mode test page to make sure that the +

+Once you have MathJax working properly, view the image mode test page to make sure that the image fallback mode is working as well. +

-
+
- - + + From 916e12889a172eafe99be5e6daff5dd5089b8c58 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 1 Mar 2011 12:49:31 -0500 Subject: [PATCH 02/10] Update to current configuration style, and add title and styling --- test/sample.html | 77 +++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/test/sample.html b/test/sample.html index 53a5d3a7f..e1e621d92 100644 --- a/test/sample.html +++ b/test/sample.html @@ -1,33 +1,48 @@ - - - -MathJax Test Page - - - + + + +MathJax Test Page + + + - - - + + - + + + -
+ -

The Lorenz Equations

+

Sample MathJax Equations

+ +
+ +

The Lorenz Equations

\begin{align} @@ -37,14 +52,14 @@ If your browser supports JavaScript, be sure it is enabled. \end{align}

-

The Cauchy-Schwarz Inequality

+

The Cauchy-Schwarz Inequality

\[ \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) \]

-

A Cross Product Formula

+

A Cross Product Formula

\[ \mathbf{V}_1 \times \mathbf{V}_2 = @@ -55,11 +70,11 @@ If your browser supports JavaScript, be sure it is enabled. \end{vmatrix} \]

-

The probability of getting \(k\) heads when flipping \(n\) coins is:

+

The probability of getting \(k\) heads when flipping \(n\) coins is:

\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]

-

An Identity of Ramanujan

+

An Identity of Ramanujan

\[ \frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} = @@ -67,7 +82,7 @@ If your browser supports JavaScript, be sure it is enabled. {1+\frac{e^{-8\pi}} {1+\ldots} } } } \]

-

A Rogers-Ramanujan Identity

+

A Rogers-Ramanujan Identity

\[ 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. \quad\quad \text{for $|q|<1$}. \]

-

Maxwell's Equations

+

Maxwell's Equations

\begin{align} @@ -86,6 +101,8 @@ If your browser supports JavaScript, be sure it is enabled. \end{align}

+

In-line Mathematics

+

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.

-
+
- - + + From 83de1163c340eb8ade9dc6bb58e25f8d9fdd16c9 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 1 Mar 2011 12:50:31 -0500 Subject: [PATCH 03/10] Update for current features, and improve layout --- test/sample-dynamic.html | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/test/sample-dynamic.html b/test/sample-dynamic.html index df9e0e164..c328197f3 100644 --- a/test/sample-dynamic.html +++ b/test/sample-dynamic.html @@ -1,21 +1,34 @@ + MathJax Dynamic Math Test Page - + - + + + -Type some TeX code and press RETURN:
-

+Type some $\rm\TeX$ code and press RETURN:
+ +

-
-You typed: ${}$ +

You typed:

+
+
$${}$$
- +

When a0, there are two solutions to ax2 @@ -39,6 +37,7 @@ there are two solutions to . +

diff --git a/test/sample-signals.html b/test/sample-signals.html index 83b50aa8b..95cd1eaf8 100644 --- a/test/sample-signals.html +++ b/test/sample-signals.html @@ -1,9 +1,10 @@ + MathJax Signals Test Page - + - + - + + +

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}.$$ +

+

Messages about mathematics:

 
+

+

All Messages:

 
+

+ + -When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are +

+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}.$$ +

diff --git a/test/sample-tex2mml.html b/test/sample-tex2mml.html index 1218c0c4c..f5edf2670 100644 --- a/test/sample-tex2mml.html +++ b/test/sample-tex2mml.html @@ -1,22 +1,17 @@ + -MathJax TeX input with MathML output Test Page - +MathJax TeX or MathML input with MathML or HTML/CSS output Test Page + - + + + - -When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are +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}.$$ From 82cc378443047422b95954c42362d5a30d70485c Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 1 Mar 2011 18:58:00 -0500 Subject: [PATCH 05/10] Add example for showing steps one after another --- test/sample-dynamic-steps.html | 96 ++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 test/sample-dynamic-steps.html diff --git a/test/sample-dynamic-steps.html b/test/sample-dynamic-steps.html new file mode 100644 index 000000000..40c64c815 --- /dev/null +++ b/test/sample-dynamic-steps.html @@ -0,0 +1,96 @@ + + + +MathJax Dynamic Steps Test Page + + + + + + + + + + + + + + +

Dynamic Equations in MathJax

+ +
+

+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} +

+ + + +
+ + + From c9dbc8a708e2b99e6e182ee0de395535a43a98ff Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 1 Mar 2011 19:03:42 -0500 Subject: [PATCH 06/10] Fix copyright date --- test/sample-dynamic-steps.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sample-dynamic-steps.html b/test/sample-dynamic-steps.html index 40c64c815..723769104 100644 --- a/test/sample-dynamic-steps.html +++ b/test/sample-dynamic-steps.html @@ -2,7 +2,7 @@ MathJax Dynamic Steps Test Page - + From 79d37f30661f7a15a334bfa08d3d9fd061d34596 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 7 Mar 2011 21:09:44 -0500 Subject: [PATCH 07/10] Add some extensions, and LoadHooks to show when they load --- test/sample-signals.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/sample-signals.html b/test/sample-signals.html index 95cd1eaf8..7d9837270 100644 --- a/test/sample-signals.html +++ b/test/sample-signals.html @@ -18,10 +18,21 @@ // 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 From 951c14298a0c670e97d98636d5ade83b671997ae Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 7 Mar 2011 21:10:16 -0500 Subject: [PATCH 08/10] Use full configuration --- test/sample-mml.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sample-mml.html b/test/sample-mml.html index 689a43f7c..8389c1836 100644 --- a/test/sample-mml.html +++ b/test/sample-mml.html @@ -6,7 +6,7 @@ - + From 8f8c4453cf5d1d06d033853143ed336be9d8d6bf Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 7 Mar 2011 21:11:05 -0500 Subject: [PATCH 09/10] Improve example to avoid some flickering of the box when the math changes --- test/sample-dynamic.html | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/test/sample-dynamic.html b/test/sample-dynamic.html index c328197f3..17a7c377f 100644 --- a/test/sample-dynamic.html +++ b/test/sample-dynamic.html @@ -2,7 +2,7 @@ MathJax Dynamic Math Test Page - + @@ -28,7 +28,6 @@ input {margin-top: .7em} - @@ -61,22 +79,9 @@ Type some $\rm\TeX$ code and press RETURN:

You typed:

-
+ - - From 10620b11c9eb44c4e92ceddc5204834f9762a677 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 7 Mar 2011 21:11:56 -0500 Subject: [PATCH 10/10] Remove unneeded example (now that we use combined configurations) --- test/sample-tex2mml.html | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 test/sample-tex2mml.html diff --git a/test/sample-tex2mml.html b/test/sample-tex2mml.html deleted file mode 100644 index f5edf2670..000000000 --- a/test/sample-tex2mml.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -MathJax TeX or MathML input with MathML or HTML/CSS output Test Page - - - - - - - - - -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}.$$ - - -