Browser Actions

Colorful symbols

The typical WebEQ applet displays its symbols in black, but you can change the color of any symbol with the \fontcolor command. This command has two arguments. The first argument gives the color and has the form of a # symbol followed by a six digit hexidecimal number ( #rrggbb ). The first two digits rr give the amount of red between 00 (black) and ff (bright red). The gg and bb have the same effect on the amount of green and blue, respectively.

The symbols that will be displayed in this color are placed in the second argument.

Here are some examples:

\fontcolor{#00ff00}{A}
produces a bright green letter `A'.
\fontcolor{#0000ff}{B}
produces a bright blue letter `B'.
\fontcolor{#ff0000}{C}
produces a bright red letter `C'.
\fontcolor{#880000}{D}
produces a darker red letter `D'.
\fontcolor{#ffffff}{\frac{1}{3}}
produces a bright white `one-third'.

The WebTeX Examples include examples of the use of \fontcolor.

Links to other pages

Since WebEQ displays applets on World Wide Web browsers, it is possible to create hyperlinks inside the applets. Any expression expr can be linked to the page at a given URL with the command \href{URL}{expr}. The expression expr will be highlighted in blue and clicking on this expression will send the browser to the URL in the first argument.

\href{http://einstein/homepage.html}{E=mc^2}

The WebTeX Examples include an example of the use of a hyperlink in a mathematical formula.

Footnotes on the status line

The status line on a web browser is the area at the bottom of a browser window that displays messages from time to time. Among other things, the status line tells the destination of a link when the mouse cursor passes over the linked text.

You may use the command \statusline{message}{expr} to create a text message which displays on the status line when the mouse moves over the expression expr. Think of this as similar to a footnote.

\statusline{Displayed when cursor touches y=2.}{y=2}

The WebTeX Examples include an example that uses the status line to explain the reason for the truth of an equation.

Highlighted expressions

In addition to creating footnotes, there are other things that you can get to happen when the mouse cursor touches special symbols in your applet. Any expression in the applet can be highlighted in a different color when touched by the mouse. This is done with the command \fghilight{color}{expr}, where the first argument is a hexidecimal number representing the highlighted color, and the second argument is the expression that is highlighted.

To highlight the equation y=x in yellow when the cursor passes over it, type

\fghilight{#ffff00}{y=x}
There also is a command \bghilight{}{}, which highlights the background in the given color, as opposed to the expression itself.

The WebTeX Examples include an example of highlighted symbols.

Toggling expressions

Another interaction between the mouse and WebEQ applets is provided by the \toggle{expr1}{expr2}{prompt1}{prompt2} command. Initially, the first expression expr1 is displayed. Once the cursor lies above this expression, the status line shows prompt1, as with the \statusline command above.

With a click of the mouse (left button), the first expression is replaced with a second expression, expr2. The second prompt, prompt2 will now be displayed when the cursor is over the second expression. Another mouse click will return the first expression.

In short, we can toggle between expr1 and expr2, with the two prompts to guide us.

The WebTeX Examples include an example of nested toggles.


[WebEQ Developers Suite]

Created: Dec 18 1997 --- Last modified: Sat Mar 24 17:25:39 2001
Copyright © 1997-2002 Design Science, Inc. All rights reserved.