#!/usr/local/bin/perl -- -*- C -*-
use CGI;
$query = new CGI;
print $query->header;
print $query->start_html('explain.pl');
print <<EOD;
<h1>explain.pl a subroutine to explain notation (mathematical) for WWW
users</h1>
This is a little routine which shows how one can print out instructions that
a student can "click" on, and use the "BACK" button on her browser to
go back to the original question.
In this example, we are attempting to indicate how subscripts and superscripts might
be indicated.
The example was written before HTML 3.0, i.e., before &lt;sub&gt; etc., were common.
Even so, students in entering equations would have to use this cumbersome scheme, since
we do not yet have a good Java based equation input tool.
The subroutine consists solely of print statements.
The last line is required so that the "require" statement is properly executed
in the calling program.
<pre>
sub explain
{
print" 
Instructions:
Subscripts are indicated using an underscore, i.e molecular oxygen
is indicated as O_2, while water is H_2 O (the space after the
2 is optional).
If the subscript requires more than one character, it is placed in
curly brackets, i.e., H_{2x}O would put the 2 and the x below the line.
 
Superscripts are indicated using the caret (^), and curly brackets
are used to group superscripts also.
The exponential, e^{2x^2} is &quot e to the power (2 times x squared)
&quot . Note, the x is squared, not the 2, (2*x*x) and all of this is in 
the exponent." ;
print "<P> ==========================================<P>";
print "R = 8.314 J/(mole &#176K) = 1.987 cal/(mole &#176K) = 0.082 liter-atm/
(mole &#176K)";
}
return -1;
</pre>
EOD
print $query->end_html;
