Mathematics for HTML Email and Forums

Paul Kates,  Mathematics Faculty Liaison, University of Waterloo
June 9, 2005

  1. Writing math with simple text or LaTeX math formulas displayed with jsMath
  2. ... more text math and LaTeX math formulas displayed with jsMath
  3. What is jsMath?
  4. jsMath examples
  5. jsMath script for HTML
  6. LaTeX GIFs
  7. Online help with LaTeX
  8. Using jsMath with the University of Waterloo learning management system UW-ACE (ANGEL  LMS)

Writing math with simple text or LaTeX math formulas displayed with jsMath

Text
LaTeX math
jsMath
f(x) = sqrt(x + 2) +  | sin(2x) |
f(x) = \sqrt{x+2} + \bigm| sin(2x) \bigm|
f(x) = \sqrt{x+2}+ \bigm| sin(2x) \bigm|
y =  a * x^3 + b * x^2 + c * x +  x^(1/3)
y = a x^3 + b x^2 + c x + x^{1/3}
y=a x^3+bx^2+cx+x^{1/3}
lim{h --> 0}  ( f(x + h) - f(x) ) / h )
\lim_{h\to 0} \frac{f(x + h) - f(x)}{h}
\lim_{h\to 0} \frac{f(x + h) - f(x)}{h}

f'(x) = 
lim{h -> 0} f(x+h)- f(x)
 ------------
h
f '(x) =
 \displaystyle{\lim_{h\to 0}
\frac{f(x + h) - f(x)}{h} }
f^{\, \prime} (x) = \displaystyle{\lim_{h\to 0} \frac{f(x + h) - f(x)}{h}}
sum{k=1 to infinity}  a_k / k!
\sum_{k=1}^{\infty} a_k / k!
\sum_{k=1}^{\infty} a_k / k!
integral{a to b} sin(t) dt =
        -cos(a) - (-cos(b))
\int_a^b sin(t) dt = -cos(t) \bigm]_a^b
\int_{\textstyle a}^{\textstyle b} sin(t) dt = -cos(x)\bigm]_{\textstyle a}^{\textstyle b}

... more text math and LaTeX math formulas displayed with jsMath


Text
LaTeX math
jsMath
a <= b,  c >= d, e != f, g <> h
a \le b, c \ge d, e \ne f,  g \ne h
a \le b, c \ge d, e \ne f, g \ne h
i << j, k ~ m,  n = = p i \ll j,  k \approx m,  n \equiv p i \ll j, k \approx m, n\equiv p
a in A,  A subsetof B,  C supersetof D
a \in A,  A \subset B,  C \supset D
a \in A, A \subset B, C \supset D
delta f / delta x,  pi,  epsilon, 
{\Delta f \over \Delta x},  \pi,  \epsilon
{\Delta f \over \Delta x}, \pi, \epsilon
N natural,  Z integer,  Q rational
\unicode{x2115}\;\unicode{x2124}\;
\unicode{x211A}
\unicode{x2115}\;\unicode{x2124}\;\unicode{x211A}
R real,  C complex \unicode{x211D}\;\unicode{x2102} \unicode{x211D}\;\unicode{x2102}

What is jsMath?

jsMath examples

jsMath script for HTML

<!-- Use the UW-ACE editor macro feature to record and use the necessary HTML code below -->
<!-- Place before the first use of LaTeX in a question or email. -->
<script src="jsMath.js"></script>    <!-- example only -->

<script src="https://uwangel.uwaterloo.ca/AngelUploadsuwangel/Content/Paul_Kate_s_Test_Course/_assoc/jsMath/jsMath.js"></script>

<!-- Write math using LaTeX math notation -->
<!-- Use the SPAN tag for math within a text line -->
If <SPAN CLASS="math"> f(x)=x+2 </SPAN> then
     <SPAN CLASS="math"> f(4)=6 </SPAN>.

<!-- Use the DIV tag for math centered and displayed alone on a text line -->
 <DIV CLASS="math"> \sum_{i=1}^{n} i = {n(n+1)\over 2} </DIV>

<!-- Some left-aligned display math using html styles -->
<div class="math" style="text-align: left;">
      \int^{10}_{1} f(x) dx
</div>

<!-- Place after last use of LaTeX in quiz question or email. -->
<SCRIPT> jsMath.Process() </SCRIPT>


LaTeX GIFs

In addition to using jsMath for writing LaTeX mathematics, there are tools to create images of mathematics,
which can be included in HTML pages - UW-ACE - for example.

Make a gif image at one of the locations below and cut and paste it into an HTML page.

Roger's online equation editor - a LaTeX to gif  application  (resolution is in pts and indicates the size of the gif, 72 pts ~ 1 inch)
tex2im - similar

Online help with LaTeX

AMS LaTeX ref card
Comprehensive LaTeX reference card geared towards AMS maths

Page one of another TeX reference card contains most of the math notation in jsMath except for the LaTeX equation, array and eqnarray environments.

The CTAN home page is the location of up to date LaTeX software and documentation. So is the article on TeX in wikipedia.org. The wiki engine running wikipedia.org takes TeX input and displays high quality math images. Its TeX math formula page is an easy way to look up examples of input math notation.

Advice writing mathematics with simple text is located at  Math Notation via Email and Typing Math.

Using jsMath with the University of Waterloo learning management system UW-ACE (ANGEL  LMS)



Paul Kates pkates@uwaterloo.ca, June 9, 2005