\documenttype[mathml-altheim]{html}
% Locate gellmu.el as "http://www.albany.edu/~hammond/gellmu/gellmu.el"
% Use: "emacs -batch -l gellmu.el -f gellmu-xhml whatever.glm" to make
% "whatever.xml". Then view "whatever.xml" with MathML-enabled Mozilla.
% The "mathml-altheim" \documenttype option sets it up the Carlisle/Altheim
% XHTML 1.1 plus MathML 2.0 unified document type definition.
% Actually there are three function calls of possible relevance here:
% gellmu-xml writes an xml declaration and "tight" defined-empty tags
% gellmu-xhtml reverences appendix C of the XHTML 1.0 spec
% gellmu-html is for classic HTML, i.e., HTML 4.01
%
\newcommand{\mns}{xmlns="http://www.w3.org/1998/Math/MathML"}
\newcommand{\drmath}[1]{\math[\mns class="display" mode="display"]{\mrow{#1}}}
\newcommand{\plus}{\mo{+}}
\newcommand{\mul}{\mo{ }}
\newcommand{\eqn}[2]{\mrow{#1}\mo{=}\mrow{#2}}
\newcommand{\bal}[1]{\mfenced{\mrow{#1}}}
\newcommand{\gexp}[2][\mi{e}]{\msup{\mrow{#1}\mrow{#2}}}
\newcommand{\infty}{\mi{∞}}
\newcommand{\dlog}[1]{\mfrac{\mrow{\mi{d#1}}\mi{#1}}}
\newcommand{\frac}[2]{\mfrac{\mrow{#1}\mrow{#2}}}
\newcommand{\int}[3]{\msubsup{\mo{∫}\mrow{#1}#2}\mrow{#3}}
\newcommand{\prod}[3]{\msubsup{\mo{∏}\mrow{#1}#2}\mrow{#3}}
\newcommand{\rpe}[1]{\rp[class="blankout"]{#1}}
\begin{head}
\style[type="text/css"]{
body {
html,background: #fff;
color: black;
background-color: white;
}
h1 {
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.display {
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.blankout {
display: none;
}
}
\title{MathML Examples}
\end{head}
\begin{body}
\h1{Use of the Ruby Module with MathML}
\h2[class="display"]{William F. Hammond}
\p[class="display"]{Copyright © 2001 William F. Hammond}
\p{
This is an XHTML document that uses the MathML and Ruby extensions of
basic XHTML markup.
}
\p{
The square of x is entered here using MathML:
\ruby{\rb{\math[\mns]{\msup{\mi{x}\mn{2}}}}\rpe{ [If you see
this text, your browser needs updating in order to handle one or both of
CSS and the XHTML Ruby module.]}\rt{-- TeX source: "x^2".}\rp{}}
}
\p{
Here is a displayed form of the Weierstrass infinite product expansion
of the gamma function.
}
\p{\ruby{\rb{\drmath{
\eqn{
\int{\mn{0}}{\infty}{
\gexp{\mi{t}}{\mi{x}} \mul \gexp{\mi{-t}} \mul
\dlog{t}
}
}{
\frac{\mn{1}}{\mi{x}} \mul
\prod{\mrow{\mi{k}\mo{=}\mn{1}}}{\infty}{
\mrow{
\frac{
\gexp{\bal{\mn{1}\plus\frac{\mn{1}}{\mi{k}}}}{\mi{x}}
}{
\bal{\mn{1}\plus\frac{\mi{x}}{\mi{k}}}
}
}
}
}
}}\rp{}\rt{\br;\br;
[If the MathML markup above does not render in your browser, consult
\a[href="gamma-iden.gif"]{this
image} or decipher the following equivalent pseudo-TeX source:\br;
\\int_0^\{\\infty\} t^x e^\{-t\} dt/t = \br;
(1/x) \\prod_\{k=1\}^\{\\infty\}
\\frac\{(1 + 1/k)^x\}\{1 + x/k\} ]\br;
}\rp{}}}
\p{
This web page is offered as an example of a fully functioning
XHTML 1.1 plus MathML 2.0 document that is both safe and usable
in a wide array of legacy web browsers such as NetScape 4.5 and
lynx 2.8 (rel 2).
}
\end{body}