Latex2html, tex4h and MathJax example on small bit of math

by Nasser M Abbasi, updated May 5, 2012

The latex file is

\documentclass[12pt]{article}
\usepackage{html}
\usepackage{color}
\pagecolor{white}
\usepackage{amsmath}
\begin{document}

 \begin{align*}
  v^{2}   &  =\left(  \dot{x}+v_{x}\right)  ^{2}+v_{y}^{2}\\
          &  =\dot{x}^{2}+l^{2}\dot{\theta}^{2}+2\dot{x}l\dot{\theta}\cos\theta
  \end{align*}

\end{document}

Results

  1. latex2html foo.tex
  2. htlatex foo.tex "html"
  3. Mathematica HTML output
  4. MathJax produces (renders directly in browser, assuming your browser supports it then you'll see the math below). \[ \begin{align*} v^{2} & =\left( \dot{x}+v_{x}\right) ^{2}+v_{y}^{2}\\ & =\dot{x}^{2}+l^{2}\dot{\theta}^{2}+2\dot{x}l\dot{\theta}\cos\theta \end{align*} \]

Side by side screen shots

As seen on my firefox 12, on windows 7

latex2html tex4ht MathJax Mathematica

Appendix

versions of software used

latex2hmtl version
>latex2html -v
Note: Loading /home/me/.latex2html-init
This is LaTeX2HTML Version 2008 (1.71)
by Nikos Drakos, Computer Based Learning Unit, University of Leeds.
tex4ht version
tex4ht.c (2009-01-31-07:33 kpathsea)
latex version
>latex -v
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.46; using libpng 1.2.46
Compiled with zlib 1.2.3.4; using zlib 1.2.3.4
Compiled with poppler version 0.16.7
System is linux mint running inside VBox on top of windows 7
>uname -a
Linux me-VirtualBox 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 17:34:21 UTC 2012 i686 i686 i386 GNU/Linux

log files of build

  1. tex4ht_log.txt
  2. latex2html_log.txt