packages feed

texmath 0.6.0.5 → 0.6.0.6

raw patch · 19 files changed

+465/−44 lines, 19 files

Files

Text/TeXMath/MathML.hs view
@@ -83,7 +83,7 @@   , ("\\dfrac", withAttribute "displaystyle" "true" .                   unode "mstyle" . unode "mfrac")   , ("\\sqrt", unode "mroot")-  , ("\\stackrel", unode "mover")+  , ("\\stackrel", unode "mover" . reverse)   , ("\\overset", unode "mover")   , ("\\underset", unode "munder")   , ("\\binom", showBinom)
Text/TeXMath/Parser.hs view
@@ -246,18 +246,25 @@  isConvertible :: Exp -> Bool isConvertible (EMathOperator x) = x `elem` convertibleOps-  where convertibleOps = ["lim","liminf","limsup","inf","sup"]+  where convertibleOps = [ "lim","liminf","limsup","inf","sup"+                         , "min","max","Pr","det","gcd"+                         ] isConvertible (ESymbol Rel _) = True isConvertible (ESymbol Bin _) = True-isConvertible (EUnder _ _)    = True-isConvertible (EOver _ _)     = True-isConvertible (EUnderover _ _ _) = True isConvertible (ESymbol Op x) = x `elem` convertibleSyms   where convertibleSyms = ["\x2211","\x220F","\x22C2",            "\x22C3","\x22C0","\x22C1","\x2A05","\x2A06",            "\x2210","\x2A01","\x2A02","\x2A00","\x2A04"] isConvertible _ = False +-- check if sub/superscripts should always be under and over the expression+isUnderover :: Exp -> Bool+isUnderover (EOver _ (ESymbol Accent "\xFE37")) = True   -- \overbrace+isUnderover (EOver _ (ESymbol Accent "\x23B4")) = True   -- \overbracket+isUnderover (EUnder _ (ESymbol Accent "\xFE38")) = True  -- \underbrace+isUnderover (EUnder _ (ESymbol Accent "\x23B5")) = True  -- \underbracket+isUnderover _ = False+ subSup :: Maybe Bool -> Exp -> TP Exp subSup limits a = try $ do   let sub1 = symbol "_" >> expr1@@ -267,6 +274,7 @@   return $ case limits of             Just True  -> EUnderover a b c             Nothing | isConvertible a -> EDownup a b c+                    | isUnderover a -> EUnderover a b c             _          -> ESubsup a b c  superOrSubscripted :: Maybe Bool -> Exp -> TP Exp@@ -278,10 +286,12 @@        '^' -> return $ case limits of                         Just True  -> EOver a b                         Nothing | isConvertible a -> EUp a b+                                | isUnderover a -> EOver a b                         _          -> ESuper a b        '_' -> return $ case limits of                         Just True  -> EUnder a b                         Nothing | isConvertible a -> EDown a b+                                | isUnderover a -> EUnder a b                         _          -> ESub a b        _   -> pzero @@ -531,8 +541,8 @@            , ("\\nu", EIdentifier "\x03BD")            , ("\\omega", EIdentifier "\x03C9")            , ("\\Omega", ESymbol Op "\x03A9")-           , ("\\phi", EIdentifier "\x03C6")-           , ("\\varphi", EIdentifier "\x03D5")+           , ("\\phi", EIdentifier "\x03D5")+           , ("\\varphi", EIdentifier "\x03C6")            , ("\\Phi", ESymbol Op "\x03A6")            , ("\\pi", EIdentifier "\x03C0")            , ("\\Pi", ESymbol Op "\x03A0")
tests/10.omml view
@@ -8,7 +8,7 @@       <m:e>         <m:r>           <m:rPr />-          <m:t>φ</m:t>+          <m:t>ϕ</m:t>         </m:r>       </m:e>       <m:sub>
tests/10.xhtml view
@@ -7,7 +7,7 @@     <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">       <mrow>         <msub>-          <mi>φ</mi>+          <mi>ϕ</mi>           <mi>n</mi>         </msub>         <mo stretchy="false">(</mo>
tests/11.omml view
@@ -8,7 +8,7 @@       <m:e>         <m:r>           <m:rPr />-          <m:t>φ</m:t>+          <m:t>ϕ</m:t>         </m:r>       </m:e>       <m:sub>
tests/11.xhtml view
@@ -7,7 +7,7 @@     <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">       <mrow>         <msub>-          <mi>φ</mi>+          <mi>ϕ</mi>           <mi>n</mi>         </msub>         <mo stretchy="false">(</mo>
tests/differentiable_manifold.omml view
@@ -177,7 +177,7 @@                   </m:f>                   <m:r>                     <m:rPr />-                    <m:t>φ</m:t>+                    <m:t>ϕ</m:t>                   </m:r>                   <m:r>                     <m:rPr />@@ -267,7 +267,7 @@                   </m:f>                   <m:r>                     <m:rPr />-                    <m:t>φ</m:t>+                    <m:t>ϕ</m:t>                   </m:r>                   <m:r>                     <m:rPr />
tests/differentiable_manifold.xhtml view
@@ -56,7 +56,7 @@                       <mi>t</mi>                     </mrow>                   </mfrac>-                  <mi>φ</mi>+                  <mi>ϕ</mi>                   <mo>∘</mo>                   <msub>                     <mi>γ</mi>@@ -84,7 +84,7 @@                       <mi>t</mi>                     </mrow>                   </mfrac>-                  <mi>φ</mi>+                  <mi>ϕ</mi>                   <mo>∘</mo>                   <msub>                     <mi>γ</mi>
tests/schwinger_dyson.omml view
@@ -50,7 +50,7 @@                     </m:r>                     <m:r>                       <m:rPr />-                      <m:t>φ</m:t>+                      <m:t>ϕ</m:t>                     </m:r>                   </m:den>                 </m:f>@@ -64,7 +64,7 @@                 </m:r>                 <m:r>                   <m:rPr />-                  <m:t>φ</m:t>+                  <m:t>ϕ</m:t>                 </m:r>                 <m:r>                   <m:rPr />@@ -133,7 +133,7 @@                 </m:r>                 <m:r>                   <m:rPr />-                  <m:t>φ</m:t>+                  <m:t>ϕ</m:t>                 </m:r>                 <m:r>                   <m:rPr />@@ -156,7 +156,7 @@                     </m:r>                     <m:r>                       <m:rPr />-                      <m:t>φ</m:t>+                      <m:t>ϕ</m:t>                     </m:r>                   </m:den>                 </m:f>@@ -170,7 +170,7 @@                 </m:r>                 <m:r>                   <m:rPr />-                  <m:t>φ</m:t>+                  <m:t>ϕ</m:t>                 </m:r>                 <m:r>                   <m:rPr />
tests/schwinger_dyson.xhtml view
@@ -18,12 +18,12 @@                 <mi>δ</mi>                 <mrow>                   <mi>δ</mi>-                  <mi>φ</mi>+                  <mi>ϕ</mi>                 </mrow>               </mfrac>               <mi>F</mi>               <mo stretchy="false">[</mo>-              <mi>φ</mi>+              <mi>ϕ</mi>               <mo stretchy="false">]</mo>               <mo stretchy="true">}</mo>             </mrow>@@ -45,18 +45,18 @@               <mo stretchy="true">{</mo>               <mi>F</mi>               <mo stretchy="false">[</mo>-              <mi>φ</mi>+              <mi>ϕ</mi>               <mo stretchy="false">]</mo>               <mfrac>                 <mi>δ</mi>                 <mrow>                   <mi>δ</mi>-                  <mi>φ</mi>+                  <mi>ϕ</mi>                 </mrow>               </mfrac>               <mi>S</mi>               <mo stretchy="false">[</mo>-              <mi>φ</mi>+              <mi>ϕ</mi>               <mo stretchy="false">]</mo>               <mo stretchy="true">}</mo>             </mrow>
tests/sphere_volume.omml view
@@ -26,7 +26,7 @@     </m:r>     <m:r>       <m:rPr />-      <m:t>φ</m:t>+      <m:t>ϕ</m:t>     </m:r>     <m:r>       <m:rPr />@@ -225,7 +225,7 @@           </m:r>           <m:r>             <m:rPr />-            <m:t>φ</m:t>+            <m:t>ϕ</m:t>           </m:r>         </m:e>       </m:mr>@@ -270,7 +270,7 @@           </m:r>           <m:r>             <m:rPr />-            <m:t>φ</m:t>+            <m:t>ϕ</m:t>           </m:r>           <m:r>             <m:rPr />@@ -381,7 +381,7 @@           </m:r>           <m:r>             <m:rPr />-            <m:t>φ</m:t>+            <m:t>ϕ</m:t>           </m:r>           <m:sSubSup>             <m:e>
tests/sphere_volume.xhtml view
@@ -11,7 +11,7 @@         <mo stretchy="false">{</mo>         <mn>0</mn>         <mo>≤</mo>-        <mi>φ</mi>+        <mi>ϕ</mi>         <mo>≤</mo>         <mn>2</mn>         <mi>π</mi>@@ -56,7 +56,7 @@               <mi>θ</mi>               <mspace width="0.167em" />               <mtext mathvariant="normal">d</mtext>-              <mi>φ</mi>+              <mi>ϕ</mi>             </mtd>           </mtr>           <mtr>@@ -73,7 +73,7 @@               </msubsup>               <mspace width="-0.167em" />               <mtext mathvariant="normal">d</mtext>-              <mi>φ</mi>+              <mi>ϕ</mi>               <mspace width="0.167em" />               <msubsup>                 <mo>∫</mo>@@ -105,7 +105,7 @@             <mtd columnalign="right" />             <mtd columnalign="left">               <mo>=</mo>-              <mi>φ</mi>+              <mi>ϕ</mi>               <msubsup>                 <mo minsize="1.6" maxsize="1.6" stretchy="true">∣</mo>                 <mn>0</mn>
+ tests/stackrel.omml view
@@ -0,0 +1,40 @@+<?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>u</m:t>+        </m:r>+      </m:e>+      <m:sub>+        <m:r>+          <m:rPr />+          <m:t>n</m:t>+        </m:r>+      </m:sub>+    </m:sSub>+    <m:limUpp>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>w</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>→</m:t>+        </m:r>+      </m:lim>+    </m:limUpp>+    <m:r>+      <m:rPr />+      <m:t>u</m:t>+    </m:r>+  </m:oMath>+</m:oMathPara>
+ tests/stackrel.tex view
@@ -0,0 +1,2 @@+u_n \stackrel{w}{\to} u+
+ tests/stackrel.xhtml view
@@ -0,0 +1,21 @@+<?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>u</mi>+          <mi>n</mi>+        </msub>+        <mover>+          <mo>→</mo>+          <mi>w</mi>+        </mover>+        <mi>u</mi>+      </mrow>+    </math>+  </body>+</html>
tests/subsup.omml view
@@ -14,20 +14,16 @@       <m:sub>         <m:r>           <m:rPr />-          <m:t>a</m:t>+          <m:t>b</m:t>         </m:r>       </m:sub>       <m:sup>         <m:r>           <m:rPr />-          <m:t>b</m:t>+          <m:t>a</m:t>         </m:r>       </m:sup>     </m:sSubSup>-    <m:r>-      <m:rPr />-      <m:t>=</m:t>-    </m:r>     <m:sSubSup>       <m:e>         <m:r>@@ -48,5 +44,268 @@         </m:r>       </m:sup>     </m:sSubSup>+    <m:limLow>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>min</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>A</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:limLow>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>max</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>B</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:limLow>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>det</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>C</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:limLow>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>Pr</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>A</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:limLow>+      <m:e>+        <m:r>+          <m:rPr />+          <m:t>gcd</m:t>+        </m:r>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>A</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:sSup>+      <m:e>+        <m:acc>+          <m:accPr>+            <m:chr m:val="." />+          </m:accPr>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>u</m:t>+            </m:r>+          </m:e>+        </m:acc>+      </m:e>+      <m:sup>+        <m:r>+          <m:rPr />+          <m:t>2</m:t>+        </m:r>+      </m:sup>+    </m:sSup>+    <m:sSub>+      <m:e>+        <m:bar>+          <m:barPr>+            <m:pos m:val="top" />+          </m:barPr>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>u</m:t>+            </m:r>+          </m:e>+        </m:bar>+      </m:e>+      <m:sub>+        <m:r>+          <m:rPr />+          <m:t>ɛ</m:t>+        </m:r>+      </m:sub>+    </m:sSub>+    <m:sSubSup>+      <m:e>+        <m:bar>+          <m:barPr>+            <m:pos m:val="bot" />+          </m:barPr>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>u</m:t>+            </m:r>+          </m:e>+        </m:bar>+      </m:e>+      <m:sub>+        <m:r>+          <m:rPr />+          <m:t>b</m:t>+        </m:r>+      </m:sub>+      <m:sup>+        <m:r>+          <m:rPr />+          <m:t>a</m:t>+        </m:r>+      </m:sup>+    </m:sSubSup>+    <m:limUpp>+      <m:e>+        <m:acc>+          <m:accPr>+            <m:chr m:val="︷" />+          </m:accPr>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>a</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>+</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>b</m:t>+            </m:r>+          </m:e>+        </m:acc>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr>+            <m:sty m:val="p" />+          </m:rPr>+          <m:t>term</m:t>+        </m:r>+      </m:lim>+    </m:limUpp>+    <m:limUpp>+      <m:e>+        <m:acc>+          <m:accPr>+            <m:chr m:val="⎴" />+          </m:accPr>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>a</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>+</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>b</m:t>+            </m:r>+          </m:e>+        </m:acc>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>c</m:t>+        </m:r>+      </m:lim>+    </m:limUpp>+    <m:limLow>+      <m:e>+        <m:limLow>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>a</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>+</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>b</m:t>+            </m:r>+          </m:e>+          <m:lim>+            <m:r>+              <m:rPr />+              <m:t>︸</m:t>+            </m:r>+          </m:lim>+        </m:limLow>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>c</m:t>+        </m:r>+      </m:lim>+    </m:limLow>+    <m:limLow>+      <m:e>+        <m:limLow>+          <m:e>+            <m:r>+              <m:rPr />+              <m:t>a</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>+</m:t>+            </m:r>+            <m:r>+              <m:rPr />+              <m:t>b</m:t>+            </m:r>+          </m:e>+          <m:lim>+            <m:r>+              <m:rPr />+              <m:t>⎵</m:t>+            </m:r>+          </m:lim>+        </m:limLow>+      </m:e>+      <m:lim>+        <m:r>+          <m:rPr />+          <m:t>c</m:t>+        </m:r>+      </m:lim>+    </m:limLow>   </m:oMath> </m:oMathPara>
tests/subsup.tex view
@@ -1,1 +1,4 @@-x_a^b = x^a_b+ x^a_b x_b^a \min_A \max_B \det_C \Pr_A \gcd_A+ \dot{u}^2 \overline{u}_\varepsilon \underline{u}^a_b+ \overbrace{a+b}^{\text{term}} \overbracket{a+b}^{c}+ \underbrace{a+b}_{c} \underbracket{a+b}_{c}
tests/subsup.xhtml view
@@ -8,15 +8,100 @@       <mrow>         <msubsup>           <mi>x</mi>-          <mi>a</mi>           <mi>b</mi>+          <mi>a</mi>         </msubsup>-        <mo>=</mo>         <msubsup>           <mi>x</mi>           <mi>b</mi>           <mi>a</mi>         </msubsup>+        <munder>+          <mi>min</mi>+          <mi>A</mi>+        </munder>+        <munder>+          <mi>max</mi>+          <mi>B</mi>+        </munder>+        <munder>+          <mi>det</mi>+          <mi>C</mi>+        </munder>+        <munder>+          <mi>Pr</mi>+          <mi>A</mi>+        </munder>+        <munder>+          <mi>gcd</mi>+          <mi>A</mi>+        </munder>+        <msup>+          <mover>+            <mi>u</mi>+            <mo accent="true">.</mo>+          </mover>+          <mn>2</mn>+        </msup>+        <msub>+          <mover>+            <mi>u</mi>+            <mo accent="true">¯</mo>+          </mover>+          <mi>ɛ</mi>+        </msub>+        <msubsup>+          <munder>+            <mi>u</mi>+            <mo accent="true">¯</mo>+          </munder>+          <mi>b</mi>+          <mi>a</mi>+        </msubsup>+        <mover>+          <mover>+            <mrow>+              <mi>a</mi>+              <mo>+</mo>+              <mi>b</mi>+            </mrow>+            <mo accent="true">︷</mo>+          </mover>+          <mtext mathvariant="normal">term</mtext>+        </mover>+        <mover>+          <mover>+            <mrow>+              <mi>a</mi>+              <mo>+</mo>+              <mi>b</mi>+            </mrow>+            <mo accent="true">⎴</mo>+          </mover>+          <mi>c</mi>+        </mover>+        <munder>+          <munder>+            <mrow>+              <mi>a</mi>+              <mo>+</mo>+              <mi>b</mi>+            </mrow>+            <mo accent="true">︸</mo>+          </munder>+          <mi>c</mi>+        </munder>+        <munder>+          <munder>+            <mrow>+              <mi>a</mi>+              <mo>+</mo>+              <mi>b</mi>+            </mrow>+            <mo accent="true">⎵</mo>+          </munder>+          <mi>c</mi>+        </munder>       </mrow>     </math>   </body>
texmath.cabal view
@@ -1,5 +1,5 @@ Name:                texmath-Version:             0.6.0.5+Version:             0.6.0.6 Cabal-Version:       >= 1.6 Build-type:          Custom Synopsis:            Conversion of LaTeX math formulas to MathML or OMML.@@ -60,7 +60,8 @@                      tests/unicode.tex, tests/unicode.xhtml, tests/unicode.omml,                      tests/ensuremath.tex, tests/ensuremath.xhtml, tests/ensuremath.omml,                      tests/macros.tex, tests/macros.xhtml, tests/macros.omml,-                     tests/subsup.tex, tests/subsup.xhtml, tests/subsup.omml+                     tests/subsup.tex, tests/subsup.xhtml, tests/subsup.omml,+                     tests/stackrel.tex, tests/stackrel.xhtml, tests/stackrel.omml  Source-repository head   type:              git