Prev Next

An Example Using Latex Math Formula Commands

latex
The latex command is used to display mathematics that is specified using the Latex math formula commands defined in Section 3.3 of Lamport's book . These commands are documented in the latex command documentation sections of this web site.

Execute The Following Steps

latex_example.omh
Use an editor of your choice to create the file latex_example.omh in the test directory with the following contents:
     
$begin
latex_example$$
     $spell
     	Mozilla
     $$
     $section An Example Using Latex To Display Mathematics$$
     
     $head Browser$$
     Any browser can be used to view the HTML file for this example.
     The Mozilla
     browser should be used to view the XML file for this example.
     
     $head In Line$$
     The sum
     $latex
     	\sum_{n=1}^\infty 2^{-n}
     $$
     is equal to one.
     
     $head Display Mode$$
     The sum
     $latex
     \[
     	\sum_{n=1}^\infty \frac{1}{2^n}
     \]
     $$
     is equal to one.
     
     
     $end
Note that you can copy and paste the commands above to your editor window. You may just copy the file with the same name from the getting started directory .

Example In This Web Site Context
You can view the result of making image_example.omh part of the OMhelp help web site by selecting latex_example .

Execute OMhelp
In a command window and in the htm directory execute the following command
 
     omhelp ../latex_example.omh  -noframe
     omhelp ../latex_example.omh -xml -noframe
The first command creates a set of HTML files. The second command creates a set of XML files. In the HTML case, the Latex commands appear to the viewer. In the XML case, the Latex commands are translated to MathML commands and the viewer will see the mathematics.

Example by Itself
Use any browser to view the file test/htm/latex_example.htm . Use the Mozilla web browser to view the file test/htm/latex_example.xml .
Input File: getstarted/start_latex.omh