tbook: User Element View [DTD Element View]
[Home] [Elements] [Entities] [Prev] [Next]

Element m

Synopsis

Mixed Content Model

(#PCDATA)

Attributes

NameTypeDefault Value
xmlns CDATA "" (fixed)
style CDATA None
class CDATA None
id ID None

Parameter Entities

The following parameter entities contain m: indexinline, inline

Description

Corresponds to $...$ in LaTeX, but uses a somewhat different expression syntax, see below. Attention: If it has an id, it's becoming a displayed Formula, with a number.

You can use <m> inside MathML's <math>. The same applies to <ch> and <unit>.

In principle, you can use <m> wherever you can use <mrow>. However, sometimes it may be necessary to enclose <m> and friends with <mrow>, because they may expand to multiple MathML elements.

tbook's “almost LaTeX” formula syntax

You can use directly MathML's presentation markup in tbook files. For this, insert <math> elements without worrying about namespaces. But except for not too complicated equations this is quite longish.

tbook's formula elements <m> and friends use simplified LaTeX syntax. You may use roots, fractions, standard functions like “$\sin$”, stretchable braces, sub- and superscripts and accents. You may nest these structures so deep until your XSLT processor complains. And you can use these elements inside MathML to get the best of both worlds. (However HTML output only contains valid MathML.)

Roots work with \sqrt, fractions with \frac, just as in LaTeX. Human text is included via \text that is known from AmSTeX. Standard functions are typed without a `\'. Stretchable braces are all braces immediately within a {...} grouping. Sub- and superscrips as in LaTeX, but always a possible subscript before the superscript. Accents are just written immediately before the accented variable or group, they're made wide accents if necessary. If you make a space between accent and anything that follows, the accent is treated as an operator. (So, a \vec becomes a \to.)

Here an example:

<m>&Hat;{1-x_{\text{eff}}} &ne; {( &int;_0^&infin; sin(&tilde;x)
                               \frac{\sqrt[3]{1/e}}&beta; dx )}
                          &ne; lim_{x &rarr; &infin;}\frac1x</m>

becomes

For HTML output, the responsible stylesheet produces:

<math><mover accent="true"><mrow><mn>1</mn><mo>-</mo><msub><mi>x</mi>
<mrow><mtext>eff</mtext></mrow></msub></mrow>
<mo>&Hat;</mo></mover><mo>&ne;</mo><mrow><mo>(</mo>
<munderover><mo>&int;</mo><mn>0</mn><mo>&infin;</mo></munderover>
<mi>sin</mi><mo stretchy="false">(</mo><mover accent="true">
<mi>x</mi><mo>~</mo></mover><mo stretchy="false">)</mo>
<mfrac><mrow><mroot><mrow><mn>1</mn><mo>/</mo><mi>e</mi></mrow>
<mn>3</mn></mroot></mrow><mi>&beta</mi></mfrac><mi>d</mi><mi>x</mi>
<mo>)</mo></mrow><mo>&ne;</mo><munder><mi>lim</mi><mrow><mi>x</mi>
<mo>&rarr;</mo><mo>&infin;</mo></mrow></munder><mfrac><mn>1</mn>
<mi>x</mi></mfrac></math>

Lucky us.

Notice that you can use <m>, <ch> and <unit> within MathML constructs. If you use these elements within a MathML equation array, you can generate alignment markers (in LaTeX known as `&' signs) with `#' signs, because this is shorter than &amp;. Put them where they would be in LaTeX. Although MathML requires such a marker at the very beginning of an equation row, this is not true for LaTeX, and not true for tbook.

MathML

In this context some words about MathML. You may use it if you want, for more complicated formulas you must use it, unfortunately. It's always enclosed by <math>...</math>, but only presentation markup can be transformed to LaTeX yet.

Equation arrays

tbook treats a <math> element as an equation array, if it consists of only one <mtable>, with a groupalign attribute or one or more <mlabledtr> rows. If you set groupalign="right center left", this leads to an eqnarray in LaTeX, and where `&' are in LaTeX, you have to use <maligngroup/> in MathML. Else the equations are just stacked and not aligned. But as already mentioned, you can also use <m> inside <math>, which is very helpful for equation arrays:

<math>
  <mtable groupalign="right center left">
    <mtr>
      <mtd id="test"> <m> 1+1 #=# 2 </m> </mtd>
      <mtd> <m> 4 #=# 2 · 2 </m> </mtd>
    </mtr>
  </mtable>
</math>

which is the same as LaTeX's

\begin{eqnarray}
 1+1 &=& 2 \label{Test} \\
 4   &=& 2 \cdot 2 \nonumber \\
\end{eqnarray}

and you don't want to see the HTML/MathML output tbook must create for that. By the way, being the only child element of an <mtd>, <m> is implicitly surrounded by an <mrow> which is necessary in this context.

Equation numbers

A tricky point is equation labelling and numbering. tbook supports three ways of giving an equation a label:

  1. A <math> element has an id attribute. Plain and simple.
  2. An <mtd> element with an id within an equation array (see above).
  3. An <mlabledtr> element with an id within an equation array, and the contents of the first <mtd> element of such an <mlabeledtr> row.

You may use the <ref> element to refer to such equations, but for the contents of the <mtd> element in the third case, you have to use <mathref>. I would recommend you to use only 1. and 2. See the MathML specs at the W3C for more information.

Parents

aphorism, caption, cell, cite, closing, em, footnote, heading, idx, item, ix, ix2, legalnotice, mathref, multipar, opening, p, pageref, proof, psfrag, quote, ref, subject, subtitle, term, theorem, title, to, verse, visual, vref, wrap


HTML Presentation of tbook by DTDParse (version 2.0beta6).