-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Conversion of LaTeX math formulas to MathML.
--
-- The texmathml library provides functions to convert LaTeX math
-- formulas to presentation MathML. It supports basic LaTeX and AMS
-- extensions, and it can parse and apply LaTeX macros.
--
-- Use the test flag to install a standalone executable,
-- texmath, that reads a LaTeX formula from stdin and
-- writes MathML to stdout.
--
-- Use the cgi flag to install a cgi script,
-- texmath-cgi.
@package texmath
@version 0.5
-- | Functions for parsing LaTeX macro definitions and applying macros to
-- LateX expressions.
module Text.TeXMath.Macros
data Macro
-- | Parses a string for a list of macro definitions, optionally separated
-- and ended by spaces and TeX comments. Returns the list of macros
-- (which may be empty) and the unparsed portion of the input string.
parseMacroDefinitions :: String -> ([Macro], String)
-- | Applies a list of macros to a string recursively until a fixed point
-- is reached. If there are several macros in the list with the same
-- name, earlier ones will shadow later ones.
applyMacros :: [Macro] -> String -> String
instance Show Macro
-- | Types for representing a structured formula.
module Text.TeXMath.Types
data Exp
ENumber :: String -> Exp
EGrouped :: [Exp] -> Exp
EIdentifier :: String -> Exp
EMathOperator :: String -> Exp
ESymbol :: TeXSymbolType -> String -> Exp
ESpace :: String -> Exp
EBinary :: String -> Exp -> Exp -> Exp
ESub :: Exp -> Exp -> Exp
ESuper :: Exp -> Exp -> Exp
ESubsup :: Exp -> Exp -> Exp -> Exp
EOver :: Exp -> Exp -> Exp
EUnder :: Exp -> Exp -> Exp
EUnderover :: Exp -> Exp -> Exp -> Exp
EUp :: Exp -> Exp -> Exp
EDown :: Exp -> Exp -> Exp
EDownup :: Exp -> Exp -> Exp -> Exp
EUnary :: String -> Exp -> Exp
EScaled :: String -> Exp -> Exp
EStretchy :: Exp -> Exp
EArray :: [Alignment] -> [ArrayLine] -> Exp
EText :: String -> String -> Exp
data TeXSymbolType
Ord :: TeXSymbolType
Op :: TeXSymbolType
Bin :: TeXSymbolType
Rel :: TeXSymbolType
Open :: TeXSymbolType
Close :: TeXSymbolType
Pun :: TeXSymbolType
Accent :: TeXSymbolType
type ArrayLine = [[Exp]]
data Alignment
AlignLeft :: Alignment
AlignCenter :: Alignment
AlignRight :: Alignment
AlignDefault :: Alignment
instance Typeable Exp
instance Typeable Alignment
instance Typeable TeXSymbolType
instance Show Exp
instance Read Exp
instance Eq Exp
instance Data Exp
instance Show Alignment
instance Read Alignment
instance Eq Alignment
instance Data Alignment
instance Show TeXSymbolType
instance Read TeXSymbolType
instance Eq TeXSymbolType
instance Data TeXSymbolType
-- | Functions for writing a parsed formula as MathML.
module Text.TeXMath.MathML
toMathML :: DisplayType -> [Exp] -> Element
data DisplayType
DisplayBlock :: DisplayType
DisplayInline :: DisplayType
showExp :: Exp -> Element
instance Show DisplayType
-- | Functions for parsing a LaTeX formula to a Haskell representation.
module Text.TeXMath.Parser
-- | Parse a formula, returning a list of Exp.
parseFormula :: String -> Either String [Exp]
-- | Functions for converting LaTeX math formulas to MathML.
module Text.TeXMath
texMathToMathML :: DisplayType -> String -> Either String Element
data DisplayType
DisplayBlock :: DisplayType
DisplayInline :: DisplayType