Rename specvar integer-info to *integer-info*
[maxima.git] / share / contrib / lurkmathml / mathml.texi
blob975c33ea03b21b30edee79566372facd5e52800c
1 \input texinfo
3 @setfilename mathml.info
4 @settitle Package mathml
6 @ifinfo
7 @macro var {expr}
8 <\expr\>
9 @end macro
10 @end ifinfo
12 @dircategory Mathematics/Maxima
13 @direntry
14 * Package mathml: (maxima)Maxima share package mathml to generate Presentation MathML.
15 @end direntry
17 @node Top, Definitions for package mathml, (dir), (dir)
18 @top
19 @menu
20 * Definitions for package mathml::
21 * Function and variable index::
22 @end menu
23 @chapter Package mathml
25 @node Definitions for package mathml, Function and variable index, Top, Top
26 @section Definitions for package mathml
28 @deffn {Function} mathml
29 @*mathml (@var{expr}) @
30 @*mathml (@var{expr}, @var{filename}) @
31 @*mathml (@var{label}, @var{filename})
33 Convert an expression to Presentation MathML (version 2).
35 When the first argument is a label,
36 the label and its associated value are printed verbatim,
37 not typeset as MathML.
39 When the optional argument @var{filename} is supplied,
40 any output will be appended to the file.
42 @code{load("mathml");} loads this package.
44 Examples:
46 @example
47 (%i1) load ("mathml") $
48 (%i2) mathml (integrate (sin(x), x));
49 <math xmlns="http://www.w3.org/1998/Math/MathML"> <mo>-</mo>
50  <mi>cos</mi> <mi>x</mi> </math>
51 (%o2)                         false
52 (%i3) integrate (1/(1 + x^3), x);
53                                    2 x - 1
54                 2             atan(-------)
55            log(x  - x + 1)         sqrt(3)    log(x + 1)
56 (%o3)   (- ---------------) + ------------- + ----------
57                   6              sqrt(3)          3
58 (%i4) mathml (%o3);
59 <pre>
60 (%O3) (-log(x^2-x+1)/6)+atan((2*x-1)/sqrt(3))/sqrt(3)+log(x+1)/3;
61 </pre>
62 (%o4)                         (%o3)
63 (%i5) mathml (''%o3);
65  <math xmlns="http://www.w3.org/1998/Math/MathML"> <mo>-</mo>
66  <mfrac><mrow><mi>log</mi> <mfenced separators=""><msup><mrow>
67  <mi>x</mi> </mrow> <mn>2</mn> </msup> <mo>-</mo> <mi>x</mi> 
68  <mo>+</mo> <mn>1</mn> </mfenced> </mrow> <mrow><mn>6</mn> 
69  </mrow></mfrac> <mo>+</mo> <mfrac><mrow><mi>arctan</mi> 
70  <mfenced separators=""><mfrac><mrow><mn>2</mn> 
71  <mspace width="thinmathspace"/><mi>x</mi> <mo>-</mo> <mn>1</mn> 
72  </mrow> <mrow><msqrt><mn>3</mn> </msqrt></mrow></mfrac> </mfenced> 
73  </mrow> <mrow><msqrt><mn>3</mn> </msqrt></mrow></mfrac> <mo>+</mo> 
74  <mfrac><mrow><mi>log</mi> <mfenced separators=""><mi>x</mi> 
75  <mo>+</mo> <mn>1</mn> </mfenced> </mrow> <mrow><mn>3</mn> 
76  </mrow></mfrac> </math>
77 (%o5)                         false
78 (%i6) mathml (''%o3, "/tmp/tmp.xml");
79 (%o6)                         false
80 @end example
81 @end deffn
83 @node Function and variable index,  , Definitions for package mathml, Top
84 @appendix Function and variable index
85 @printindex fn
86 @printindex vr
88 @bye