Up: WebEQ Documentation
Using the Sizer
Description
Sizer converts an HTML source file with embedded math mark up into an
HTML file with WebEQ applet tags. The math mark up is typically
WebTex, a LaTeX-like mark-up language, but it can also be a low level
"plist" format which directly controls the WebEQ rendering engine.
Math mark up in the HTML source file can be delimited in one of
two ways. Equations can be surrounded by <MATH> </MATH> tags, or
with the standard LaTeX delimiters $ $, and \[ \]. If the LaTeX
display equation delimiters \[ and \] are used, the resulting
applet tag will be set off with <P> tags, and will be centered.
If <MATH> </MATH> delimiters are used with WebEQ native markup,
attributes can be included in the begin tag, e.g.
<MATH MODE=DISPLAY> ... </MATH>
When used with WebTeX, begin tag attributes are discarded.
The Sizer attempts to compute applet dimensions that yield visually
acceptable results on all Java systems. However, there are still some
system font dependencies in Java, and as a result, the Sizer will
usually write out applet dimensions that are a few pixels too large, though
occasionally, an equation may be clipped as well. Applet dimensions
are worst using Netscape under Windows.
To facilitate the use of macros throughout a document, the sizer also
allows authors to include a macro definition block in the header of
the HTML source document as follows:
<HTML>
<HEAD>
<TITLE>An Example</TITLE>
<!-- webeq
\define{\gump}{x^2}
.
.
.
-->
</HEAD>
<BODY>
This is a test $\gump = 9$.
</BODY>
</HTML>
Usage Summary
The Sizer is usually run on an HTML input file with embedded markup.:
Since the Sizer is a Java program, it must be exectued by invoking the
Java interpreter on the full class name:
java geom.webeq.sizer.Sizer [options] inputfile
Options include: -size number
-xscale number
-yscale number
-leading number
-expand true | false
-bg #rrggbb
-parser latex | html
-delims latex | html
-codebase URL
-code name
-archive name
-cabbase name
-fontbase URL
-macro filename
-lfontbase URL (for sizing)
-lmacro filename (for sizing)
-eq input
-o outputfile
When an equation is specified with the -eq
option, the
inputfile is ignored, and the Sizer returns the dimension of just that
one equation.
Sizer Options
-size pointsize
- Set the initial pointsize at which equations are to be displayed.
Warning: this is system dependent, and doesn't necessarily correspond
to the browser font sizes. Any value is legal, but WebEQ rounds to
the nearest value in the list 8, 10, 12, 14, 16, 18, 24, 30, 36.
-xscale number
or -yscale number
- The sizer will multiply the equation dimensions by the scale and
yscale factors before writing out the applet tags. These parameters
allow one to partially correct for the system dependencies introduced
by differences in system fonts on various platforms.
-leading number
- Netscape has a centering bug that results in small applets not
being centered. One work around is to specify a minimum amount of
"leading" or space between lines that contain math in them. The
number specified in the leading parameter specificies the
minimum fraction of the current pointsize that WebEQ applets will
extend above and below the axis of the current line. If this number
is set to 0, the applets are sized to their true sizes, but may not
align well. If set somewhere around 0.7, the lines will spread
slightly, but the applets will align much better. The default is 0.
-expand true | false
- By default, the sizer will include a reference to macros in the
applet tages as specified by
-macro
option, or the
inclusion of a macro block in the document header. In order to speed
up execution time for readers, the sizer can expand macros and write
out the result in the applet tags, eliminating the macro processing
time for readers. To do this, set the -expand
option to
true.
-bg #rrggbb
- Set the equation background color to the specified rgb value. This
also forces the document body bgcolor value to agree. If a color is
set in the body tag, and no -bg value is set, the Sizer will for the
equation background to match the body. If neither a body or -bg balue
is set, the Sizer will force both to be gray.
-parser type
- Set the WebEQ input type to be latex or html. In reality, this
means "minitex" or WebEQ native markup. Type = "latex" or "html"
-delims type
- Set the type of delimiters used in the HTML source document. Type
= "latex" or "html".
-codebase URL
- Set the codebase in the applet tags. This can be an fully
qualified URL, or relative to the resulting HTML document.
-code name
- Set the initial applet execution point. By default, this is
geom.webeq.app.mdraw.
-archive name
- Set the archive parameter in the applet tag. At present, this
must be an uncompressed zip file, living in the codebase directory.
-cabbase name
- Set the cabbase parameter in the applet tag. At present, this
must be a Microsoft cab file, living in the codebase directory.
-fontbase URL
- WebEQ expects its fonts directory to be in the codebase directory.
If it is somewhere else, this switch sets the fontbase parameter in
the applet tag to point to it.
-macro filename
- a macro file to be used with the WebTex parser.
-lfontbase URL
- The Sizer expects the WebEQ fonts directory to live in a "classes"
subdirectory of the current directory (since the "codebase" is
meaningless for the Sizer). If it is located elsewhere, you must
specify the location with this switch.
-lmacro filename
- the location of a WebTex macro file for use during the sizing
process. By default, the sizer expects the macro file in the current
directory
-eq input
- Return the applet tag for the single equation specified by input.
Note that the input must contain delimiters.
-o outputfile
- output to the named file. By default, output is written to
stdout.
Examples
A simple invocation for processing a source file welcome.src is:
java geom.webeq.sizer.Sizer welcome.src > welcome.html
A more typical example, setting some applet parameters is:
java geom.webeq.sizer.Sizer -codebase classes -parser latex
-delims latex -bg #ffffff -o welcome.html welcome.src
In this example, the processing is being done in a different
directory so we must set the local fontbase and local macro file,
as well as specifying the classpath for the WebEQ files:
setenv CLASSPATH $CLASSPATH:/u/htmldocs/classes
java geom.webeq.sizer.Sizer -codebase classes -parser latex
-delims latex -lfontbase /u/htmldocs/classes/fonts/
-lmacro /u/htmldocs/my_macros -o welcome.html welcome.src
Up: WebEQ Documentation
Copyright © 1996-1997 by
The Geometry Center.
All rights reserved.