mathml.tex 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. \chapter{MATHML : MathML Interface for REDUCE }
  2. \label{MATHML}
  3. \typeout{{MATHML : MathML Interface for REDUCE}}
  4. {\footnotesize
  5. \begin{center}
  6. Luis Alvarez-Sobreviela \\
  7. Konrad-Zuse-Zentrum f\"ur Informationstechnik Berlin \\
  8. Takustra\"se 7 \\
  9. D-14195 Berlin-Dahlem, Germany \\
  10. \end{center}
  11. }
  12. \ttindex{MATHML}
  13. MathML is intended to facilitate the use and re-use of mathematical and
  14. scientific content on the Web, and for other applications such as computer
  15. algebra systems. \\
  16. This package contains the MathML-{\REDUCE}\ interface.
  17. This interface provides an easy to use series of commands,
  18. allowing to evaluate and output MathML.
  19. The principal features of this package can be resumed as:
  20. \begin{itemize}
  21. \item Evaluation of MathML code. Allows {\REDUCE}\ to parse MathML expressions
  22. and evaluate them.
  23. \item Generation of MathML compliant code. Provides the printing of REDUCE
  24. expressions in MathML source code, to be used directly in web page
  25. production.
  26. \end{itemize}
  27. We assume that the reader is familiar with MathML. If not, the
  28. specification\footnote{This specification is subject to change, since it is
  29. not yet a final draft. During the two month period in which this package was
  30. developed, the specification changed, forcing a review of the code. This
  31. package is based on the Nov 98 version.}
  32. is available at: \qquad {\tt http://www.w3.org/TR/WD-math/ }
  33. The MathML-{\REDUCE} interface package is loaded by supplying {\tt load mathml;}.
  34. \subsubsection{Switches}
  35. There are two switches which can be used alternatively and incrementally.
  36. These are {\tt MATHML} and {\tt BOTH}. Their use can be described as
  37. follows:
  38. \begin{description}
  39. \item[{\tt mathml}:]\ttindex{MATHML} All output will be printed in MathML.
  40. \item[{\tt both}:]\ttindex{BOTH} All output will be printed in both MathML and normal
  41. REDUCE.
  42. \item[{\tt web}:]\ttindex{WEB} All output will be printed within an HTML $<$embed$>$ tag.
  43. This is for direct use in an HTML web page. Only works when {\tt mathml} is on.
  44. \end{description}
  45. MathML has often been said to be too verbose. If {\tt BOTH} is on, an easy
  46. interpretation of the results is possible, improving MathML readability.
  47. \subsubsection{Operators of Package MathML}
  48. \begin{description}
  49. \item[\f{mml}(filename):]\ttindex{MML} This function opens and reads the file filename
  50. containing the MathML.
  51. \item[\f{parseml}():]\ttindex{PARSEML} To introduce a series of valid mathml tokens you
  52. can use this function. It takes no arguments and will prompt you to enter mathml tags
  53. stating with $<$mathml$>$ and ending with $<$/mathml$>$. It returns an expression resulting
  54. from evaluating the input.
  55. \end{description}
  56. {\bf Example}
  57. \begin{verbatim}
  58. 1: load mathml;
  59. 3: on both;
  60. 3: int(2*x+1,x);;
  61. x*(x + 1)
  62. <mathml>
  63. <apply><plus/>
  64. <apply><power/>
  65. <ci>x</ci>
  66. <cn type="integer">2</cn>
  67. </apply>
  68. <ci>x</ci>
  69. </apply>
  70. </mathml>
  71. 4:
  72. \end{verbatim}