3 @setfilename mathml.info
4 @settitle Package mathml
12 @dircategory Mathematics/Maxima
14 * Package mathml: (maxima)Maxima share package mathml to generate Presentation MathML.
17 @node Top, Definitions for package mathml, (dir), (dir)
20 * Definitions for package mathml::
22 @chapter Package mathml
24 @node Definitions for package mathml, Top, Top, Top
25 @section Definitions for package mathml
27 @defun mathml (@var{expr})
28 @defunx mathml (@var{expr}, @var{filename})
29 @defunx mathml (@var{label}, @var{filename})
31 Convert an expression to Presentation MathML (version 2).
33 When the first argument is a label,
34 the label and its associated value are printed verbatim,
35 not typeset as MathML.
37 When the optional argument @var{filename} is supplied,
38 any output will be appended to the file.
40 @code{load("mathml");} loads this package.
45 (%i1) load ("mathml") $
46 (%i2) mathml (integrate (sin(x), x));
47 <math xmlns="http://www.w3.org/1998/Math/MathML"> <mo>-</mo>
48 <mi>cos</mi> <mi>x</mi> </math>
50 (%i3) integrate (1/(1 + x^3), x);
53 log(x - x + 1) sqrt(3) log(x + 1)
54 (%o3) (- ---------------) + ------------- + ----------
58 (%O3) (-log(x^2-x+1)/6)+atan((2*x-1)/sqrt(3))/sqrt(3)+log(x+1)/3;
63 <math xmlns="http://www.w3.org/1998/Math/MathML"> <mo>-</mo>
64 <mfrac><mrow><mi>log</mi> <mfenced separators=""><msup><mrow>
65 <mi>x</mi> </mrow> <mn>2</mn> </msup> <mo>-</mo> <mi>x</mi>
66 <mo>+</mo> <mn>1</mn> </mfenced> </mrow> <mrow><mn>6</mn>
67 </mrow></mfrac> <mo>+</mo> <mfrac><mrow><mi>arctan</mi>
68 <mfenced separators=""><mfrac><mrow><mn>2</mn>
69 <mspace width="thinmathspace"/><mi>x</mi> <mo>-</mo> <mn>1</mn>
70 </mrow> <mrow><msqrt><mn>3</mn> </msqrt></mrow></mfrac> </mfenced>
71 </mrow> <mrow><msqrt><mn>3</mn> </msqrt></mrow></mfrac> <mo>+</mo>
72 <mfrac><mrow><mi>log</mi> <mfenced separators=""><mi>x</mi>
73 <mo>+</mo> <mn>1</mn> </mfenced> </mrow> <mrow><mn>3</mn>
74 </mrow></mfrac> </math>
76 (%i6) mathml (''%o3, "/tmp/tmp.xml");