Up: WebEQ Documentation

WebTeX: A Mark-up Language for WebEQ

WebTeX is an equation mark-up language for WebEQ. In the style of its syntax, it is similar to LaTeX. It is important to bear in mind, however, that this similarity is superficial, and the underlying rendering engine is quite different from that of TeX.

WebTeX is a reasonably rich language, and by using a small number of macros, careful authors can write LaTeX documents using only WebTeX math commands. By the same token, it is trivial to convert an HTML/WebTeX document to a LaTeX document.

Authors should not expect to easily convert existing TeX documents to WebTeX.

Command Summary

Symbol Commands

A large number of TeX symbol characters are supported by WebEQ. For reference, there is a list of the WebEQ symbols.

Font Commands

These commands change the font family:

	\mathrm{}	Roman		\mathit{}	italic
	\mathbf{}	bold 		\mathbb{}	black board bold
	\mathfr{}	fraktur		\mathcal{}	caligraphic
	\mathsf{}	sans serif	\mathtt{}	typewriter

One may also change the font color:

        \fontcolor{#rrggbb}{}
The following commands change font size:

	\textsize
	\scriptsize
	\scriptscriptsize
The following commands determine the rendering mode. The mode determines where the limits are positioned for large operators like the summation sign, and how vertically compacted fractions are.

	\displaystyle
	\textstyle	

Caution: This is a significant difference between WebTeX and TeX. In TeX the mode and size are combined into single commands.

Spacing Entities

The following commands (and their synonyms) insert space:

	\thinsp	       	or	\,
	\medsp		
	\thicksp	
	\negsp		or	\!
	\quad

In addition, the following commands generate a box which for centering purposes has a 0 width or 0 height. The enclosed expression is rendered in the indicated direction from the one-dimensional reference point. A typical use is over set arrows in commutative diagrams.

	\llap{}		\rlap{}
	\ulap{}		\dlap{}

Finally, there are general space entity, and a general space entity:

	\rule{ht}{dp}{wd}
	\space{ht}{dp}{wd}

Accents

Wide versions of accents stretch to the width of the enclosed expression.

	\hat{}			\widehat{}
	\check{}		\widecheck{}
	\bar{}			\widebar{}
	\vec{}			\widevec{}
	\tilde{}		\widetilde{}
	\dot{}	
	\ddot{}

Variable Size Operators

These operators automatically switch size in display mode. Thus, to obtain a large version in inline mode, one would use {\displaystyle \cup}. This also controls the placement of limits for operators like \sum.
	\sum		\coprod		\prod
	\oint		\int		\otimes
	\oplus		\cup		\cap
	\wedge

Log-like symbols

The standard functions, namely those in table 8.9 in The LaTeX Companion, behave like \log. That is, they render in an upright font, and have operator spacing around them. In addition, one can force any identifier to function as an operator using the
	\operatorname{}

command.

Delimeters

Delimeters grow to just cover the enclosed expression when marked by the \left and \right commands. These commands are required to match, though either delimiter can be omitted: $\left \frac{x}{y} \right |_{x=0}$

Caution: This is a significant difference between WebTeX and TeX. In TeX, some delimiter is required after the \right or \left command

By default, delimiters grows symmetrically around the axis of the equation. When enclosing a matrix that is aligned top or bottom, for example, one needs the delimiters to "float" to match the alignment of the enclosed expression. To accomplish this, use the \floatleft and \floatright commands instead. For matching purposes, a \floatleft will match a plain \right and vice versa.

	\{		\}
	\lfloor 	\rfloor
	\lceil  	\rceil
	[		]
	(		)
	\langle 	\rangle
	|		|		(absolute value bars)
	\|		\|		(norm bars)

Text Boxes

The text command allows no formatting of text other than the use of spacing entities. Dollar sign delimited math can be nested in \text material.

	\text{}

Scripting Constructs

	^,  _			subscripts and superscripts

        \^{presup}{base}        preceding subscripts and superscripts
        \_{presub}{base}        (braces are not optional even for
                                 single character scripts)

Scripting operators work much the same as they do in LaTeX. With ordinary subscripts and superscripts, the script need not be enclosed in braces, if it is a single token. In general, WebTex and LaTeX tokens are the same -- any single character or symbol.

Another difference is the way in which one does tensor indices in WebTex. Additional scripts attached to a base are raised or lowered by the same amount as the first set, and aligned in vertical columns. Thus, R^i_j^k_l has more or less the same effect as R^{ik}_{jl} in LaTeX. However R^{x^2}_i^{y^2}_j turns out more like R^{x^2}_i {}^{y^2}_j in LaTeX. Of course, one can "turn off" the tensor indicies in WebTeX by inserting extra braces: {R^i_j}^k_l

Prescripts function just like ordinary scripts with the exception that braces around the scripts are not optional. In particular, multiple prescripts also act like tensor indicies by default.

Other Math Constructs

	f'			(equivalent to f^\prime)

	\sqrt{}			\root{n}{expr}
	\frac{}{}		\binom{}{}
	\overbrace{}		\underbrace{}
	\overset{}{}		\underset{}{}

Arrays

In WebTex, all alignment is done via a single array command, e.g. cases, commutative diagrams, aligned equations and matrices. Arrays can be nested. The basic commands is:
	\array{}	\\ separates rows, & separates cells

The first entry in an array, row or cell may optionally be the appropriate options block:

	\arrayopts{}
	\rowopts{}
	\cellopts{}

Each of these option blocks can contain any collection of option settings:

        Array options:

        \collayout{[left|center|right|solid|dashed]*}
        \align{top|bottom|center|r#n}
        \padding{number}
        \equalrows{true|false}
        \equalcols{true|false}
                

        Row options:

	\align{top|center|base|bottom}
	\underline{none|solid|dashed}

        Cell options:

	\rowspan{number}
	\colspan{number}
        \rowalign{top|center|base|bottom}
        \colalign{left|center|right}

Cells that span overwrite adjacent cells. The author is responsible for insuring that the masked cells are empty. A spanning cell is anchored at its upper left corner.

Caution: This is a significant difference between WebTeX and TeX. Arrays and alignment are done totally differently in Tex.

Macro Definition

The syntax for defining macros with arguments is:

        \define{macro}[n]{expansion using #1, ...#n to represent arguments}

Specifying Actions

Because WebTex is designed for interactive media, there are a number of mark-up commands specifying actions:

	\href{URL}{expr}
	\statusline{message}{expr}  status message on mouse over
	\fghilight{color}{expr}	    foreground hilight on mouse over
	\bghilight{color}{expr}	    background hilight on mouse over
	\toggle{expr1}{expr2}{prompt1}{prompt1}
                                    toggle expressions on click


Up: WebEQ Documentation
Copyright © 1996-1997 by The Geometry Center. All rights reserved.