texmath 0.1.0.2 → 0.1.0.3
raw patch · 42 files changed
+867/−65 lines, 42 files
Files
- Text/TeXMath/MathMLWriter.hs +1/−2
- Text/TeXMath/Parser.hs +5/−12
- cgi/texmath.xhtml +1/−1
- examples +0/−48
- tests/01.tex +2/−0
- tests/01.xhtml +37/−0
- tests/02.tex +4/−0
- tests/02.xhtml +32/−0
- tests/03.tex +2/−0
- tests/03.xhtml +24/−0
- tests/04.tex +2/−0
- tests/04.xhtml +35/−0
- tests/05.tex +3/−0
- tests/05.xhtml +53/−0
- tests/06.tex +3/−0
- tests/06.xhtml +61/−0
- tests/07.tex +2/−0
- tests/07.xhtml +38/−0
- tests/08.tex +4/−0
- tests/08.xhtml +55/−0
- tests/09.tex +2/−0
- tests/09.xhtml +35/−0
- tests/10.tex +6/−0
- tests/10.xhtml +84/−0
- tests/11.tex +4/−0
- tests/11.xhtml +56/−0
- tests/12.tex +7/−0
- tests/12.xhtml +61/−0
- tests/13.tex +5/−0
- tests/13.xhtml +111/−0
- tests/14.tex +2/−0
- tests/14.xhtml +23/−0
- tests/15.tex +2/−0
- tests/15.xhtml +16/−0
- tests/16.tex +2/−0
- tests/16.xhtml +15/−0
- tests/17.tex +1/−0
- tests/17.xhtml +19/−0
- tests/18.tex +1/−0
- tests/18.xhtml +18/−0
- tests/runtests.sh +12/−0
- texmath.cabal +21/−2
Text/TeXMath/MathMLWriter.hs view
@@ -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
Text/TeXMath/Parser.hs view
@@ -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 ";")
cgi/texmath.xhtml view
@@ -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(){
− examples
@@ -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}-
+ tests/01.tex view
@@ -0,0 +1,2 @@+x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}+
+ tests/01.xhtml view
@@ -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>±</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>
+ tests/02.tex view
@@ -0,0 +1,4 @@+2 = \left(+ \frac{\left(3-x\right) \times 2}{3-x}+ \right)+
+ tests/02.xhtml view
@@ -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>×</mo>+ <mn>2</mn>+ </mrow>+ <mrow>+ <mn>3</mn>+ <mo>-</mo>+ <mi>x</mi>+ </mrow>+ </mfrac>+ <mo stretchy="true">)</mo>+ </mrow>+ </math>+ </body>+</html>
+ tests/03.tex view
@@ -0,0 +1,2 @@+ax^2 + bx + c = 0+
+ tests/03.xhtml view
@@ -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>
+ tests/04.tex view
@@ -0,0 +1,2 @@+S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}+
+ tests/04.xhtml view
@@ -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>
+ tests/05.tex view
@@ -0,0 +1,3 @@+\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds+ = \int_a^x f(y)(x-y)\,dy+
+ tests/05.xhtml view
@@ -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>∫</mo>+ <mi>a</mi>+ <mi>x</mi>+ </msubsup>+ <mspace width="-0.167em" />+ <mspace width="-0.167em" />+ <mspace width="-0.167em" />+ <msubsup>+ <mo>∫</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>∫</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>
+ tests/06.tex view
@@ -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)}+
+ tests/06.xhtml view
@@ -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>∑</mo>+ <mrow>+ <mi>m</mi>+ <mo>=</mo>+ <mn>1</mn>+ </mrow>+ <mo>∞</mo>+ </msubsup>+ <msubsup>+ <mo>∑</mo>+ <mrow>+ <mi>n</mi>+ <mo>=</mo>+ <mn>1</mn>+ </mrow>+ <mo>∞</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>
+ tests/07.tex view
@@ -0,0 +1,2 @@+u'' + p(x)u' + q(x)u=f(x),\quad x>a+
+ tests/07.xhtml view
@@ -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>ʹ</mo>+ <mo>ʹ</mo>+ <mo>+</mo>+ <mi>p</mi>+ <mo>(</mo>+ <mi>x</mi>+ <mo>)</mo>+ <mi>u</mi>+ <mo>ʹ</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>></mo>+ <mi>a</mi>+ </mrow>+ </math>+ </body>+</html>
+ tests/08.tex view
@@ -0,0 +1,4 @@+|\bar{z}| = |z|,+ |(\bar{z})^n| = |z|^n,+ \arg(z^n) = n \arg(z)+
+ tests/08.xhtml view
@@ -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>∣</mo>+ <mover>+ <mi>z</mi>+ <mo accent="true">‾</mo>+ </mover>+ <mo>∣</mo>+ <mo>=</mo>+ <mo>∣</mo>+ <mi>z</mi>+ <mo>∣</mo>+ <mo>,</mo>+ <mo>∣</mo>+ <mo>(</mo>+ <mover>+ <mi>z</mi>+ <mo accent="true">‾</mo>+ </mover>+ <msup>+ <mo>)</mo>+ <mi>n</mi>+ </msup>+ <mo>∣</mo>+ <mo>=</mo>+ <mo>∣</mo>+ <mi>z</mi>+ <msup>+ <mo>∣</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>
+ tests/09.tex view
@@ -0,0 +1,2 @@+\lim_{z\rightarrow z_0} f(z)=f(z_0)+
+ tests/09.xhtml view
@@ -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>→</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>
+ tests/10.tex view
@@ -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+
+ tests/10.xhtml view
@@ -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>φ</mo>+ <mi>n</mi>+ </msub>+ <mo>(</mo>+ <mo>κ</mo>+ <mo>)</mo>+ <mo>=</mo>+ <mfrac>+ <mn>1</mn>+ <mrow>+ <mn>4</mn>+ <msup>+ <mo>π</mo>+ <mn>2</mn>+ </msup>+ <msup>+ <mo>κ</mo>+ <mn>2</mn>+ </msup>+ </mrow>+ </mfrac>+ <msubsup>+ <mo>∫</mo>+ <mn>0</mn>+ <mo>∞</mo>+ </msubsup>+ <mfrac>+ <mrow>+ <mi>sin</mi>+ <mo>(</mo>+ <mo>κ</mo>+ <mi>R</mi>+ <mo>)</mo>+ </mrow>+ <mrow>+ <mo>κ</mo>+ <mi>R</mi>+ </mrow>+ </mfrac>+ <mfrac>+ <mo>∂</mo>+ <mrow>+ <mo>∂</mo>+ <mi>R</mi>+ </mrow>+ </mfrac>+ <mo stretchy="true">[</mo>+ <msup>+ <mi>R</mi>+ <mn>2</mn>+ </msup>+ <mfrac>+ <mrow>+ <mo>∂</mo>+ <msub>+ <mi>D</mi>+ <mi>n</mi>+ </msub>+ <mo>(</mo>+ <mi>R</mi>+ <mo>)</mo>+ </mrow>+ <mrow>+ <mo>∂</mo>+ <mi>R</mi>+ </mrow>+ </mfrac>+ <mo stretchy="true">]</mo>+ <mspace width="0.167em" />+ <mi>d</mi>+ <mi>R</mi>+ </mrow>+ </math>+ </body>+</html>
+ tests/11.tex view
@@ -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}+
+ tests/11.xhtml view
@@ -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>φ</mo>+ <mi>n</mi>+ </msub>+ <mo>(</mo>+ <mo>κ</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>κ</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>≪</mo>+ <mo>κ</mo>+ <mo>≪</mo>+ <mfrac>+ <mn>1</mn>+ <msub>+ <mi>l</mi>+ <mn>0</mn>+ </msub>+ </mfrac>+ </mrow>+ </math>+ </body>+</html>
+ tests/12.tex view
@@ -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}+
+ tests/12.xhtml view
@@ -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>≤</mo>+ <mi>x</mi>+ <mo><</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>
+ tests/13.tex view
@@ -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!}+
+ tests/13.xhtml view
@@ -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>…</mo>+ <mo>,</mo>+ <msub>+ <mi>a</mi>+ <mi>p</mi>+ </msub>+ <mo>;</mo>+ <msub>+ <mi>c</mi>+ <mn>1</mn>+ </msub>+ <mo>,</mo>+ <mo>…</mo>+ <mo>,</mo>+ <msub>+ <mi>c</mi>+ <mi>q</mi>+ </msub>+ <mo>;</mo>+ <mi>z</mi>+ <mo>)</mo>+ <mo>=</mo>+ <msubsup>+ <mo>∑</mo>+ <mrow>+ <mi>n</mi>+ <mo>=</mo>+ <mn>0</mn>+ </mrow>+ <mo>∞</mo>+ </msubsup>+ <mfrac>+ <mrow>+ <mo>(</mo>+ <msub>+ <mi>a</mi>+ <mn>1</mn>+ </msub>+ <msub>+ <mo>)</mo>+ <mi>n</mi>+ </msub>+ <mo>⋯</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>⋯</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>
+ tests/14.tex view
@@ -0,0 +1,2 @@+ \frac {a}{b}\ \tfrac {a}{b}+
+ tests/14.xhtml view
@@ -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>
+ tests/15.tex view
@@ -0,0 +1,2 @@+\frac{{a}}{{2}}+
+ tests/15.xhtml view
@@ -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>
+ tests/16.tex view
@@ -0,0 +1,2 @@+3\times4+
+ tests/16.xhtml view
@@ -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>×</mo>+ <mn>4</mn>+ </mrow>+ </math>+ </body>+</html>
+ tests/17.tex view
@@ -0,0 +1,1 @@+x*4 = 4*x
+ tests/17.xhtml view
@@ -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>
+ tests/18.tex view
@@ -0,0 +1,1 @@+1.3 \times .2
+ tests/18.xhtml view
@@ -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>×</mo>+ <mo>.</mo>+ <mn>2</mn>+ </mrow>+ </math>+ </body>+</html>
+ tests/runtests.sh view
@@ -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
texmath.cabal view
@@ -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.