1LaTeXML::MathParser(3)User Contributed Perl DocumentationLaTeXML::MathParser(3)
2
3
4
6 "LaTeXML::MathParser" - parses mathematics content
7
9 "LaTeXML::MathParser" parses the mathematical content of a document.
10 It uses Parse::RecDescent and a grammar "MathGrammar".
11
12 Math Representation
13 Needs description.
14
15 Possibile Customizations
16 Needs description.
17
18 Convenience functions
19 The following functions are exported for convenience in writing the
20 grammar productions.
21
22 "$node = New($name,$content,%attributes);"
23 Creates a new "XMTok" node with given $name (a string or undef),
24 and $content (a string or undef) (but at least one of name or
25 content should be provided), and attributes.
26
27 "$node = Arg($node,$n);"
28 Returns the $n-th argument of an "XMApp" node; 0 is the operator
29 node.
30
31 "Annotate($node,%attributes);"
32 Add attributes to $node.
33
34 "$node = Apply($op,@args);"
35 Create a new "XMApp" node representing the application of the node
36 $op to the nodes @args.
37
38 "$node = ApplyDelimited($op,@stuff);"
39 Create a new "XMApp" node representing the application of the node
40 $op to the arguments found in @stuff. @stuff are delimited
41 arguments in the sense that the leading and trailing nodes should
42 represent open and close delimiters and the arguments are separated
43 by punctuation nodes.
44
45 "$node = InterpretDelimited($op,@stuff);"
46 Similar to "ApplyDelimited", this interprets sequence of delimited,
47 punctuated items as being the application of $op to those items.
48
49 "$node = recApply(@ops,$arg);"
50 Given a sequence of operators and an argument, forms the nested
51 application "op(op(...(arg)))">.
52
53 "$node = InvisibleTimes;"
54 Creates an invisible times operator.
55
56 "$boole = isMatchingClose($open,$close);"
57 Checks whether $open and $close form a `normal' pair of delimiters,
58 or if either is ".".
59
60 "$node = Fence(@stuff);"
61 Given a delimited sequence of nodes, starting and ending with
62 open/close delimiters, and with intermediate nodes separated by
63 punctuation or such, attempt to guess what type of thing is
64 represented such as a set, absolute value, interval, and so on.
65
66 This would be a good candidate for customization!
67
68 "$node = NewFormulae(@stuff);"
69 Given a set of formulas, construct a "Formulae" application, if
70 there are more than one, else just return the first.
71
72 "$node = NewList(@stuff);"
73 Given a set of expressions, construct a "list" application, if
74 there are more than one, else just return the first.
75
76 "$node = LeftRec($arg1,@more);"
77 Given an expr followed by repeated (op expr), compose the left
78 recursive tree. For example "a + b + c - d" would give "(- (+ a b
79 c) d)">
80
81 "MaybeFunction($token);"
82 Note the possible use of $token as a function, which may cause
83 incorrect parsing. This is used to generate warning messages.
84
86 Bruce Miller <bruce.miller@nist.gov>
87
89 Public domain software, produced as part of work done by the United
90 States Government & not subject to copyright in the US.
91
92
93
94perl v5.36.0 2022-07-20 LaTeXML::MathParser(3)