Up: The WebEQ Math Viewer Applet

Anatomy of a Math Viewer Applet Tag

The most direct way of putting WebEQ Math Viewer applet into Web pages is to write the applet tags by hand in the HTML source. Most of the time, you will probably want to use the Page Wizard or Equation Editor to automatically create applet tags.However, situations still arise where it is very useful to understand enough of what is going on to change a parameter here or there by hand. This is especially true for the generic applet tags generated by the Equation Editor. Therefore, creating an applet tag by hand a few times is a very useful exercise, not unlike computing a derivative from the definition!

To put a Math Viewer applet in a web page, you put an applet tag in the HTML source code at the point where the notation should appear. The applet tag tells the browser to start the Math Viewer applet; it also specifies what equation it should display and some parameters that affect the way the equation appears. A typical Math Viewer applet call looks like this:

    <applet codebase="classes"
            code="webeq.Main"
            width=500 height=100>
    <param name=size value=36>
    <param name=eq value="y = \sqrt{x + 1}">
    </applet>

The equation that appears in the web page as a result of the above applet call looks like this:


    
    
    

Here's a breakdown of what everything in the above applet call means:

<applet codebase="../../classes"
        code="webeq.Main"
        width=500 height=100>
This begins the applet call. The codebase specifies where the WebEQ class files are to be found, relative to the directory containing the HTML file. When the Math Viewer applet has been locally installed in the browser, the codebase parameter is not directly used. However, for reader's who do not have the Math Viewer plug-in installed, the codebase parameter indicates the Math Viewer files are also installed in the directory ../../classes. The code value gives the name of the applet to run; it should always be webeq.Main, which is the name of the Math Viewer program. The width and height values give the amount of horizontal and vertical space, in pixels, that the browser should reserve for displaying the equation.
<param name=size value=36>
This tells the Math Viewer to use 36pt fonts. (This may be overridden by the WebEQ control panel, if you have already looked at other WebEQ applets. See the controls parameter.)
<param name=eq value="y = \sqrt{x + 1}">
This specifies the equation to be displayed. In general, the equation can be quite complicated and can include all sorts of special mathematical notation.
</applet>
This ends the applet call.
The WebEQ Math Viewer understands a number of parameters, such as size, and eq above, which control general aspects of how WebEQ should display an equation. Each of these is specified with the
<param name=... value=...> syntax as above.

In general, there are two things that must be specified in every Math Viewer applet call:

  1. The eq parameter value, which specifies the equation to be displayed, and any other WebEQ parameter values that you want to use to control the equation's appearance and behavior.

  2. The width and height values in the <applet...> tag, plus any other parameters that deal with how the browser should locate and execute the applet.
Setting the width and height values by hand is very difficult, and their values change if you change your equation or its font size. If you have only a few simple equations, this is probably not a problem --- you can find the right sizes for them by trial and error. If you have lots of equations, however, and/or expect to update your document frequently, you should use the WebEQ Page Wizard to determine the sizes for you. The Wizard also provides many other nice processing features, such as page-wide macros, that are not available to you if you write your applet tags directly.

At this point, you might want to read through the detailed descriptions of the WebEQ Math Viewer Applet Parameters.


[HOME] WebEQ 2.5 Documentation Table of Contents

Created: Aug 08 1997 --- Last modified: Sun Sep 10 11:45:53 2000
Copyright © 1997-2000 Design Science, Inc. All rights reserved.