% LaTeX \documentclass[leqno]{article} \usepackage[utf8]{inputenc} \usepackage{url} \usepackage{graphicx} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{bm} \usepackage{gellmu} \pagestyle{plain} \thispagestyle{empty} \title{What is a Reasonable Authoring DTD\\[0.25\baselineskip] under SGML or XML for MathML?} \newlength{\centerskip} \setlength{\centerskip}{\topsep} \newcommand{\hsf}{\hspace*{\fill}} \newcommand{\tdbc}[1]{\hsf\textbf{#1}\hsf} \newenvironment{menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{-6bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{Menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{3bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{toclist}{\normalsize \begin{list}{}{ }}{\end{list}} \newenvironment{Toclist}{\large \begin{list}{}{ }}{\end{list}} \newenvironment{citations}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0bp} \setlength{\leftmargin}{0.04\linewidth} \setlength{\labelsep}{0bp} \setlength{\itemindent}{-0.2\leftmargin} \setlength{\itemsep}{3bp} \setlength{\parsep}{0bp}} }{\end{list}} \author{William F. Hammond \\{}Email: \texttt{hammond@math.albany.edu} } \begin{document} \begin{center}\LARGE\bfseries{} What is a Reasonable Authoring DTD\\[0.25\baselineskip] under SGML or XML for MathML? \end{center} \begin{center}\Large\bfseries{} \textsl{William F. Hammond} \end{center} \begin{center} Email: \verb|hammond@math.albany.edu| \end{center} \medskip \section*{1\ \ \label{SU-1}Introduction} \par{There has been a recent resurgence of interest in \textsc{MathML}\footnote{URI: http://www.w3.org/Math/}, the rather granular XML language developed by the World Wide Web Consortium (W3C) \textsc{HTML} Math Working Group during the period 1996-2000, due to the availability of \textsc{MathML}-capable builds of the browser Mozilla\footnote{URI: http://www.mozilla.org/}, the open-source development version of the popular browser NetScape. \ } \section*{2\ \ \label{SU-2}A Few Examples} \begin{enumerate} \item Compound fractions: \[ \frac{\frac{a}{b}}{\frac{c}{d}} \ = \ \frac{a d}{b c} \ \ . \] \item The formula for solving the quadratic equation \,\(a x^{2} + b x + c \, = \, 0\)\, (in a field of characteristic \(\neq{} 2\)): \[ x \ = \ \frac{-{b} \pm{} \sqrt{b^{2} - 4 a c}}{2 a} \ \ \ . \] \item Mixed function application and multiplication: \[ {\sin {ax}}{\cos {bx}} \ \ . \] \item Newton's binomial series: \[ (1 + t)^{r} \ = \ \sum_{k=0}^{\infty{}} {\, \frac{r(r - 1)(r - 2)\ldots{}(r - k + 1)}{k!}\, t^{k} } \ \ . \] \item A differential equation: \[ D^{2} y - 3 x (D y)^{2} \ = \ x \cos x \ \ \ . \] \item Stokes's Theorem in space: \[ \int {\int_{S} {\, (\mbox{\textbf{curl}} \, \mbox{\textbf{F}} \,\cdot{}\, \mbox{\textbf{N}})\, d \sigma{}}} \ = \ \int_{\partial{} S} {\, (\mbox{\textbf{F}} \,\cdot{}\, \mbox{\textbf{T}})\, d s }\, \ \ . \] \item The continued fraction for the golden mean: \[ \frac{1 + \sqrt{5}}{2} \ = \ \frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\ldots{}}}}} \ \ . \] \item The representation \[ \mbox{Gal}(\bar{\mbox{\textbf{Q}}} / \mbox{\textbf{Q}}) \] of a centrally important object that one might choose to declare as the symbol \texttt{"galQ"}. \ In this instance, however the expression is formed using the following three declared symbols:\footnote{The command \emph{regch} is a variant of \emph{mbox} that is intended to denote the normal version of a ``regular'' character found in a mathematical context when that character is suitable for a hypothetical algorithmic application of an accent such as \emph{ovbar}. \ A general \emph{mbox} is regarded as not suitable for hypothetical algorithmic accenting.} \begin{center} \begin{tabular}{lcl} {}\textbf{\hsf{}Name\hsf{} } & \textbf{\hsf{}Rendering\hsf{} } & \textbf{\hsf{}\textsc{GELLMU} expansion\hsf{}} \\ {}\texttt{Q} & \(\mbox{\textbf{Q}}\) & \texttt{}\verb+\+\texttt{regch}\verb+{+\texttt{}\verb+\+\texttt{bold}\verb+{+\texttt{Q}\verb+}+\texttt{}\verb+}+\texttt{} \\ {}\texttt{Qbar} & \(\bar{\mbox{\textbf{Q}}}\) & \texttt{}\verb+\+\texttt{ovbar}\verb+{+\texttt{}\verb+\+\texttt{regch}\verb+{+\texttt{}\verb+\+\texttt{bold}\verb+{+\texttt{Q}\verb+}+\texttt{}\verb+}+\texttt{}\verb+}+\texttt{} \\ {}\texttt{Gal} & \(\mbox{Gal}\) & \texttt{}\verb+\+\texttt{mbox}\verb+{+\texttt{Gal}\verb+}+\texttt{} \end{tabular} \end{center} Here the example is repeated \[ \mbox{Gal}(\bar{\mbox{\textbf{Q}}} / \mbox{\textbf{Q}}) \] with the same presented appearance but this time as the declared symbol \emph{galQ}, which is defined without using other declared symbols in its definition. \ \end{enumerate} \section*{3\ \ \label{SU-3}Generating MathML} \par{There is a serious issue surrounding how one might migrate from traditional \TeX{}-like mathematical markup, which uses reasonably succinct mathematical notation based on the long tradition of Western mathematical notation, to an authoring markup that is fully adequate for translation to \textsc{MathML}. \ For example, how can we automatically translate, with full confidence, the \textsc{XML} versions of the above mathematical examples into \textsc{MathML}? \ Or, if we cannot, what additional information needs to be added? \ } \par{One possibility is offered by my draft on mathematical notation at the URL \begin{center} \url{http://www.albany.edu/~hammond/gellmu/notation} . \ \end{center} It attempts to explain what additional information is needed in this document to eliminate the need for guessing by an automated rendering system at work on these examples, as marked up in the \textsc{XML} version of this document. \ Note that no guessing is needed to render this document in either \textsc{HTML}, with mathematics set crudely but reasonably, nor to render it in \LaTeX{}. \ (Perhaps one may not fully appreciate this latter point without examining the XML version of this document\footnote{URI: http://www.albany.edu/\textasciitilde{}hammond/gellmu/authordtd/mathbench.xml}.) } \par{For the purpose of assistance in automated rendering to \textsc{MathML} as well as for the purpose of supplying semantic information for computer algebra systems, \textsc{GELLMU} provides a metacommand \emph{mathsym}\footnote{The name \emph{mathsym} is the default value of the variable \emph{gellmu-mathsym-name} in the syntactic translator.} for the formal declaration of mathematical symbols with the usage: \begin{center} \texttt{}\verb+\+\texttt{mathsym}\verb+{+\texttt{symbol-name}\verb+}+\texttt{}\verb+{+\texttt{symbol-rendering}\verb+}+\texttt{[symbol-meta-info]} . \ \end{center} Here \emph{symbol-name} is an alphanumeric string (case-sensitive) beginning with a letter. \ The second argument is the presentation rendering of the symbol in \textsc{GELLMU} markup. \ It is like the definition of a \emph{newcommand} except that it may not involve arguments.\footnote{However, a declared math symbol may be invoked in a \emph{newcommand} that takes arguments.} The optional third argument \emph{symbol-meta-info} is an alpha-numeric string that might also include possibly a few other string characters such as \texttt{`/'}, \texttt{`-'}, \texttt{`,'}, \texttt{`.'}, \texttt{`*'}, etc. \ Its exact structure depends on the production system. \ For example, it might consist of (name, value) pairs for conveying meta-information about the symbol. \ } \par{The syntactic translator replaces each invocation of a given \emph{mathsym} with the specified rendering and writes for each \emph{mathsym} definition a corresponding element in the \textsc{SGML} output whose content consists solely of the declared symbol name if there is no meta information but otherwise consists of the symbol name followed by a blank space and then whatever string of meta information is provided in the optional argument. \ Additionally, each invocation is wrapped in a rendering-inert \emph{Sym} element whose \emph{key} attribute reveals the name given to the symbol at the point of declaration (and by which the symbol is invoked). \ This makes it possible for a downstream authoring platform processor that has remembered the list of declared symbol names to match each invocation of a declared symbol with its associated meta information, if any, provided by the author in the symbol declaration. \ } \par{A related feature in the didactic \textsc{GELLMU} document type is the \emph{mlg} tag for marking mathematical logical groups. \ This is somewhat akin to the \emph{lgg} tag for \TeX{}-like logical groups, traditionally created in \TeX{} markup with braces that are not attached to a command.\footnote{Such unattached braces in \textsc{GELLMU} markup lead to an \emph{lg0} tag in the output of the syntactic translator that is translated to an \emph{lgg} tag in the \textsc{XML} version of the didactic document type.} As with \emph{lgg} there is no obvious evidence of an \emph{mlg} tag in a typeset rendering, but the presence of such a tag is intended as a signal to downstream mathematical parsers that the contents of the tag be given grouping priority as, say, with visible parentheses. \ Furthermore, the \emph{mtype} and \emph{mml} attributes of the \emph{mlg} tag may be used to pass semantic information about the tag's contents to a processor. \ } \par{The reader is invited to do one or more of the following: \begin{itemize} \item point out inadequacies in my draft on notation. \ \item improve my draft on notation. \ \item provide code to format the above examples in \textsc{MathML}. \ \end{itemize} } \end{document}