Extending techexplorer via Add-ins

Mathematica add-in


The feature described is only available in the Professional Edition of techexplorer.

IBM techexplorer version 3.0 provides an add-in for connecting techexplorer documents, JavaScript and Java with Wofram Research Inc. Mathematica 4.1 or latter. 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 any application that can integrate the techexplorer ActiveX control. In this section we will provide an overview of how to use the Evaluation API to access the Mathematica add-in. In particular, we will describe the different ways of sending and receiving Mathematica content, describe how to use JavaScirpt to Access Mathematica and techexplorer, as well as provide an example of that uses Java, JavaScript and techexplorer to provide a web based command line interface to Mathematica

Sending and Recivieng Mathematica Content

The techexplorer Evaluation API can be easily accessed from LaTeX by using the \evalLink control sequence. The \evalLink control sequence uses a unique identifier to determine which add-in handles a particular piece of "live" content. The table below describes each of the MIME types supported by the Mathematica add-in.

Add-in MIME Type Description
application/x-mathlink-mat-tex Send Mathematica content and recieve LaTeX response.
application/x-mathlink-mat-mathml Send Mathematica content and recieve MathML response.
application/x-mathlink-mathml-mathml Send MathML content and recieve MathML response.

For example, the application/x-mathlink-mat-tex MIME type indicates that the Mathematica add-in should send an expressing encoded in Mathematica syntax. The LaTeX encoded result of the computation will be dynamically inserted into techexplorer.

The application/x-mathlink-mathml-mathml MIME type can be used to send an expressing encoded in MathML that will result in a MathML encoded content. The Mathemtica add-in will dynamically insert the result into techexplorer.

Click to use \evalLink to connect to Mathematica.

Using JavaScirpt to Access Mathematica and 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 only uses 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!

<P>IBM techexplorer Hypermedia Browser not installed! Please visit the <A HREF="http://www.software.ibm.com/techexplorer/">techexplorer home page</A> for more information.
Mathematica command:

To send an expression to Mathematica using the above interface for evaluation:

  1. Start Mathematica.
  2. Type in a Mathematica Expression ( for example, Expand[(x+y)^4] ).
  3. Evaluate the expression.

A Web Based Command Line Interface to Mathematica

This example uses Java to create a techexplorer web based "front end" to the Mathematica Kernel. Type in a Mathematica expression into the techexplorer Input area and press the "Submit" button.
The result of the computation is appended to the document. Another input area and "Submit" button appears after that.

Click to use \evalLink to connect to Mathematica.




Click here to to view the previous section. Click here to to view the next section.

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/.