codegen - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : codegen Package : codegen/MathML

codegen

  

MathML

  

generate MathML text

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

MathML(expr, opts)

Parameters

expr

-

Maple expression

opts

-

(optional) one or more options having the form output=style or filename=fn

Description

• 

The MathML(expr, opts) function translates the Maple expression expr to MathML text.

• 

The output=style option, where style is one of content, presentation, or parallel, can be included. If the output=content option is provided, then content-only MathML is produced.  If the output=presentation option is provided, then presentation-only MathML is produced.  Otherwise, parallel (both content and export) MathML is produced as the default.  See the MathML package help page for a description of the parallel, content-only and presentation-only encodings, and for additional information about MathML.

• 

The filename=fn option is used to direct the output to the file with name fn, where fn is a string or symbol.  Otherwise, the default output stream is used. If you are using the MathML command interactively, the default output stream is the terminal screen.

• 

The function MathML produces MathML code as a side-effect and returns NULL as the function value. Therefore, the ditto commands (% and %%) do not recall the output from the MathML command.

• 

The command with(codegen,MathML) allows the use of the abbreviated form of this command.

Examples

withcodegen:

MathML2x+3

<math xmlns='http://www.w3.org/1998/Math/MathML'>
  <semantics>
    <mrow xref='id5'>
      <mrow xref='id3'>
        <mn xref='id1'>2</mn>
        <mo>&InvisibleTimes;</mo>
        <mi xref='id2'>x</mi>
      </mrow>
      <mo>+</mo>
      <mn xref='id4'>3</mn>
    </mrow>
    <annotation-xml encoding='MathML-Content'>
      <apply id='id5'>
        <plus/>
        <apply id='id3'>
          <times/>
          <cn id='id1' type='integer'>2</cn>
          <ci id='id2'>x</ci>
        </apply>
        <cn id='id4' type='integer'>3</cn>
      </apply>
    </annotation-xml>
    <annotation encoding='Maple'>2*x+3</annotation>
  </semantics>
</math>

MathML4cosx&comma;output&equals;content

<math xmlns='http://www.w3.org/1998/Math/MathML'>
  <apply id='id5'>
    <times/>
    <cn id='id1' type='integer'>4</cn>
    <apply id='id4'>
      <cos id='id2'/>
      <ci id='id3'>x</ci>
    </apply>
  </apply>
</math>

MathML4cosx&comma;output&equals;presentation

<math xmlns='http://www.w3.org/1998/Math/MathML'>
  <mrow>
    <mn>4</mn>
    <mo>&InvisibleTimes;</mo>
    <mrow>
      <mi>cos</mi>
      <mo>&ApplyFunction;</mo>
      <mfenced>
        <mi>x</mi>
      </mfenced>
    </mrow>
  </mrow>
</math>

See Also

codegen package

MathML package

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam