diff --git a/Text/TeXMath/Parser.hs b/Text/TeXMath/Parser.hs
--- a/Text/TeXMath/Parser.hs
+++ b/Text/TeXMath/Parser.hs
@@ -247,9 +247,9 @@
 
 subSup :: Maybe Bool -> Exp -> GenParser Char st Exp
 subSup limits a = try $ do
-  char '_'
+  symbol "_"
   b <- expr1
-  char '^'
+  symbol "^"
   c <- expr
   return $ case limits of
             Just True  -> EUnderover a b c
@@ -259,6 +259,7 @@
 superOrSubscripted :: Maybe Bool -> Exp -> GenParser Char st Exp
 superOrSubscripted limits a = try $ do
   c <- oneOf "^_"
+  spaces
   b <- expr
   case c of
        '^' -> return $ case limits of
diff --git a/tests/20.omml b/tests/20.omml
new file mode 100644
--- /dev/null
+++ b/tests/20.omml
@@ -0,0 +1,468 @@
+<?xml version='1.0' ?>
+<m:oMathPara>
+  <m:oMathParaPr>
+    <m:jc m:val="center" />
+  </m:oMathParaPr>
+  <m:oMath>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒜</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℬ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒞</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒟</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℰ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℱ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒢</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℋ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℐ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒥</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒦</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℒ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℳ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒩</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒪</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒫</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒬</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℛ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒮</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒯</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒰</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒱</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒲</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒳</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒴</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒵</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒶</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒷</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒸</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒹</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℯ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒻</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℊ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒽</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒾</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝒿</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓀</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓁</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓂</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓃</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℴ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓅</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓆</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓇</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓈</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓉</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓊</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓋</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓌</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓍</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓎</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝓏</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔸</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔹</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℂ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔻</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔼</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔽</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝔾</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℍ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕀</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕁</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕂</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕃</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕄</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℕ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕆</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℙ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℚ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℝ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕊</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕋</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕌</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕍</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕎</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕏</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕐</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>ℤ</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕒</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕓</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕔</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕕</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕖</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕗</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕘</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕙</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕚</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕛</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕜</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕝</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕞</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕟</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕠</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕡</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕢</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕣</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕤</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕥</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕦</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕧</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕨</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕩</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕪</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝕫</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟘</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟙</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟚</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟛</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟜</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟝</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟞</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟟</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟠</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟡</m:t>
+    </m:r>
+    <m:r>
+      <m:rPr />
+      <m:t>𝟘</m:t>
+    </m:r>
+  </m:oMath>
+</m:oMathPara>
diff --git a/tests/20.tex b/tests/20.tex
new file mode 100644
--- /dev/null
+++ b/tests/20.tex
@@ -0,0 +1,115 @@
+\mathcal{A}
+\mathcal{B}
+\mathcal{C}
+\mathcal{D}
+\mathcal{E}
+\mathcal{F}
+\mathcal{G}
+\mathcal{H}
+\mathcal{I}
+\mathcal{J}
+\mathcal{K}
+\mathcal{L}
+\mathcal{M}
+\mathcal{N}
+\mathcal{O}
+\mathcal{P}
+\mathcal{Q}
+\mathcal{R}
+\mathcal{S}
+\mathcal{T}
+\mathcal{U}
+\mathcal{V}
+\mathcal{W}
+\mathcal{X}
+\mathcal{Y}
+\mathcal{Z}
+\mathcal{a}
+\mathcal{b}
+\mathcal{c}
+\mathcal{d}
+\mathcal{e}
+\mathcal{f}
+\mathcal{g}
+\mathcal{h}
+\mathcal{i}
+\mathcal{j}
+\mathcal{k}
+\mathcal{l}
+\mathcal{m}
+\mathcal{n}
+\mathcal{o}
+\mathcal{p}
+\mathcal{q}
+\mathcal{r}
+\mathcal{s}
+\mathcal{t}
+\mathcal{u}
+\mathcal{v}
+\mathcal{w}
+\mathcal{x}
+\mathcal{y}
+\mathcal{z}
+\mathbb{A}
+\mathbb{B}
+\mathbb{C}
+\mathbb{D}
+\mathbb{E}
+\mathbb{F}
+\mathbb{G}
+\mathbb{H}
+\mathbb{I}
+\mathbb{J}
+\mathbb{K}
+\mathbb{L}
+\mathbb{M}
+\mathbb{N}
+\mathbb{O}
+\mathbb{P}
+\mathbb{Q}
+\mathbb{R}
+\mathbb{S}
+\mathbb{T}
+\mathbb{U}
+\mathbb{V}
+\mathbb{W}
+\mathbb{X}
+\mathbb{Y}
+\mathbb{Z}
+\mathbb{a}
+\mathbb{b}
+\mathbb{c}
+\mathbb{d}
+\mathbb{e}
+\mathbb{f}
+\mathbb{g}
+\mathbb{h}
+\mathbb{i}
+\mathbb{j}
+\mathbb{k}
+\mathbb{l}
+\mathbb{m}
+\mathbb{n}
+\mathbb{o}
+\mathbb{p}
+\mathbb{q}
+\mathbb{r}
+\mathbb{s}
+\mathbb{t}
+\mathbb{u}
+\mathbb{v}
+\mathbb{w}
+\mathbb{x}
+\mathbb{y}
+\mathbb{z}
+\mathbb{0}
+\mathbb{1}
+\mathbb{2}
+\mathbb{3}
+\mathbb{4}
+\mathbb{5}
+\mathbb{6}
+\mathbb{7}
+\mathbb{8}
+\mathbb{9}
+\mathbb{0}
diff --git a/tests/20.xhtml b/tests/20.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/20.xhtml
@@ -0,0 +1,127 @@
+<?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>𝒜</mo>
+        <mo>ℬ</mo>
+        <mo>𝒞</mo>
+        <mo>𝒟</mo>
+        <mo>ℰ</mo>
+        <mo>ℱ</mo>
+        <mo>𝒢</mo>
+        <mo>ℋ</mo>
+        <mo>ℐ</mo>
+        <mo>𝒥</mo>
+        <mo>𝒦</mo>
+        <mo>ℒ</mo>
+        <mo>ℳ</mo>
+        <mo>𝒩</mo>
+        <mo>𝒪</mo>
+        <mo>𝒫</mo>
+        <mo>𝒬</mo>
+        <mo>ℛ</mo>
+        <mo>𝒮</mo>
+        <mo>𝒯</mo>
+        <mo>𝒰</mo>
+        <mo>𝒱</mo>
+        <mo>𝒲</mo>
+        <mo>𝒳</mo>
+        <mo>𝒴</mo>
+        <mo>𝒵</mo>
+        <mo>𝒶</mo>
+        <mo>𝒷</mo>
+        <mo>𝒸</mo>
+        <mo>𝒹</mo>
+        <mo>ℯ</mo>
+        <mo>𝒻</mo>
+        <mo>ℊ</mo>
+        <mo>𝒽</mo>
+        <mo>𝒾</mo>
+        <mo>𝒿</mo>
+        <mo>𝓀</mo>
+        <mo>𝓁</mo>
+        <mo>𝓂</mo>
+        <mo>𝓃</mo>
+        <mo>ℴ</mo>
+        <mo>𝓅</mo>
+        <mo>𝓆</mo>
+        <mo>𝓇</mo>
+        <mo>𝓈</mo>
+        <mo>𝓉</mo>
+        <mo>𝓊</mo>
+        <mo>𝓋</mo>
+        <mo>𝓌</mo>
+        <mo>𝓍</mo>
+        <mo>𝓎</mo>
+        <mo>𝓏</mo>
+        <mo>𝔸</mo>
+        <mo>𝔹</mo>
+        <mo>ℂ</mo>
+        <mo>𝔻</mo>
+        <mo>𝔼</mo>
+        <mo>𝔽</mo>
+        <mo>𝔾</mo>
+        <mo>ℍ</mo>
+        <mo>𝕀</mo>
+        <mo>𝕁</mo>
+        <mo>𝕂</mo>
+        <mo>𝕃</mo>
+        <mo>𝕄</mo>
+        <mo>ℕ</mo>
+        <mo>𝕆</mo>
+        <mo>ℙ</mo>
+        <mo>ℚ</mo>
+        <mo>ℝ</mo>
+        <mo>𝕊</mo>
+        <mo>𝕋</mo>
+        <mo>𝕌</mo>
+        <mo>𝕍</mo>
+        <mo>𝕎</mo>
+        <mo>𝕏</mo>
+        <mo>𝕐</mo>
+        <mo>ℤ</mo>
+        <mo>𝕒</mo>
+        <mo>𝕓</mo>
+        <mo>𝕔</mo>
+        <mo>𝕕</mo>
+        <mo>𝕖</mo>
+        <mo>𝕗</mo>
+        <mo>𝕘</mo>
+        <mo>𝕙</mo>
+        <mo>𝕚</mo>
+        <mo>𝕛</mo>
+        <mo>𝕜</mo>
+        <mo>𝕝</mo>
+        <mo>𝕞</mo>
+        <mo>𝕟</mo>
+        <mo>𝕠</mo>
+        <mo>𝕡</mo>
+        <mo>𝕢</mo>
+        <mo>𝕣</mo>
+        <mo>𝕤</mo>
+        <mo>𝕥</mo>
+        <mo>𝕦</mo>
+        <mo>𝕧</mo>
+        <mo>𝕨</mo>
+        <mo>𝕩</mo>
+        <mo>𝕪</mo>
+        <mo>𝕫</mo>
+        <mo>𝟘</mo>
+        <mo>𝟙</mo>
+        <mo>𝟚</mo>
+        <mo>𝟛</mo>
+        <mo>𝟜</mo>
+        <mo>𝟝</mo>
+        <mo>𝟞</mo>
+        <mo>𝟟</mo>
+        <mo>𝟠</mo>
+        <mo>𝟡</mo>
+        <mo>𝟘</mo>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/tests/21.omml b/tests/21.omml
new file mode 100644
--- /dev/null
+++ b/tests/21.omml
@@ -0,0 +1,58 @@
+<?xml version='1.0' ?>
+<m:oMathPara>
+  <m:oMathParaPr>
+    <m:jc m:val="center" />
+  </m:oMathParaPr>
+  <m:oMath>
+    <m:sSub>
+      <m:e>
+        <m:r>
+          <m:rPr />
+          <m:t>e</m:t>
+        </m:r>
+      </m:e>
+      <m:sub>
+        <m:r>
+          <m:rPr />
+          <m:t>1</m:t>
+        </m:r>
+      </m:sub>
+    </m:sSub>
+    <m:r>
+      <m:rPr />
+      <m:t>=</m:t>
+    </m:r>
+    <m:sSup>
+      <m:e>
+        <m:r>
+          <m:rPr />
+          <m:t>b</m:t>
+        </m:r>
+      </m:e>
+      <m:sup>
+        <m:r>
+          <m:rPr />
+          <m:t>2</m:t>
+        </m:r>
+      </m:sup>
+    </m:sSup>
+    <m:r>
+      <m:rPr />
+      <m:t>+</m:t>
+    </m:r>
+    <m:sSup>
+      <m:e>
+        <m:r>
+          <m:rPr />
+          <m:t>c</m:t>
+        </m:r>
+      </m:e>
+      <m:sup>
+        <m:r>
+          <m:rPr />
+          <m:t>22</m:t>
+        </m:r>
+      </m:sup>
+    </m:sSup>
+  </m:oMath>
+</m:oMathPara>
diff --git a/tests/21.tex b/tests/21.tex
new file mode 100644
--- /dev/null
+++ b/tests/21.tex
@@ -0,0 +1,1 @@
+e_ 1 = b^ 2 + c^ {22}
diff --git a/tests/21.xhtml b/tests/21.xhtml
new file mode 100644
--- /dev/null
+++ b/tests/21.xhtml
@@ -0,0 +1,26 @@
+<?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>e</mi>
+          <mn>1</mn>
+        </msub>
+        <mo>=</mo>
+        <msup>
+          <mi>b</mi>
+          <mn>2</mn>
+        </msup>
+        <mo>+</mo>
+        <msup>
+          <mi>c</mi>
+          <mn>22</mn>
+        </msup>
+      </mrow>
+    </math>
+  </body>
+</html>
diff --git a/texmath.cabal b/texmath.cabal
--- a/texmath.cabal
+++ b/texmath.cabal
@@ -1,5 +1,5 @@
 Name:                texmath
-Version:             0.6.0.1
+Version:             0.6.0.2
 Cabal-Version:       >= 1.6
 Build-type:          Custom
 Synopsis:            Conversion of LaTeX math formulas to MathML or OMML.
@@ -44,6 +44,8 @@
                      tests/17.tex, tests/17.xhtml, tests/17.omml,
                      tests/18.tex, tests/18.xhtml, tests/18.omml,
                      tests/19.tex, tests/19.xhtml, tests/19.omml,
+                     tests/20.tex, tests/20.xhtml, tests/20.omml,
+                     tests/21.tex, tests/21.xhtml, tests/21.omml,
                      tests/axiom_of_power_set.tex, tests/axiom_of_power_set.xhtml, tests/axiom_of_power_set.omml,
                      tests/binomial_coefficient.tex, tests/binomial_coefficient.xhtml, tests/binomial_coefficient.omml,
                      tests/complex_number.tex, tests/complex_number.xhtml, tests/complex_number.omml,
