<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m11032">
  <name>Using Mathematica to Output MathML</name>
  <metadata>
  <md:version>2.5</md:version>
  <md:created>2003/01/29</md:created>
  <md:revised>2004/07/13 15:30:32.960 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="jago">
      <md:firstname>Adan</md:firstname>
      
      <md:surname>Galvan</md:surname>
      <md:email>jago@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="jago">
      <md:firstname>Adan</md:firstname>
      
      <md:surname>Galvan</md:surname>
      <md:email>jago@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>content mathml</md:keyword>
    <md:keyword>mathematica</md:keyword>
    <md:keyword>mathml</md:keyword>
  </md:keywordlist>

  <md:abstract>This module shows how to use Mathematica to output content MathML for use in Connexions modules.</md:abstract>
</metadata>



  <content>
    <section id="intro">
      <name>Introduction</name>
      <para id="para1">
	In short, <link src="http://www.wolfram.com/">Mathematica</link> is a powerful math program that can be used to
	manipulate, evaluate, and solve mathematical equations. One of
	the features new to recent versions of Mathematica is the ability to output
	MathML. This includes the support of content MathML as
	well as presentation MathML. This document will show you how
	to use Mathematica to output content MathML to input into
	<link src="http://cnx.rice.edu/technology/cnxml/">CNXML</link>
	documents.
        <note type="warning">
            This method of creating content MathML only works in Mathematica 4.2 and above.  We recommend you use at least version 5.0.
          </note>

      </para>
    </section>
    
    <section id="notebook">
      <name>Mathml Content Notebook</name>

      <para id="nb_para">
	I have created a simple MathML notebook that anyone can use to
	set up Mathematica to output content MathML. The sample notebook is available as <link src="content_mathml.nb">a download from this module</link>.
      </para>
      
      <section id="using">
	<name>Using the Notebook</name>

	<para id="using_p">
	  There are a few steps you will have to follow to use the
	  notebook:

	  <list id="steps_list" type="enumerated">
	    <item>Start Mathematica</item>
	    <item>Load the content_MathML.nb by clicking the
	    <code>file -&gt; open..</code> menu option.</item>
	    <item>Evaluate the notebook by clicking the
	    <code>Kernel -&gt; Evaluation -&gt; Evaluate
	    Notebook</code> menu option.
	    </item>
	  </list>
          Evaluating the notebook actually sets the options that we need. If you do not evalute the notebook, the options will not be set.	
	  Once you have followed these steps and ensured that there
	  are no errors, you can proceed to the next step.
         <note type="note">
           This document does not have any operating-system-specific info. For example, there will be no info on how to start Mathematica since this varies depending on what operating system the user is working with.
          </note>
        
	</para>
      </section>

      <section id="creating_matml">
	<name>Exporting Content Mathml</name>
	<para id="createMathML">
	  Follow the instructions below to use Mathematica palettes:

	  <list type="enumerated" id="palettes">
	    <item>Open the palette by clicking the <code>File -&gt;
	    Palettes-&gt; Basic Input</code> menu option. (If it is not already open on startup.)</item>
	    <item>Build the equation you wish to export into MathML
	    using the palette.</item>
	  </list>
	  </para>
	
	<para id="export_p">
	  Now that you have created the equation using whatever method
	  you have chosen, it is time to export the equation as
	  MathML.

	  <list id="export" type="enumerated">
            <item>Highlight the equation you wish to export</item>
	    <item>Copy the equation as MathML by clicking the
	      <code>edit -&gt; copy as -&gt; MathML</code> menu
	      option.(This will put the equation into a buffer that you will not see!)</item>
	    <item>Paste the equation in the appropriate place in your
	      CNXML document</item>
	  </list>
	  
	  That's it! You now have content MathML embedded into your
	  CNXML document.
	</para>
      </section>

      <section id="lookfor">
	<name>Problems to Look Out For</name>
	<para id="prob1">
	  There may be a few differences in the format of the math
	  that comes out of Mathematica. Following is a list of
	  possible problems to look out for. This list will be updated
	  as problems are found.
	  
	<list id="prob_list">
	  <item>If you plan to have your equations numbered you will
	    need to have the MathML inside of an <cnxn document="m9006" target="equation">equation</cnxn> tag.
	  </item>
          <item>When exporting an equation that has a radical, the exported math will not use the root tag, but instead will export math with a power. For example, if you attempt to export the square root of two, the resulting MathML will be two to the one-half power.
          </item>
          <item>You may need to delete the extraneous <code>xmlns:mathematica</code> and <code>mathematica:form</code> attributes from the MathML output.</item>
          
	</list>

	  If you encounter a problem contact techsupport@cnx.rice.edu.
	</para>
      </section>
    </section>
	      
	  

  </content>
  
</document>
