diff --git a/Text/TeXMath/MathMLWriter.hs b/Text/TeXMath/MathMLWriter.hs
--- a/Text/TeXMath/MathMLWriter.hs
+++ b/Text/TeXMath/MathMLWriter.hs
@@ -134,8 +134,7 @@
 showExp :: Exp -> Element
 showExp e =
  case e of
-   EInteger x       -> unode "mn" $ show x
-   EFloat   x       -> unode "mn" $ show x
+   ENumber x        -> unode "mn" x
    EGrouped [x]     -> showExp x
    EGrouped xs      -> mrow $ map showExp xs
    EIdentifier x    -> unode "mi" x
diff --git a/Text/TeXMath/Parser.hs b/Text/TeXMath/Parser.hs
--- a/Text/TeXMath/Parser.hs
+++ b/Text/TeXMath/Parser.hs
@@ -38,8 +38,7 @@
 type ArrayLine = [[Exp]]
 
 data Exp =
-    EInteger Integer
-  | EFloat   Double 
+    ENumber String
   | EGrouped [Exp]
   | EIdentifier String
   | ESymbol TeXSymbolType String
@@ -65,9 +64,9 @@
    , commentLine    = "%"
    , nestedComments = False
    , identStart     = letter
-   , identLetter    = alphaNum
+   , identLetter    = letter
    , opStart        = opLetter texMathDef
-   , opLetter       = oneOf ":_+/=^-(),;.?'~[]<>!"
+   , opLetter       = oneOf ":_+*/=^-(),;.?'~[]<>!"
    , reservedOpNames= []
    , reservedNames  = []
    , caseSensitive  = True
@@ -108,8 +107,7 @@
 inbrackets = liftM EGrouped (brackets $ many $ notFollowedBy (char ']') >> expr)
 
 number :: GenParser Char st Exp
-number = try (liftM EFloat float)
-      <|> liftM EInteger decimal 
+number = lexeme $ liftM ENumber $ many1 digit
 
 enclosure :: GenParser Char st Exp
 enclosure = basicEnclosure <|> leftright <|> scaledEnclosure
@@ -316,12 +314,6 @@
 operator = lexeme $ liftM (:[]) (opLetter texMathDef)
                  <|> many1 (char '\'')
 
-decimal :: CharParser st Integer
-decimal = lexeme (P.decimal lexer)
-
-float :: CharParser st Double
-float = lexeme (P.float lexer)
-
 symbol :: String -> CharParser st String
 symbol = lexeme . P.symbol lexer
 
@@ -375,6 +367,7 @@
 symbols = M.fromList [
              ("+", ESymbol Bin "+")
            , ("-", ESymbol Bin "-")
+           , ("*", ESymbol Bin "*")
            , (",", ESymbol Pun ",")
            , (".", ESymbol Pun ".")
            , (";", ESymbol Pun ";")
diff --git a/cgi/texmath.xhtml b/cgi/texmath.xhtml
--- a/cgi/texmath.xhtml
+++ b/cgi/texmath.xhtml
@@ -9,7 +9,7 @@
       pre#xml { font-size: small; color: blue; }
       ]]>
     </style>
-    <script type="text/javascript" src="/scripts/jquery.js"></script>
+    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
     <script type="text/javascript">
       <![CDATA[
       $(document).ready(function(){
diff --git a/examples b/examples
deleted file mode 100644
--- a/examples
+++ /dev/null
@@ -1,48 +0,0 @@
-x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
-
-2 = \left(
- \frac{\left(3-x\right) \times 2}{3-x}
- \right)
-
-ax^2 + bx + c = 0
-
-S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}
-
-\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds
- = \int_a^x f(y)(x-y)\,dy
-
-\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
- {3^m\left(m\,3^n+n\,3^m\right)}
-
-u'' + p(x)u' + q(x)u=f(x),\quad x>a
-
-|\bar{z}| = |z|,
- |(\bar{z})^n| = |z|^n,
- \arg(z^n) = n \arg(z)
-
-\lim_{z\rightarrow z_0} f(z)=f(z_0)
-
-\phi_n(\kappa) =
- \frac{1}{4\pi^2\kappa^2} \int_0^\infty
- \frac{\sin(\kappa R)}{\kappa R}
- \frac{\partial}{\partial R}
- \left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR
-
-\phi_n(\kappa) = 
- 0.033C_n^2\kappa^{-11/3},\quad
- \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}
-
-f(x) =
- \begin{cases}
- 1 & -1 \le x < 0 \\
- \frac{1}{2} & x = 0 \\
- 1 - x^2 & \mbox{otherwise}
- \end{cases}
-
-{}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z)
- = \sum_{n=0}^\infty
- \frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}
- \frac{z^n}{n!}
-
- \frac {a}{b}\  \tfrac {a}{b}
-
diff --git a/tests/01.tex b/tests/01.tex
new file mode 100644
--- /dev/null
+++ b/tests/01.tex
@@ -0,0 +1,2 @@
+x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
+
diff --git a/tests/01.xhtml b/tests/01.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/01.xhtml
@@ -0,0 +1,37 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mi>x</mi>
+        <mo>=</mo>
+        <mfrac>
+          <mrow>
+            <mo>-</mo>
+            <mi>b</mi>
+            <mo>&#177;</mo>
+            <msqrt>
+              <mrow>
+                <msup>
+                  <mi>b</mi>
+                  <mn>2</mn>
+                </msup>
+                <mo>-</mo>
+                <mn>4</mn>
+                <mi>a</mi>
+                <mi>c</mi>
+              </mrow>
+            </msqrt>
+          </mrow>
+          <mrow>
+            <mn>2</mn>
+            <mi>a</mi>
+          </mrow>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/02.tex b/tests/02.tex
new file mode 100644
--- /dev/null
+++ b/tests/02.tex
@@ -0,0 +1,4 @@
+2 = \left(
+ \frac{\left(3-x\right) \times 2}{3-x}
+ \right)
+
diff --git a/tests/02.xhtml b/tests/02.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/02.xhtml
@@ -0,0 +1,32 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mn>2</mn>
+        <mo>=</mo>
+        <mo stretchy="true">(</mo>
+        <mfrac>
+          <mrow>
+            <mo stretchy="true">(</mo>
+            <mn>3</mn>
+            <mo>-</mo>
+            <mi>x</mi>
+            <mo stretchy="true">)</mo>
+            <mo>&#215;</mo>
+            <mn>2</mn>
+          </mrow>
+          <mrow>
+            <mn>3</mn>
+            <mo>-</mo>
+            <mi>x</mi>
+          </mrow>
+        </mfrac>
+        <mo stretchy="true">)</mo>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/03.tex b/tests/03.tex
new file mode 100644
--- /dev/null
+++ b/tests/03.tex
@@ -0,0 +1,2 @@
+ax^2 + bx + c = 0
+
diff --git a/tests/03.xhtml b/tests/03.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/03.xhtml
@@ -0,0 +1,24 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mi>a</mi>
+        <msup>
+          <mi>x</mi>
+          <mn>2</mn>
+        </msup>
+        <mo>+</mo>
+        <mi>b</mi>
+        <mi>x</mi>
+        <mo>+</mo>
+        <mi>c</mi>
+        <mo>=</mo>
+        <mn>0</mn>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/04.tex b/tests/04.tex
new file mode 100644
--- /dev/null
+++ b/tests/04.tex
@@ -0,0 +1,2 @@
+S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}
+
diff --git a/tests/04.xhtml b/tests/04.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/04.xhtml
@@ -0,0 +1,35 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msub>
+          <mi>S</mi>
+          <mtext mathvariant="normal">new</mtext>
+        </msub>
+        <mo>=</mo>
+        <msub>
+          <mi>S</mi>
+          <mtext mathvariant="normal">old</mtext>
+        </msub>
+        <mo>-</mo>
+        <mfrac>
+          <mrow>
+            <mo stretchy="true">(</mo>
+            <mn>5</mn>
+            <mo>-</mo>
+            <mi>T</mi>
+            <msup>
+              <mo stretchy="true">)</mo>
+              <mn>2</mn>
+            </msup>
+          </mrow>
+          <mn>2</mn>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/05.tex b/tests/05.tex
new file mode 100644
--- /dev/null
+++ b/tests/05.tex
@@ -0,0 +1,3 @@
+\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds
+ = \int_a^x f(y)(x-y)\,dy
+
diff --git a/tests/05.xhtml b/tests/05.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/05.xhtml
@@ -0,0 +1,53 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msubsup>
+          <mo>&#8747;</mo>
+          <mi>a</mi>
+          <mi>x</mi>
+        </msubsup>
+        <mspace width="-0.167em" />
+        <mspace width="-0.167em" />
+        <mspace width="-0.167em" />
+        <msubsup>
+          <mo>&#8747;</mo>
+          <mi>a</mi>
+          <mi>s</mi>
+        </msubsup>
+        <mi>f</mi>
+        <mo>(</mo>
+        <mi>y</mi>
+        <mo>)</mo>
+        <mspace width="0.167em" />
+        <mi>d</mi>
+        <mi>y</mi>
+        <mspace width="0.167em" />
+        <mi>d</mi>
+        <mi>s</mi>
+        <mo>=</mo>
+        <msubsup>
+          <mo>&#8747;</mo>
+          <mi>a</mi>
+          <mi>x</mi>
+        </msubsup>
+        <mi>f</mi>
+        <mo>(</mo>
+        <mi>y</mi>
+        <mo>)</mo>
+        <mo>(</mo>
+        <mi>x</mi>
+        <mo>-</mo>
+        <mi>y</mi>
+        <mo>)</mo>
+        <mspace width="0.167em" />
+        <mi>d</mi>
+        <mi>y</mi>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/06.tex b/tests/06.tex
new file mode 100644
--- /dev/null
+++ b/tests/06.tex
@@ -0,0 +1,3 @@
+\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
+ {3^m\left(m\,3^n+n\,3^m\right)}
+
diff --git a/tests/06.xhtml b/tests/06.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/06.xhtml
@@ -0,0 +1,61 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msubsup>
+          <mo>&#8721;</mo>
+          <mrow>
+            <mi>m</mi>
+            <mo>=</mo>
+            <mn>1</mn>
+          </mrow>
+          <mo>&#8734;</mo>
+        </msubsup>
+        <msubsup>
+          <mo>&#8721;</mo>
+          <mrow>
+            <mi>n</mi>
+            <mo>=</mo>
+            <mn>1</mn>
+          </mrow>
+          <mo>&#8734;</mo>
+        </msubsup>
+        <mfrac>
+          <mrow>
+            <msup>
+              <mi>m</mi>
+              <mn>2</mn>
+            </msup>
+            <mspace width="0.167em" />
+            <mi>n</mi>
+          </mrow>
+          <mrow>
+            <msup>
+              <mn>3</mn>
+              <mi>m</mi>
+            </msup>
+            <mo stretchy="true">(</mo>
+            <mi>m</mi>
+            <mspace width="0.167em" />
+            <msup>
+              <mn>3</mn>
+              <mi>n</mi>
+            </msup>
+            <mo>+</mo>
+            <mi>n</mi>
+            <mspace width="0.167em" />
+            <msup>
+              <mn>3</mn>
+              <mi>m</mi>
+            </msup>
+            <mo stretchy="true">)</mo>
+          </mrow>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/07.tex b/tests/07.tex
new file mode 100644
--- /dev/null
+++ b/tests/07.tex
@@ -0,0 +1,2 @@
+u'' + p(x)u' + q(x)u=f(x),\quad x>a
+
diff --git a/tests/07.xhtml b/tests/07.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/07.xhtml
@@ -0,0 +1,38 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mi>u</mi>
+        <mo>&#697;</mo>
+        <mo>&#697;</mo>
+        <mo>+</mo>
+        <mi>p</mi>
+        <mo>(</mo>
+        <mi>x</mi>
+        <mo>)</mo>
+        <mi>u</mi>
+        <mo>&#697;</mo>
+        <mo>+</mo>
+        <mi>q</mi>
+        <mo>(</mo>
+        <mi>x</mi>
+        <mo>)</mo>
+        <mi>u</mi>
+        <mo>=</mo>
+        <mi>f</mi>
+        <mo>(</mo>
+        <mi>x</mi>
+        <mo>)</mo>
+        <mo>,</mo>
+        <mspace width="1em" />
+        <mi>x</mi>
+        <mo>&gt;</mo>
+        <mi>a</mi>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/08.tex b/tests/08.tex
new file mode 100644
--- /dev/null
+++ b/tests/08.tex
@@ -0,0 +1,4 @@
+|\bar{z}| = |z|,
+ |(\bar{z})^n| = |z|^n,
+ \arg(z^n) = n \arg(z)
+
diff --git a/tests/08.xhtml b/tests/08.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/08.xhtml
@@ -0,0 +1,55 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mo>&#8739;</mo>
+        <mover>
+          <mi>z</mi>
+          <mo accent="true">&#8254;</mo>
+        </mover>
+        <mo>&#8739;</mo>
+        <mo>=</mo>
+        <mo>&#8739;</mo>
+        <mi>z</mi>
+        <mo>&#8739;</mo>
+        <mo>,</mo>
+        <mo>&#8739;</mo>
+        <mo>(</mo>
+        <mover>
+          <mi>z</mi>
+          <mo accent="true">&#8254;</mo>
+        </mover>
+        <msup>
+          <mo>)</mo>
+          <mi>n</mi>
+        </msup>
+        <mo>&#8739;</mo>
+        <mo>=</mo>
+        <mo>&#8739;</mo>
+        <mi>z</mi>
+        <msup>
+          <mo>&#8739;</mo>
+          <mi>n</mi>
+        </msup>
+        <mo>,</mo>
+        <mi>arg</mi>
+        <mo>(</mo>
+        <msup>
+          <mi>z</mi>
+          <mi>n</mi>
+        </msup>
+        <mo>)</mo>
+        <mo>=</mo>
+        <mi>n</mi>
+        <mi>arg</mi>
+        <mo>(</mo>
+        <mi>z</mi>
+        <mo>)</mo>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/09.tex b/tests/09.tex
new file mode 100644
--- /dev/null
+++ b/tests/09.tex
@@ -0,0 +1,2 @@
+\lim_{z\rightarrow z_0} f(z)=f(z_0)
+
diff --git a/tests/09.xhtml b/tests/09.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/09.xhtml
@@ -0,0 +1,35 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msub>
+          <mi>lim</mi>
+          <mrow>
+            <mi>z</mi>
+            <mo>&#8594;</mo>
+            <msub>
+              <mi>z</mi>
+              <mn>0</mn>
+            </msub>
+          </mrow>
+        </msub>
+        <mi>f</mi>
+        <mo>(</mo>
+        <mi>z</mi>
+        <mo>)</mo>
+        <mo>=</mo>
+        <mi>f</mi>
+        <mo>(</mo>
+        <msub>
+          <mi>z</mi>
+          <mn>0</mn>
+        </msub>
+        <mo>)</mo>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/10.tex b/tests/10.tex
new file mode 100644
--- /dev/null
+++ b/tests/10.tex
@@ -0,0 +1,6 @@
+\phi_n(\kappa) =
+ \frac{1}{4\pi^2\kappa^2} \int_0^\infty
+ \frac{\sin(\kappa R)}{\kappa R}
+ \frac{\partial}{\partial R}
+ \left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR
+
diff --git a/tests/10.xhtml b/tests/10.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/10.xhtml
@@ -0,0 +1,84 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msub>
+          <mo>&#966;</mo>
+          <mi>n</mi>
+        </msub>
+        <mo>(</mo>
+        <mo>&#954;</mo>
+        <mo>)</mo>
+        <mo>=</mo>
+        <mfrac>
+          <mn>1</mn>
+          <mrow>
+            <mn>4</mn>
+            <msup>
+              <mo>&#960;</mo>
+              <mn>2</mn>
+            </msup>
+            <msup>
+              <mo>&#954;</mo>
+              <mn>2</mn>
+            </msup>
+          </mrow>
+        </mfrac>
+        <msubsup>
+          <mo>&#8747;</mo>
+          <mn>0</mn>
+          <mo>&#8734;</mo>
+        </msubsup>
+        <mfrac>
+          <mrow>
+            <mi>sin</mi>
+            <mo>(</mo>
+            <mo>&#954;</mo>
+            <mi>R</mi>
+            <mo>)</mo>
+          </mrow>
+          <mrow>
+            <mo>&#954;</mo>
+            <mi>R</mi>
+          </mrow>
+        </mfrac>
+        <mfrac>
+          <mo>&#8706;</mo>
+          <mrow>
+            <mo>&#8706;</mo>
+            <mi>R</mi>
+          </mrow>
+        </mfrac>
+        <mo stretchy="true">[</mo>
+        <msup>
+          <mi>R</mi>
+          <mn>2</mn>
+        </msup>
+        <mfrac>
+          <mrow>
+            <mo>&#8706;</mo>
+            <msub>
+              <mi>D</mi>
+              <mi>n</mi>
+            </msub>
+            <mo>(</mo>
+            <mi>R</mi>
+            <mo>)</mo>
+          </mrow>
+          <mrow>
+            <mo>&#8706;</mo>
+            <mi>R</mi>
+          </mrow>
+        </mfrac>
+        <mo stretchy="true">]</mo>
+        <mspace width="0.167em" />
+        <mi>d</mi>
+        <mi>R</mi>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/11.tex b/tests/11.tex
new file mode 100644
--- /dev/null
+++ b/tests/11.tex
@@ -0,0 +1,4 @@
+\phi_n(\kappa) = 
+ 0.033C_n^2\kappa^{-11/3},\quad
+ \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}
+
diff --git a/tests/11.xhtml b/tests/11.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/11.xhtml
@@ -0,0 +1,56 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msub>
+          <mo>&#966;</mo>
+          <mi>n</mi>
+        </msub>
+        <mo>(</mo>
+        <mo>&#954;</mo>
+        <mo>)</mo>
+        <mo>=</mo>
+        <mn>0</mn>
+        <mo>.</mo>
+        <mn>033</mn>
+        <msubsup>
+          <mi>C</mi>
+          <mi>n</mi>
+          <mn>2</mn>
+        </msubsup>
+        <msup>
+          <mo>&#954;</mo>
+          <mrow>
+            <mo>-</mo>
+            <mn>11</mn>
+            <mo>/</mo>
+            <mn>3</mn>
+          </mrow>
+        </msup>
+        <mo>,</mo>
+        <mspace width="1em" />
+        <mfrac>
+          <mn>1</mn>
+          <msub>
+            <mi>L</mi>
+            <mn>0</mn>
+          </msub>
+        </mfrac>
+        <mo>&#8810;</mo>
+        <mo>&#954;</mo>
+        <mo>&#8810;</mo>
+        <mfrac>
+          <mn>1</mn>
+          <msub>
+            <mi>l</mi>
+            <mn>0</mn>
+          </msub>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/12.tex b/tests/12.tex
new file mode 100644
--- /dev/null
+++ b/tests/12.tex
@@ -0,0 +1,7 @@
+f(x) =
+ \begin{cases}
+ 1 & -1 \le x < 0 \\
+ \frac{1}{2} & x = 0 \\
+ 1 - x^2 & \mbox{otherwise}
+ \end{cases}
+
diff --git a/tests/12.xhtml b/tests/12.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/12.xhtml
@@ -0,0 +1,61 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mi>f</mi>
+        <mo>(</mo>
+        <mi>x</mi>
+        <mo>)</mo>
+        <mo>=</mo>
+        <mrow>
+          <mo stretchy="true">{</mo>
+          <mtable>
+            <mtr>
+              <mtd>
+                <mn>1</mn>
+              </mtd>
+              <mtd>
+                <mo>-</mo>
+                <mn>1</mn>
+                <mo>&#8804;</mo>
+                <mi>x</mi>
+                <mo>&lt;</mo>
+                <mn>0</mn>
+              </mtd>
+            </mtr>
+            <mtr>
+              <mtd>
+                <mfrac>
+                  <mn>1</mn>
+                  <mn>2</mn>
+                </mfrac>
+              </mtd>
+              <mtd>
+                <mi>x</mi>
+                <mo>=</mo>
+                <mn>0</mn>
+              </mtd>
+            </mtr>
+            <mtr>
+              <mtd>
+                <mn>1</mn>
+                <mo>-</mo>
+                <msup>
+                  <mi>x</mi>
+                  <mn>2</mn>
+                </msup>
+              </mtd>
+              <mtd>
+                <mtext mathvariant="normal">otherwise</mtext>
+              </mtd>
+            </mtr>
+          </mtable>
+        </mrow>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/13.tex b/tests/13.tex
new file mode 100644
--- /dev/null
+++ b/tests/13.tex
@@ -0,0 +1,5 @@
+{}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z)
+ = \sum_{n=0}^\infty
+ \frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}
+ \frac{z^n}{n!}
+
diff --git a/tests/13.xhtml b/tests/13.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/13.xhtml
@@ -0,0 +1,111 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <msub>
+          <mrow />
+          <mi>p</mi>
+        </msub>
+        <msub>
+          <mi>F</mi>
+          <mi>q</mi>
+        </msub>
+        <mo>(</mo>
+        <msub>
+          <mi>a</mi>
+          <mn>1</mn>
+        </msub>
+        <mo>,</mo>
+        <mo>&#8230;</mo>
+        <mo>,</mo>
+        <msub>
+          <mi>a</mi>
+          <mi>p</mi>
+        </msub>
+        <mo>;</mo>
+        <msub>
+          <mi>c</mi>
+          <mn>1</mn>
+        </msub>
+        <mo>,</mo>
+        <mo>&#8230;</mo>
+        <mo>,</mo>
+        <msub>
+          <mi>c</mi>
+          <mi>q</mi>
+        </msub>
+        <mo>;</mo>
+        <mi>z</mi>
+        <mo>)</mo>
+        <mo>=</mo>
+        <msubsup>
+          <mo>&#8721;</mo>
+          <mrow>
+            <mi>n</mi>
+            <mo>=</mo>
+            <mn>0</mn>
+          </mrow>
+          <mo>&#8734;</mo>
+        </msubsup>
+        <mfrac>
+          <mrow>
+            <mo>(</mo>
+            <msub>
+              <mi>a</mi>
+              <mn>1</mn>
+            </msub>
+            <msub>
+              <mo>)</mo>
+              <mi>n</mi>
+            </msub>
+            <mo>&#8943;</mo>
+            <mo>(</mo>
+            <msub>
+              <mi>a</mi>
+              <mi>p</mi>
+            </msub>
+            <msub>
+              <mo>)</mo>
+              <mi>n</mi>
+            </msub>
+          </mrow>
+          <mrow>
+            <mo>(</mo>
+            <msub>
+              <mi>c</mi>
+              <mn>1</mn>
+            </msub>
+            <msub>
+              <mo>)</mo>
+              <mi>n</mi>
+            </msub>
+            <mo>&#8943;</mo>
+            <mo>(</mo>
+            <msub>
+              <mi>c</mi>
+              <mi>q</mi>
+            </msub>
+            <msub>
+              <mo>)</mo>
+              <mi>n</mi>
+            </msub>
+          </mrow>
+        </mfrac>
+        <mfrac>
+          <msup>
+            <mi>z</mi>
+            <mi>n</mi>
+          </msup>
+          <mrow>
+            <mi>n</mi>
+            <mo>!</mo>
+          </mrow>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/14.tex b/tests/14.tex
new file mode 100644
--- /dev/null
+++ b/tests/14.tex
@@ -0,0 +1,2 @@
+ \frac {a}{b}\  \tfrac {a}{b}
+
diff --git a/tests/14.xhtml b/tests/14.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/14.xhtml
@@ -0,0 +1,23 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mfrac>
+          <mi>a</mi>
+          <mi>b</mi>
+        </mfrac>
+        <mo> </mo>
+        <mstyle displaystyle="false">
+          <mfrac>
+            <mi>a</mi>
+            <mi>b</mi>
+          </mfrac>
+        </mstyle>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/15.tex b/tests/15.tex
new file mode 100644
--- /dev/null
+++ b/tests/15.tex
@@ -0,0 +1,2 @@
+\frac{{a}}{{2}}
+
diff --git a/tests/15.xhtml b/tests/15.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/15.xhtml
@@ -0,0 +1,16 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mfrac>
+          <mi>a</mi>
+          <mn>2</mn>
+        </mfrac>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/16.tex b/tests/16.tex
new file mode 100644
--- /dev/null
+++ b/tests/16.tex
@@ -0,0 +1,2 @@
+3\times4
+
diff --git a/tests/16.xhtml b/tests/16.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/16.xhtml
@@ -0,0 +1,15 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mn>3</mn>
+        <mo>&#215;</mo>
+        <mn>4</mn>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/17.tex b/tests/17.tex
new file mode 100644
--- /dev/null
+++ b/tests/17.tex
@@ -0,0 +1,1 @@
+x*4 = 4*x
diff --git a/tests/17.xhtml b/tests/17.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/17.xhtml
@@ -0,0 +1,19 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mi>x</mi>
+        <mo>*</mo>
+        <mn>4</mn>
+        <mo>=</mo>
+        <mn>4</mn>
+        <mo>*</mo>
+        <mi>x</mi>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/18.tex b/tests/18.tex
new file mode 100644
--- /dev/null
+++ b/tests/18.tex
@@ -0,0 +1,1 @@
+1.3 \times .2
diff --git a/tests/18.xhtml b/tests/18.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/18.xhtml
@@ -0,0 +1,18 @@
+<?xml version='1.0' ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
+  </head>
+  <body>
+    <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+      <mrow>
+        <mn>1</mn>
+        <mo>.</mo>
+        <mn>3</mn>
+        <mo>&#215;</mo>
+        <mo>.</mo>
+        <mn>2</mn>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/runtests.sh b/tests/runtests.sh
new file mode 100644
--- /dev/null
+++ b/tests/runtests.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+TESTPROG=../dist/build/testTeXMathML/testTeXMathML
+for t in *.tex; do
+    $TESTPROG <$t >tmp
+    diff ${t%.tex}.xhtml tmp >tmpdiff
+    if [ "$?" -ne "0" ]; then
+        echo "Test ${t%.tex} FAILED (< expected, > actual):"
+        cat tmpdiff
+    else
+        echo "Test ${t%.tex} PASSED"
+    fi
+done
diff --git a/texmath.cabal b/texmath.cabal
--- a/texmath.cabal
+++ b/texmath.cabal
@@ -1,5 +1,5 @@
 Name:                texmath
-Version:             0.1.0.2
+Version:             0.1.0.3
 Cabal-version:       >= 1.2
 Build-type:          Simple
 Synopsis:            Conversion of LaTeX math formulas to MathML.
@@ -13,7 +13,26 @@
 Author:              John MacFarlane
 Maintainer:          jgm@berkeley.edu
 Homepage:            http://github.com/jgm/texmath
-Data-Files:          cgi/texmath.xhtml, examples
+Data-Files:          cgi/texmath.xhtml,
+                     tests/runtests.sh,
+                     tests/01.tex, tests/01.xhtml,
+                     tests/02.tex, tests/02.xhtml,
+                     tests/03.tex, tests/03.xhtml,
+                     tests/04.tex, tests/04.xhtml,
+                     tests/05.tex, tests/05.xhtml,
+                     tests/06.tex, tests/06.xhtml,
+                     tests/07.tex, tests/07.xhtml,
+                     tests/08.tex, tests/08.xhtml,
+                     tests/09.tex, tests/09.xhtml,
+                     tests/10.tex, tests/10.xhtml,
+                     tests/11.tex, tests/11.xhtml,
+                     tests/12.tex, tests/12.xhtml,
+                     tests/13.tex, tests/13.xhtml,
+                     tests/14.tex, tests/14.xhtml,
+                     tests/15.tex, tests/15.xhtml,
+                     tests/16.tex, tests/16.xhtml,
+                     tests/17.tex, tests/17.xhtml,
+                     tests/18.tex, tests/18.xhtml
 
 Flag cgi
   description:       Compile cgi executable.
