-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Conversion of LaTeX math formulas to MathML or OMML. -- -- The texmathml library provides functions to convert LaTeX math -- formulas to presentation MathML (which can be used in HTML) or OMML -- (Office Math Markup Language, used in Microsoft Office). 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.6.4 -- | 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 EDelimited :: String -> String -> [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 :: TextType -> String -> Exp data TeXSymbolType Ord :: TeXSymbolType Op :: TeXSymbolType Bin :: TeXSymbolType Rel :: TeXSymbolType Open :: TeXSymbolType Close :: TeXSymbolType Pun :: TeXSymbolType Accent :: TeXSymbolType type ArrayLine = [[Exp]] data TextType TextNormal :: TextType TextBold :: TextType TextItalic :: TextType TextMonospace :: TextType TextSansSerif :: TextType TextDoubleStruck :: TextType TextScript :: TextType TextFraktur :: TextType TextBoldItalic :: TextType TextBoldSansSerif :: TextType TextBoldSansSerifItalic :: TextType TextBoldScript :: TextType TextBoldFraktur :: TextType TextSansSerifItalic :: TextType data Alignment AlignLeft :: Alignment AlignCenter :: Alignment AlignRight :: Alignment AlignDefault :: Alignment data DisplayType DisplayBlock :: DisplayType DisplayInline :: DisplayType instance Typeable TeXSymbolType instance Typeable Alignment instance Typeable TextType instance Typeable Exp instance Show TeXSymbolType instance Read TeXSymbolType instance Eq TeXSymbolType instance Data TeXSymbolType instance Show Alignment instance Read Alignment instance Eq Alignment instance Data Alignment instance Show DisplayType instance Show TextType instance Read TextType instance Eq TextType instance Data TextType instance Show Exp instance Read Exp instance Eq Exp instance Data Exp -- | Function for replacing strings of characters with their respective -- mathvariant module Text.TeXMath.ToUnicode -- | Replace all characters in the string A-Z, a-z with their corresponding -- mathvariant unicode character. | MathML has a mathvariant attribute -- which is unimplemented in Firefox | (see -- https:bugzilla.mozilla.org/show_bug.cgi?id=114365) | Therefore, -- we may want to translate mathscr, etc to unicode symbols directly. toUnicode :: TextType -> String -> String -- | Functions for writing a parsed formula as a list of Pandoc Inlines. module Text.TeXMath.Pandoc -- | Converts a formula to a list of Pandoc inlines. Defaults to raw -- formula between $ characters if entire formula can't be -- converted. toPandoc :: DisplayType -> [Exp] -> Maybe [Inline] -- | Functions for writing a parsed formula as OMML. module Text.TeXMath.OMML toOMML :: DisplayType -> [Exp] -> Element showExp :: Exp -> [Element] -- | Functions for writing a parsed formula as MathML. module Text.TeXMath.MathML toMathML :: DisplayType -> [Exp] -> Element showExp :: Exp -> Element -- | 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 texMathToOMML :: DisplayType -> String -> Either String Element texMathToPandoc :: DisplayType -> String -> Either String [Inline] data DisplayType DisplayBlock :: DisplayType DisplayInline :: DisplayType