[VCLab-Main] [Software] [HotEqn]
| 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. |
Mathematics ----
LaTeX ---- LaTeX Primer ----
Applets ---- Developer
HotEqn ---- cHotEqn ----sHotEqn ---- dHotEqn ----
mHotEqn ---- Inheritance
Download ----
Editor
FAQ --- Update ---
Errors
New: Version 4.00 |
|
The 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 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.
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.
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:
<ent>. <grp>.<eqn>, may be a <ent> or a { <grp> }.<ent> and <grp> may be empty.
java.lang.Object
|
+----java.awt.Component
|
+----atp.cHotEqn
|
+----javax.swing.JComponent
|
+----atp.sHotEqn
java.applet.Applet
|
+---HotEqn - atp.cHotEqn
|
+---dHotEqn
|
+---mHotEqn
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>
<param name="name"value="value">
<param name="equation" value="<eqn LaTeX-expression>">
<param name="leftside" value="<eqn LaTeX-expression>"> <param name="rightside" value="<eqn LaTeX-expression>">
| Parameter Type | Code Syntax | Examples |
|---|---|---|
| Font type |
<param name="fontname" value="fontname">
fontname = Helvetica (default)
TimesRoman
Courier
Dialog |
|
| 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 |
|
| Foreground color | The applet default foreground color (default:
black) can be modified by the hex value rrggbb <param name="fgcolor" value="rrggbb"> |
|
| 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"> |
|
| 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
rightIf the space is too small, the necessary width and height
parameters will be printed on the Java console. |
|
| 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
bottomIf 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 |
| Mouse Operations | Actions |
|---|---|
| Left mouse button click with pressed Ctrl key | Applet window width and height are printed on the Java Console. |
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>
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). |
|
| 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 |
| Mouse Operations | Actions | Examples |
|---|---|---|
| Left mouse button click |
|
|
| 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. |
| Methods | Syntax | Examples |
|---|---|---|
| Sets expression | <applet name>.setEquation("<eqn LaTeX-expression>") | |
| 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>")
|
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.
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
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. |
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.
| 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. |
The mHotEqn Methods are the same as the dHotEqn Methods.
You are the visitor
of this page since 11th February 98
[VCLab-Main] [Software] [HotEqn]