Mark Nodine > Text-ASCIIMathML-0.81 > Text::ASCIIMathML

Text-ASCIIMathML-0.81.tar.gz

Dependencies

Annotate this POD

# CPAN RT

 New 1 Open 0
View/Report Bugs
Module Version: 0.81

Text::ASCIIMathML - Perl extension for parsing ASCIIMathML text into MathML

# SYNOPSIS

 use Text::ASCIIMathML;

$parser=new Text::ASCIIMathML();$parser->SetAttributes(ForMoz => 1);

$ASCIIMathML = "int_0^1 e^x dx";$mathML = $parser->TextToMathML($ASCIIMathML);
$mathML =$parser->TextToMathML($ASCIIMathML, [title=>$ASCIIMathML]);
$mathML =$parser->TextToMathML($ASCIIMathML, undef, [displaystyle=>1]);$mathMLTree = $parser->TextToMathMLTree($ASCIIMathML);
$mathMLTree =$parser->TextToMathMLTree($ASCIIMathML, [title=>$ASCIIMathML]);

Converts $text to a MathML string. If the optional $math_attr argument is provided, it should be a reference to a hash of attribute/value pairs for the  <math > node. If the optional $mstyle_attr argument is provided, it should be a reference to a hash of attribute/value pairs for the  <mstyle > node. ### TextToMathMLTree($text, [$math_attr], [$mstyle_attr])

Like TextToMathMLTree except that instead of returning a string, it returns a Text::ASCIIMathML::Node representing the parsed MathML structure.

## Text::ASCIIMathML::Node

### text

Returns a MathML string representing the parsed MathML structure encoded by the Text::ASCIIMathML::Node.

### latex

Returns a LaTeX string representing the parsed MathML structure encoded by the Text::ASCIIMathML::Node.

# BUGS AND SUGGESTIONS

If you find bugs, think of anything that could improve Text::ASCIIMathML or have any questions related to it, feel free to contact the author.

# AUTHOR

Mark Nodine <mnodine@alum.mit.edu>

 MathML::Entities,
<http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.xml>

# ACKNOWLEDGEMENTS

This Perl module has been created by modifying Peter Jipsen's ASCIIMathML.js script. He deserves full credit for the original implementation; any bugs have probably been introduced by me.