IBM techexplorer version 3.0 provides an add-in for connecting techexplorer documents, JavaScript, and
Java programs with the
Mathematica
software (version 4.1 or later) of Wolfram Research Inc.
This add-in allows you to harness the computational abilities provided by Mathematica to enliven scientific and technical
documents rendered by techexplorer in web browsers or, moreover,
to harness any application that can integrate the
techexplorer ActiveX control. In this section we provide an overview of how to use the
Evaluation API to access the Mathematica add-in. In particular, we describe the
different ways of sending and receiving Mathematica content, describe how to use JavaScript
to access Mathematica and techexplorer, as well as provide an
example that uses Java, JavaScript, and techexplorer to
provide a web based command line interface to Mathematica. Users need access to a Mathematica kernel to
run these examples.
Sending and Receiving Mathematica Content
The techexplorer Evaluation API can be accessed easily from LaTeX by
using the \evalLink
control sequence. The \evalLink
control sequence uses a unique identifier
to determine which add-in processes a particular piece of "live" content. The table below describes the MIME types
supported by the Mathematica add-in.
Add-in MIME Type | Description |
application/x-mathlink-mat-tex | Send Mathematica content and receive LaTeX response. |
application/x-mathlink-mat-mathml | Send Mathematica content and receive MathML response. |
application/x-mathlink-mathml-mathml | Send MathML content and receive MathML response. |
In the example below, the application/x-mathlink-mat-tex
MIME type
indicates that the Mathematica add-in should send an expression encoded in
Mathematica syntax to the Mathematica kernel to be evaluated.
The LaTeX encoded result of the computation will be
dynamically inserted into techexplorer for display.
The application/x-mathlink-mathml-mathml
MIME type
can be used to send an expression encoded in
MathML that will result in MathML encoded content. The Mathematica
add-in will dynamically insert the result into techexplorer.
JavaScript and Java applications can access techexplorer add-in functionality via the add-in conduit methods provided by the techexplorer Java object. As a result it is easy to write web based scientific and technical offerings that leverage a wide range of applications. In this section we provide a JavaScript based interface to Mathematica and techexplorer that uses only a few lines of JavaScript and HTML code. Users with access to a Mathematica Kernel will be able to input expressions in their web browser and see the results displayed on their screen!
To send an expression to Mathematica using the above interface for evaluation:
IBM techexplorer Hypermedia Browser is a trademark of the
IBM Corporation.
Send comments and questions to
techexpl@us.ibm.com.
Visit the official techexplorer home page at
http://www.software.ibm.com/techexplorer/.