[VCLab-Main] [Software] [HotEqn]


HotEqn

The IMGless Equation Viewer Applet

HotEqn is a AWT-based Java applet to view and display mathematical equations on the Web. The applet uses the familiar LaTeX notation to code its equations. Fontsizes are variable, so the applet can be used to display inline equations as well. The window below shows the output of an applet.



Try out various LaTeX expressions. Simply type your code in the text
area above and click on with your left mouse button.
Try also a right mouse button click in the applet window.
       


Hot Links

Mathematics ---- LaTeX ---- LaTeX Primer ---- Applets ---- Developer
HotEqn ---- cHotEqn ----sHotEqn ---- dHotEqn ---- mHotEqn ---- Inheritance
Download ---- Editor
FAQ --- Update --- Errors


New: Version 4.00

  • AWT component based applet implementation
  • Swing component available
  • mHotEqn compatible with XPCOM scriptability

Viewing mathematics with HotEqn

hourglassThe applet scans and parses LaTeX strings. In the example shown above, a LaTeX string has been given as an applet parameter. After pressing the button "Set", the string entered in the text area, is interpreted and fonts are downloaded from the server where the applet is stored on. This may take a while and is shown by the red hour glass symbol in the center of the applet window. Load activities and error messages are displayed in the Navigator's status line.

The LaTeX language support

The applet supports the LaTeX mathematics described in chapter 5 of the books of H. Kopka. With the exception of some seldom used features, the full mathematics style is available. The display of formulas may look slightly different from that of the printed version. In addition to the base language set, some extensions to LaTeX are introduced, which make the display on the screen more comfortable. A short look on the LaTeX features is included in the primer section.

A short look on the applet set

The equation viewer comes up with three different applet versions:
HotEqn
is the kernel applet for equation viewing. This applet supports all LaTeX features, but does not include methods for equation editing, variable substitution, and for more sophisticated interactive elements. This applet is preferably for only showing mathematics statically. A minimum of mouse operations for debugging purposes is supported.
dHotEqn
is a dynamical superclass extension of the base applet. It has the same functionality as the base plus methods for setting equations, left- and right-side equation setting and extraction, and the facilities to substitute dynamically variables by expressions from other applet instants on the same page on mouse clicks. This is the applet shown at the top of this page.
mHotEqn
is a dynamical superclass extension of the dHotEqn applet. It has the same functionality as dHotEqn plus methods for interaction with MATLAB. Expressions or m-files associated with the applet can be send on click to MATLAB and executed by the MATLAB machine. Results from MATLAB can be imported in LaTeX notation and represented on mouse click or requested periodically. This applet needs the MATLAB plugin.

HotEqn developers edge

For those who intend to use HotEqn locally or from their home server, the applet should be stored on their sites. The HotEqn applet is freeware and can be downloaded from the download section on the developers edge page. The applet consists of a set of class and font files, which are described on the developers edge page.

A HotEqn LaTeX primer

The following sections lists all LaTeX features of the HotEqn applet. More details on specific parts can be found on separate example pages. If you click on the eye in the specific row, you will see equations generated from the HotEqn applet.

The code syntax description uses the following notation:

Elements Code Syntax Examples
Operators + - * / = < > # ~ ; : , !  
Subscripts _<eqn> Sub- and superscript examples
Superscripts ^<eqn>
Fractions \frac<eqn numerator><eqn denominator> Fraction Examples
Square Roots \sqrt[[<grp>]]<eqn> Square Root Examples
Sums \sum[_<eqn lower limit>][^<eqn upper limit>] Sum and Product Examples
Products \prod[_<eqn lower limit>][^<eqn upper limit>]
Integrals \int[_<eqn lower limit>][^<eqn upper limit>]
\oint[_<
eqn lower limit>][^<eqn upper limit>]
Integral Examples
Accents
\acute<eqn>
\bar<eqn>
\dot<eqn>
\ddot<eqn>
\grave<eqn>
\hat<eqn>
\tilde<eqn>
\vec<eqn>
\widehat<eqn>
\widetilde<eqn>
Accent Examples
Functions \arccos \arcsin \arctan \arg \cos \cosh \cot \coth \csc \def \deg \det \dim \exp \gcd \hom \ker \lg \ln \log \sec \sin \sinh \tan \tanh
\det[_<eqn limit>]
\gcd[_
<eqn limit>]
\inf[_
<eqn limit>]
\lim[_
<eqn limit>]
\liminf[_
<eqn limit>]
\limsup[_<eqn limit>]
\max[_
<eqn limit>]
\min[_
<eqn limit>]
\Pr[_
<eqn limit>]
\sup[_
<eqn limit>]
Function Examples
Brackets \left<char>
\right<char>
<char>
<char> :=  (  )  [  ]  {  }  |  \|  .(dot)  \langle  \rangle
Bracket Examples
Overline
Underline
\overline<eqn>
\underline<eqn>
Over-/Underline Examples
Overbrace
Underbrace
\overbrace<eqn>[^<eqn>]
\underbrace<eqn>[_<eqn>]
Over-/Underbrace Examples
Stackrel \stackrel<eqn upper><eqn lower> Stackrel Examples
Choose
Atop
{ <grp upper> \choose <grp lower>}
{ <grp upper> \atop <grp lower> }
CooseAtop Examples
Additional Space \quad \qquad \, \: \; \! Space Examples
Arrays \begin{array}{<format>} <grp> [& <grp>][\\ <grp>[& <grp>]]\end{array}
\begin{eqnarray} <grp> [& <grp>][\\ <grp>[& <grp>]]\end{eqnarray}
\array{ <grp> [& <grp>][\\ <grp>[& <grp>]]}*)
Array Examples
Text \mbox{<text>} Text Examples
Framebox \fbox<eqn> Framebox Examples
Foreground
Background color
\fgcolor{ rrggbb }<eqn>*)
\bgcolor{ rrggbb }<eqn>*)
Color Examples
Greek symbols \alpha \beta \gamma \delta \epsilon \varepsilon \zeta \eta \theta \vartheta \iota \kappa \lambda \mu \nu \xi \pi \varpi \rho \varrho \sigma \varsigma \tau \upsilon \phi \varphi \chi \psi \omega
\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega
\sum \prod
Loading these examples
Greek Examples
may take some time!
Binary symbols \pm \mp \times \div \cdot \cdots \vdots \ldots \ddots \ast \star \dagger \ddagger \amalg \cap \cup \uplus \sqcap \sqcup \vee \wedge \setminus \wr \circ \bullet \diamond \lhd \rhd \unlhd \unrhd \oslash \odot \bigcirc \Box \Diamond \bigtriangleup \bigtriangledown \triangleleft \triangleright \oplus \ominus \otimes Loading these examples
Binary Symbol Examples
may take some time!
Relationial symbols \le \leq \ll \subset \subseteq \sqsubset \sqsubseteq \in \vdash \models \ge \geq \gg \supset \supseteq \sqsupset \sqsupseteq \ni \dashv \perp \neq \doteq \approx \cong \equiv \propto \prec \preceq \parallel \sim \simeq \asymp \smile \frown \bowtie \succ \succeq \mid Loading these examples
Relational Symbol Examples
may take some time!
Negation \not<eqn> NegationExamples
Arrows \leftarrow \gets \Leftarrow \rightharpoonup \rightarrow \to\rightharpoondown \Rightarrow \leadsto \leftrightarrow \uparrow \Leftrightarrow \Uparrow \mapsto \downarrow \Downarrow \leftharpoonup \updownarrow \leftharpoondown \Updownarrow \rightleftharpoons \nearrow \longleftarrow \searrow \Longleftarrow \swarrow \longrightarrow \nwarrow \Longrightarrow \longleftrightarrow \Longleftrightarrow \longmapsto \hookrightarrow \hookleftarrow Loading these examples
Arrow Examples
may take some time!
Other symbols \aleph \forall \hbar \exists \imath \neg \jmath \flat \ell \natural \wp \sharp \Re \angle \Im \backslash \mho \prime \emptyset \triangle \nabla \clubsuit \diamondsuit \partial \heartsuit \top \spadesuit \bot \Join \infty \Laplace \Fourier Loading these examples
Other Symbol Examples
may take some time!


HotEqn Family Inheritance

java.lang.Object
   |
   +----java.awt.Component
           |
           +----atp.cHotEqn
           |
           +----javax.swing.JComponent
                   |
                   +----atp.sHotEqn

java.applet.Applet
              |
              +---HotEqn - atp.cHotEqn
                    |
                    +---dHotEqn
                            |
                            +---mHotEqn
public class cHotEqn
extends Component
implements MouseListener, MouseMotionListener
public class sHotEqn
extends JComponent
implements MouseListener, MouseMotionListener
public class HotEqn
extends Applet
public class dHotEqn
extends HotEqn
implements MouseListener
public class mHotEqn
extends dHotEqn
implements Runnable


HotEqn Applet Syntax

The following is the minimal form shown using an example:

     <applet code=HotEqn.class height=300 width=400 name="my equation">
     <param name="equation" value="3.5*x+\frac{5}{x+y}+4">
     </applet>
The second line shows a parameter with the general parameter syntax
<param name="name"value="value">
which is a necessary parameter. You can specify either this type of necessary parameter by
<param name="equation" value="<eqn LaTeX-expression>">
or splitted into a left- and right-side expression of an equation by the two parameters
<param name="leftside"  value="<eqn LaTeX-expression>">
<param name="rightside" value="<eqn LaTeX-expression>">

Optional HotEqn Parameters

Parameter Type Code Syntax Examples
Font type
<param name="fontname" value="fontname">
       fontname = Helvetica (default)
                  TimesRoman
                  Courier
                  Dialog
Font examples
Font sizes
Max. 4 font sizes can be specified. The fontsize1 value specifies the normal font size. All other fontsize values must be smaller. The size value must decrease with increasing fontsize number. If only the normal font is specified, for all other sizes decreasing sizes are taken automatically.
<param name="fontsize1" value="normal size">
<param name="fontsize2" value="smaller size">
<param name="fontsize3" value="smaller size">
<param name="fontsize4" value="smallest size">
       size = 18
              14 (default)
              12
              10
               8
Font Sizes examples
Foreground color The applet default foreground color (default: black) can be modified by the hex value rrggbb
<param name="fgcolor" value="rrggbb">
Applet Color examples
Background color The applet default background color (default: white) can be modified by the hex value rrggbb
<param name="bgcolor" value="rrggbb">
Rectangular border frame The border color is given by the hex value rrggbb
<param name="border" value="rrggbb">
Applet Border Examples
Rounded border frame Alternatively to the rectangular border frame a frame with rounded edges can be specified
<param name="rborder" value="rrggbb">
Rounded border environment If a frame with rounded edges is specified, the environment color of the edges can be specified (default: background color)
<param name="envcolor" value="rrggbb">
Horizontal alignment Expressions are aligned within the applet window in horizontal direction, if there is enough space available. If the space is too small, alignment is left and the overhanging part on the right side will be cut.
<param name="halign" value="position">
       position = left (default)
                  center
                  right
If the space is too small, the necessary width and height parameters will be printed on the Java console.
Alignment examples
Vertical alignment Expressions are aligned within the applet window in vertical direction, if there is enough space available. If the space is too small, alignment is middle and the overhanging parts on the top and bottom will be cut.
<param name="valign" value="position">
       position = top (default)
                  middle
                  bottom
If the space is too small, the necessary width and height parameters will be printed on the Java console.
Debug mode
<param name="debug" value="booleanvalue">
       booleanvalue = true (default)  reports on console
                      false
 

HotEqn Mouse Actions

Mouse Operations Actions
Left mouse button click with pressed Ctrl key Applet window width and height are printed on the Java Console.


dHotEqn Applet Syntax

The applet syntax is similar to that of the HotEqn base applet. The following is the minimal form shown using an example:

     <applet code=dHotEqn.class height=300 width=400 name="my equation">
     <param name="equation" value="3.5*x+\frac{5}{x+y}+4">
     </applet>

Optional dHotEqn Parameters

All optional HotEqn parameters are also valid for this applet.

Parameter Type Code Syntax Examples
Interactive equations

dHotEqn is able to replace variables in a given equation by the corresponding right side of other equations located in any applet on the same page. Those variables are defined in applets referenced by the prev parameter. The number of substitutions is arbitrary.

<param name="prev0"   value="applet name">
<param name="prev1"   value="applet name">
<param name="prev2"   value="applet name">
<param name="prev3"   value="applet name">
<param name="prevxxx" value="applet name">
The variables are not substituted automatically. This is performed only on mouse click (see examples).
dHotEqn Interactive examples
Edit mode Makes the component almost editable. Parts of the displayed equation are selectable when editable is set true.
<param name="editable" value="booleanvalue">
       booleanvalue = false (default)
                      true

dHotEqn Mouse Actions

Mouse Operations Actions Examples
Left mouse button click
If a prev parameter is specified in the applet:
The variables in the applet are substituted by the expressions defined in the referenced applet.
Multiple clicks will substitute the variables sequently starting from prev0.
If no prev parameter is specified in the applet:
Name identifier of the applet is printed on the Java Console.
dHotEqn Interactive examples
Right mouse button click The original equation specified in the applet is shown again if a prev parameter is specified.
Left mouse button down, mouse dragging and mouse button up If edit mode is on, the expression between button down and up position is highlighted and set selectable. The selected part is printed on the Java Console.
Left mouse button click with pressed Ctrl key Applet window width and height are printed on the Java Console.  

dHotEqn Methods

Methods Syntax Examples
Sets expression <applet name>.setEquation("<eqn LaTeX-expression>") dHotEqn Interactive examples
Sets both sides of an equation <applet name>.setEquation("<eqn left side LaTeX-expression>,<eqn right side LaTeX-expression>")
Sets left side of an equation <applet name>.setLeftSide("<eqn left side LaTeX-expression>")
Sets right side of an equation <applet name>.setRightSide("<eqn right side LaTeX-expression>")
Gets left side of an equation String value=<applet name>.getLeftSide()
Gets right side of an equation String value=<applet name>.getRightSide()
Gets applet window width int value=<applet name>.getWidth()
Gets applet window height int value=<applet name>.getHeight()
Sets the applet background color <applet name>.setBGColor("rrggbb")
Sets the applet foreground color <applet name>.setFGColor("rrggbb")
Returns the size required to display the given equation
 Dimension dim=<applet name>.getSizeof("<eqn
			 LaTeX-expression>")


mHotEqn Applet Syntax

The applet syntax is similar to that of the dHotEqn or HotEqn base applet. The following is the minimal form shown using an example:

     <applet code=mHotEqn.class height=300 width=400 name="my equation" MAYSCRIPT>
     <param name="equation" value="3.5*x+\frac{5}{x+y}+4">
     </applet>

This applet extends the dHotEqn functionality with MATLAB features. Thus it needs the MATLAB plugin to communicate with MATLAB. Observe, that this applet must be specified with the MAYSCRIPT parameter to enable JavaScript access out from the applet. The optional parameters refer to properties and facilities in connection with MATLAB and they parametrize the actions on mouse button clicks.

Optional mHotEqn Parameters

All optional HotEqn and dHotEqn parameters are also valid for this applet.

Parameter Type Code Syntax Examples
MATLAB Plugin identification
<param name="vclab" value="name of the wrapped MATLAB plugin object">
The MATLAB Plugin is referenced by its wrapped Matlab object. The reference to the MATLAB Plugin is given by this parameter. The default name is matlab.
Observe, that pressing
mHotEqn Interactive Example
will start an example which uses MATLAB. Be sure, that the MATLAB Plugin is installed correctly.
MATLAB m-file execution
<param name="mEvalMFile" value="filename">
MATLAB m-file to be executed on a left mouse button click.
MATLAB expression execution
<param name="mEvalString" value="MATLAB command string">
MATLAB command string to be executed on a left mouse button click. This action is performed after the mEvalMFile parameter evaluation, if defined.
Import results from MATLAB
<param name="mGetArray" value="MATLAB matrix name">
This parameter specifies the name of a matrix in the MATLAB workspace. The content of this matrix is converted to LaTeX notation and the equation <matrix name> = <matrix content> is displayed on a left mouse button click or updated periodically if the update parameter is set (see below). This action is performed after the mEvalString parameter evaluation, if defined.
Import results from VCLab
<param name="mMatrix2LaTeX" value="matrix name">
The content of the VCLab matrix buffer is converted to LaTeX notation and the equation <matrix name> = <matrix content> is displayed on a left mouse button click. This action is performed after the mGetArray parameter evaluation, if defined.
Periodic updating
<param name="update" value="interval">
Specifies the update interval in milliseconds for importing results from the MATLAB workspace periodically according to the mGetArray parameter.

Access to the MATLAB Plugin

The mHotEqn applet needs to have internally access to the scriptable methods mEvalString, mEvalMfile, mMatrix2LaTeX and mGetArray of the MATLAB plugin. As plugins for Netscape Gecko or Mozilla Browsers do not support direct calling of methods from Java applets, a JavaScript interface must be used that wrapps plugin addresses and methods.

The following JavaScript code in the header section of the current document will define a Matlab wrapper for the plugin and the methods:

function Matlab(obj)
{
   // object to allow unwrapping
   this.matlab = obj;
   this.command = "";
}
Matlab.prototype = {
   mEvalString : function(expression)
   {
      this.matlab.mEvalString(expression);
   },
   mEvalMFile : function(file)
   {
      this.matlab.mEvalMFile(file);
   },
   mMatrix2LaTeX : function()
   {
      return this.matlab.mMatrix2LaTeX();
   },
	  mGetArray : function(list)
   {
		    if (arguments.length == 1)
			      return this.matlab.mGetArrayLaTeX(arguments[0]); 
		    else
			      if (arguments.length == 3)
        	   return this.matlab.mGetArray(arguments[0],arguments[1],arguments[2]);
   }
};

When referencing the MATLAB plugin it must be used in the wrapped version, e.g. in the following ways:
With var matlabwrappedobject = new Matlab(document.matlab);
the wrapped object is generated. In this example matlab is the name of the MATLAB plugin that is included in the same document. It must be observed that the wrapped object can only be created by new Matlab after the MATLAB plugin is initialised. In the applet declaration the parameter specification
<param name="vclab" value="matlabwrappedobject">
must be given.

mHotEqn Mouse Actions

Mouse Operations Actions
Left mouse button click The actions specified by the mEvalMFile, mEvalString, mGetArray or mMatrix2LaTeX parameters are performed.
Left mouse button down and mouse dragging If edit mode is on, parts of the dragged equation are highlighted and set selectable. The selected part is printed on the Java Console.
Left mouse button click with pressed Ctrl key Applet window width and height are printed on the Java Console.

mHotEqn Methods

The mHotEqn Methods are the same as the dHotEqn Methods.



HotEqn Reviews and Ratings

Java Repository Rated Top 25% WebApplet by JARS Gamelan JavaCats web.de


You are the visitor of this page since 11th February 98


[VCLab-Main] [Software] [HotEqn]


© CS SM 1996, 1997, 1998, 2001, 2002 , 2003