|
The WebEQ Math Viewer is an applet that runs in a Web browser to display interactive equations. The Math Viewer applet works best when it is installed in the readers browser, like a plug-in. However, a web server can also be configured to download the applet program files along with Web pages that need it. The WebEQ distribution contain the necessary software to set up a Web server in this way, as well as the self-installing archive files which enable readers to install the applet in their browsers. See Distributing the Math Viewer Applet from a Web Server for more details. Applet tags in an HTML file instruct a Web browser to request that the Math Viewer applet be loaded and executed. These applet tags contain a number of parameters which control WebEQ options. In particular, these parameters tell the web browser what equation to display. All of the valid applet parameters are described in detail on a separate page. Some WebEQ features can also be controlled interactively by the reader. An obvious example is the WebEQ control panel which can be used to select a pointsize. Other kinds of interactivity can be described in the equation markup. These include foreground and background hilighting, status line cues, linking and toggling between expressions. Finally, many other more sophisticated kinds of interactivity can achieve by programming the Math Viewer behaviour via JavaScript. See Programming WebEQ with JavaScript for details. Using the Math Viewer in IE5Starting in Internet Explorer 5, is it possible to take advantage of proposed behavior extensions to CSS in order to set up the Math Viewer as a rendering behavior (sometimes called a DHTML behavior) for MathML markup included in HTML files. This is done by including some initialization code in the header of the document, and putting two additional JavaScript files in the same directory with your document. See Using the Math Viewer in IE5 for details. There are several major advantages to using the Math Viewer as a DHTML behavior:
Another big advantage to using the Math Viewer behavior in IE5 is that it allows you to create documents in which the MathML renders properly in both IE5 and the new Mozilla browser, which will also render strict MathML. Using Math Viewer AppletsIt is important to keep in mind that an applet is actually a program, and therefore you must run it in order to see how a particular equation is going to display. The standard way of running an applet is with a Web browser. For Java-savvy authors who already have a Java Developers Kit installed, Math Viewer applets, like any other applet, can also be viewed using an applet viewer. To view an applet in a browser, make sure that Java is enabled, and then view an HTML page containing the proper applet tags in the ordinary way. By default, a Web browser will first check to see if the applet is locally installed, and then look for it on the server in the same directory as the HTML file containing the applet tags. If the Math Viewer program files have been installed elsewhere on a server, the applet tags can specify the location. The applet tags also specify the equation to be displayed. Once the browser locates the applet, it automatically runs it to display the equation in the HTML page. If you haven't done so, you should look at the WebEQ Tour to see this in action. You might find it interesting to look at the HTML files as well, to get an idea of what applet tags look like. One subtlety that arises when viewing applets in a browser is that
HTML pages you open on your local disk behave somewhat differently
than pages you open from a Web server over the internet. As noted
above, the applet tags may specify a location where the browser should
look for the Math Viewer program files. When the Math Viewer applet
is installed in your browser, the browser just uses the installed
copy, and the location specified in the applet tags is not used.
However, if the Math Viewer is not installed in your browser the
location specified in the applet tags is used, and what values are
valid for the location depend on whether the file is on the local file
system or on a server: when you are opening a page on your local disk,
the applet tags can either specify a location on the local file
system, or a URL where the browser can find the This is most noticeable when you are using the WebEQ tools to create and view pages on your local computer, but your ultimate intention is to publish them on a Web server. Coordinating between the actual physical location of the WebEQ program files directory and the location specified in your HTML pages is perhaps the most common source of problems when using applets. Interactivity FeaturesThe main point of using WebEQ Math Viewer applets is to create interactive equations. The Math Viewer facilitates two kinds of interactivity: general purpose controls that are available to the reader independent of the specific equation being displayed, and specialized actions for a specific equation, specified by the author.General ControlsBy right-clicking on a Math Viewer applet, a reader can bring up a control panel. The control panel enables the reader to change the base pointsize for WebEQ equations. Because fonts are highly system dependent, the numerical values for pointsizes may not match up with the sizes given in the Web browser; however, the closest match is usually adequate. The control panel is shared by all Math Viewer applets. Once a control panel is created, it lurks in the background, and takes charge of new equations as they appear. In particular, the control panel will override pointsize values specified by parameters in applet tag. This means that the first Math Viewer applet with a control panel your browser encounters will determine the pointsize for all subsequent applets. In some cases, this behavior is undesirable. For example, if JavaScript size controls are being used to change both equation and font sizes in tandem, it is important that the control panel feature be disabled, so it doesn't interfere. In general, if an author wants to control the pointsize of an applet, instead of allowing the reader this privilege, its access to the control panel must be disabled. This can be done using the controls applet parameter. Another feature which can be enabled or disabled with a parameter is cut-and-paste. When cut-and-paste is enabled, a reader can select a subexpression in a WebEQ equation by holding down the left mouse button and sweeping out a region, as usual. Holding down the control key while left-clicking displays the MathML encoding for the selection to a pop-up window. From there, the MathML code can be selected, copied and pasted into other applications. Equation-specific ActionsBy using WebTeX commands or the MathML <maction> command, authors can bind any of four actions to any subexpression in an equation:
These interactivity features can all be used in conjuction with each other. A typical situation where this is convenient might be setting up a status line message in conjuction with a link. For details about specifying interactivity features using WebTeX or MathML, consult the reference documentation linked above. Writing Applet TagsGenerating applet tags in your HTML files is generally no more difficult than generating images. As an author, the hard part is to either write out the commands which describe the equation, or build it up in the Equation Editor. If you are using commands, generating the necessary applets can be easily accomplished by processing the input with the Wizard. There are a number of other Wizard options that determine the values that the Wizard sets for applet parameters. To master what all these options do, you will want to look at both the Wizard Options and Applet Parameters reference pages. If you are using the Equation Editor, use "Save As Applet" instead of the other "Save" options. The Equation Editor generates generic applet tags. In general, you may wish to customize the applet tags, adding addition parameters by hand, when you import them into your HTML file. Even if you generate your applet tags using the WebEQ tools, you will still have to understand enough of how an applet tag works to choose the correct settings for the Wizard, or to customize tags generated by the Equation Editor. The nuts and bolts of Math Viewer applet tags are described in detail in the Anatomy of a WebEQ Math Viewer Applet Tag. It is strongly recommended that you work your way through this discussion if you plan to use applets extensively. |
WebEQ 2.5 Documentation Table of Contents
Created: Aug 08 1997 ---
Last modified: Sun Sep 10 11:43:25 2000
Copyright © 1997-2000 Design Science, Inc.
All rights reserved.