packages feed

texmath 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+11/−7 lines, 3 files

Files

Text/TeXMath/Parser.hs view
@@ -167,10 +167,10 @@ inEnvironment :: String               -> GenParser Char st Exp               -> GenParser Char st Exp-inEnvironment envType p = try $ do-  char '\\'-  symbol "begin"-  braces $ symbol envType >> optional (symbol "*")+inEnvironment envType p = do+  try $ do char '\\'+           symbol "begin"+           braces $ symbol envType >> optional (symbol "*")   result <- p   char '\\'   symbol "end"@@ -208,7 +208,7 @@           liftM (ESymbol Ord . (:[])) (satisfy $ not . isAlphaNum)  command :: GenParser Char st String-command = try $ char '\\' >> liftM ('\\':) (identifier <|> count 1 anyChar)+command = try $ char '\\' >> liftM ('\\':) (identifier <|> lexeme (count 1 anyChar))  unaryOps :: [String] unaryOps = ["\\sqrt", "\\surd"]@@ -353,6 +353,8 @@              , ("\\lbrace", ESymbol Open "{")              , ("\\rbrack", ESymbol Close "]")              , ("\\rbrace", ESymbol Close "}")+             , ("\\llbracket", ESymbol Open "\x27E6")+             , ("\\rrbracket", ESymbol Close "\x230B")              , ("\\langle", ESymbol Open "\x3009")              , ("\\rangle", ESymbol Close "\x300A")              , ("\\lfloor", ESymbol Open "\x230A")
testTeXMathML.hs view
@@ -3,6 +3,8 @@ import Text.TeXMath import Text.XML.Light +import System.IO+ inHtml :: Element -> Element inHtml x =   add_attr (Attr (unqual "xmlns") "http://www.w3.org/1999/xhtml") $@@ -17,5 +19,5 @@ main = do   inp <- getContents   case (texMathToMathML DisplayBlock $! inp) of-       Left err         -> putStrLn err+       Left err         -> hPutStrLn stderr err        Right v          -> putStr . ppTopElement . inHtml $ v
texmath.cabal view
@@ -1,5 +1,5 @@ Name:                texmath-Version:             0.1.0.1+Version:             0.1.0.2 Cabal-version:       >= 1.2 Build-type:          Simple Synopsis:            Conversion of LaTeX math formulas to MathML.