packages feed

texmath 0.5.0.1 → 0.5.0.2

raw patch · 16 files changed

+35/−27 lines, 16 files

Files

Text/TeXMath/Parser.hs view
@@ -392,8 +392,8 @@ identifier = lexeme (P.identifier lexer)  operator :: CharParser st String-operator = lexeme $ liftM (:[]) (opLetter texMathDef)-                 <|> many1 (char '\'')+operator = lexeme $ many1 (char '\'')+                 <|> liftM (:[]) (opLetter texMathDef)  symbol :: String -> CharParser st String symbol = lexeme . P.symbol lexer@@ -459,7 +459,7 @@ symbols :: M.Map String Exp symbols = M.fromList [              ("+", ESymbol Bin "+")-           , ("-", ESymbol Bin "-")+           , ("-", ESymbol Bin "\x2212")            , ("*", ESymbol Bin "*")            , (",", ESymbol Pun ",")            , (".", ESymbol Pun ".")
tests/01.xhtml view
@@ -10,7 +10,7 @@         <mo>=</mo>         <mfrac>           <mrow>-            <mo>-</mo>+            <mo>&#8722;</mo>             <mi>b</mi>             <mo>&#177;</mo>             <msqrt>@@ -19,7 +19,7 @@                   <mi>b</mi>                   <mn>2</mn>                 </msup>-                <mo>-</mo>+                <mo>&#8722;</mo>                 <mn>4</mn>                 <mi>a</mi>                 <mi>c</mi>
tests/02.xhtml view
@@ -15,7 +15,7 @@               <mrow>                 <mo stretchy="true">(</mo>                 <mn>3</mn>-                <mo>-</mo>+                <mo>&#8722;</mo>                 <mi>x</mi>                 <mo stretchy="true">)</mo>               </mrow>@@ -24,7 +24,7 @@             </mrow>             <mrow>               <mn>3</mn>-              <mo>-</mo>+              <mo>&#8722;</mo>               <mi>x</mi>             </mrow>           </mfrac>
tests/04.xhtml view
@@ -15,13 +15,13 @@           <mi>S</mi>           <mtext mathvariant="normal">old</mtext>         </msub>-        <mo>-</mo>+        <mo>&#8722;</mo>         <mfrac>           <msup>             <mrow>               <mo stretchy="true">(</mo>               <mn>5</mn>-              <mo>-</mo>+              <mo>&#8722;</mo>               <mi>T</mi>               <mo stretchy="true">)</mo>             </mrow>
tests/05.xhtml view
@@ -41,7 +41,7 @@         <mo stretchy="false">)</mo>         <mo stretchy="false">(</mo>         <mi>x</mi>-        <mo>-</mo>+        <mo>&#8722;</mo>         <mi>y</mi>         <mo stretchy="false">)</mo>         <mspace width="0.167em" />
tests/07.xhtml view
@@ -7,8 +7,7 @@     <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">       <mrow>         <mi>u</mi>-        <mo>&#697;</mo>-        <mo>&#697;</mo>+        <mo>&#698;</mo>         <mo>+</mo>         <mi>p</mi>         <mo stretchy="false">(</mo>
tests/11.xhtml view
@@ -25,7 +25,7 @@         <msup>           <mo>&#954;</mo>           <mrow>-            <mo>-</mo>+            <mo>&#8722;</mo>             <mn>11</mn>             <mo>/</mo>             <mn>3</mn>
tests/12.xhtml view
@@ -19,7 +19,7 @@                 <mn>1</mn>               </mtd>               <mtd>-                <mo>-</mo>+                <mo>&#8722;</mo>                 <mn>1</mn>                 <mo>&#8804;</mo>                 <mi>x</mi>@@ -43,7 +43,7 @@             <mtr>               <mtd>                 <mn>1</mn>-                <mo>-</mo>+                <mo>&#8722;</mo>                 <msup>                   <mi>x</mi>                   <mn>2</mn>
tests/binomial_coefficient.xhtml view
@@ -46,7 +46,7 @@             <mspace width="0.167em" />             <mo stretchy="false">(</mo>             <mi>n</mi>-            <mo>-</mo>+            <mo>&#8722;</mo>             <mi>k</mi>             <mo stretchy="false">)</mo>             <mo>!</mo>
tests/moore_determinant.xhtml view
@@ -36,7 +36,7 @@                     <mi>q</mi>                     <mrow>                       <mi>n</mi>-                      <mo>-</mo>+                      <mo>&#8722;</mo>                       <mn>1</mn>                     </mrow>                   </msup>@@ -68,7 +68,7 @@                     <mi>q</mi>                     <mrow>                       <mi>n</mi>-                      <mo>-</mo>+                      <mo>&#8722;</mo>                       <mn>1</mn>                     </mrow>                   </msup>@@ -114,7 +114,7 @@                     <mi>q</mi>                     <mrow>                       <mi>n</mi>-                      <mo>-</mo>+                      <mo>&#8722;</mo>                       <mn>1</mn>                     </mrow>                   </msup>
tests/quadratic_formula.xhtml view
@@ -10,7 +10,7 @@         <mo>=</mo>         <mfrac>           <mrow>-            <mo>-</mo>+            <mo>&#8722;</mo>             <mi>b</mi>             <mo>&#177;</mo>             <msqrt>@@ -19,7 +19,7 @@                   <mi>b</mi>                   <mn>2</mn>                 </msup>-                <mo>-</mo>+                <mo>&#8722;</mo>                 <mn>4</mn>                 <mi>a</mi>                 <mi>c</mi>
tests/schwinger_dyson.xhtml view
@@ -33,7 +33,7 @@           <mo stretchy="true">&#10217;</mo>         </mrow>         <mo>=</mo>-        <mo>-</mo>+        <mo>&#8722;</mo>         <mtext mathvariant="normal">i</mtext>         <mrow>           <mo stretchy="true">&#10216;</mo>
tests/sophomores_dream.xhtml view
@@ -30,7 +30,7 @@         </munderover>         <mrow>           <mo stretchy="false">(</mo>-          <mo>-</mo>+          <mo>&#8722;</mo>           <mn>1</mn>           <msup>             <mo stretchy="false">)</mo>@@ -44,7 +44,7 @@           <msup>             <mi>n</mi>             <mrow>-              <mo>-</mo>+              <mo>&#8722;</mo>               <mi>n</mi>             </mrow>           </msup>
tests/sphere_volume.xhtml view
@@ -116,7 +116,7 @@               </msubsup>               <mo> </mo>               <mo stretchy="false">(</mo>-              <mo>-</mo>+              <mo>&#8722;</mo>               <mi>cos</mi>               <mo>&#952;</mo>               <mo stretchy="false">)</mo>
texmath.cabal view
@@ -1,5 +1,5 @@ Name:                texmath-Version:             0.5.0.1+Version:             0.5.0.2 Cabal-version:       >= 1.2 Build-type:          Custom Synopsis:            Conversion of LaTeX math formulas to MathML.
texmath.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module Main where  import Text.TeXMath@@ -15,9 +16,17 @@         unode "meta" ()     , unode "body" x ] +getUTF8Contents :: IO String+getUTF8Contents =+#if MIN_VERSION_base(4,2,0)+       hSetEncoding stdin utf8 >> hGetContents stdin+#else+       hGetContents stdin+#endif+ main :: IO () main = do-  inp <- getContents+  inp <- getUTF8Contents   let (ms, rest) = parseMacroDefinitions inp   case (texMathToMathML DisplayBlock $! applyMacros ms rest) of         Left err         -> hPutStrLn stderr err