José Grimm Thème

Producing MathML with Tralics

Keywords: Tralics, XML, MathML, mathematics, LaTeX, HTML, Pdf

The purpose of this paper is to show that it is possible to translate almost every mathematical formula from L A T E X syntax to XML. The document you are reading contains a great number of formulas extracted from the T E Xbook, the L A T E X companion, the MathML recommendation, and translated into XML by Tralics; it is available in Pdf or HTML version.

The HTML version was produced using a very simple style sheet; mathematics are left unchanged, and you need a MathML-aware browser, like Firefox, or adequate plugins, and a set of fonts for the symbols or operators. The Pdf version was obtained by use of xmltex (a package by D. Carlisle that makes T E X an XML interpreter), and a great number of modifications to the file mathml2.xmt (that interprets elements in the MathML namespace). All files needed to produce this document are part of the Tralics bundle (version 2.10 or more).

Produire du MathML avec Tralics

Résumé Le but de ce papier est de démontrer qu'il est possible de traduire presque toutes les formules de mathématiques de la syntaxe L A T E X vers le langage XML. Le document que vous lisez contient un grand nombre de formules extraites du T E Xbook, du L A T E X companion, de la recommandation MathML, et traduites en XML par le logiciel Tralics. Il est disponible en HTML et en Pdf.

La version HTML est obtenue en utilisant une feuille de style assez simple, qui laisse les formules de mathématiques inchangées; pour la lire, il vous faut un navigateur ou un plugin qui sache interpréter le MathML et les fontes associées pour les symboles et les opérateurs. La version Pdf a été obtenue grâce au package xmltex de D. Carlisle (qui fait de T E X un interprète XML), et un grand nombre de modifications dans le fichier mathml2.xmt, qui contient le code d'interprétation des mathématiques. Tous les fichiers nécessaires pour obtenir ce document sont distribués avec le package Tralics à partir de la version 2.10.

Mots clés : Tralics, XML, MathML, mathématiques, LaTeX, HTML, Pdf

Introduction

The technical reports [START_REF] Grimm | Tralics, a L A T E X to XML translator[END_REF] and [START_REF] Grimm | Tralics, a L A T E X to XML translator[END_REF] describe some features of the Tralics software, a L A T E X to XML translator, and associated tools. In particular, we explain how the XML file can be converted to HTML, or to Pdf (using the excellent work of D. Carlisle and S. Rahtz ([Rah03], [START_REF] Carlisle | De XML à PDF avec xmltex et PassiveT E X[END_REF], [START_REF] Carlisle | XMLTEX: A non validating (and not 100% conforming) namespace aware XML parser implemented in T E X[END_REF]). One application is RalyX (Inria's Annual Activity Report), where all math formulas are converted to images before inclusion in the HTML document.

Recently, the cedram (Centre de diffusion de revues académiques de mathématiques, http://www.cedram.org/) has decided to convert the metadata of some collections (including the Annales de l'institut Fourier) from L A T E X to HTML, [START_REF] Bouche | A pdflatex-based automated journal production system[END_REF]. The Tralics software has been adapted for this purpose, the idea being the following: there are nowadays some browsers with a high quality math renderer, where native MathML formulas are more readable than images; thus the web site presents each document in two versions, neither of which containing an image. By default you see something like L 1 (T), and the alternate version contains $L^1(\mathbb{T})$. This looks like the source code, but non-trivial operations are performed, as explained below.

There is a torture file that comes with Tralics; the purpose is to make sure that no error occurs while compiling expressions like \cfrac12, but it is hard to check that the result is correctly translated. For this reason, we decided to create a sample file containing, not only all examples of the L A T E X companion second edition [START_REF] Mittelbach | The L A T E X companion[END_REF], but also those of the T E Xbook [START_REF] Knuth | The T E Xbook[END_REF], or the MathML recommendation [START_REF]Mathematical Markup Language (MathML) Version 2.0[END_REF], and to convert it to HTML. Translation is correct if the HTML page prints correctly. This file is available on the Web, we hope that it will convince you to use the Tralics software, and put your math documents on the Web. We have inserted comments explaining why some constructions do not work, if you have a solutions or suggestions, please send mail to the author.

We also wanted to make sure that the RalyX still works: more than one hundred teams use Tralics once year, asking sometimes silly questions, like: how to add color to the text, or a page break; the answer is generally either 'not yet implemented, wait for next year', or 'incompatible with the Raweb semantics'. This document uses colors and page breaks, as explained below; no modification to the translator was needed, but, unless the style sheets are modified, these additions are ignored.

For these reasons we converted the whole document to Pdf. This was not trivial, especially because of a lack of font families (this will be discussed later). Note also the format of the document: in the HTML version all metadata (author, title, abstract, etc.) are placed at the start of the document by the XML to HTML processor. In the case of the Pdf version, this was not so easy: something as trivial as \newpage \null \vskip-2cm is impossible to express in XSL/FO (said otherwise, all my attempts failed), and I had to add a new element <vspace> for this purpose.

The source file testmath.tex is part of the Tralics distribution; translating it requires Tralics version 2.10, and some packages, like amsmath (do not try to include the file amsmath.sty, this is not possible; you must use amsmath.plt instead). In most cases we show the T E X source before the translation. There are some exceptions, for instance we leave as an exercise to find out how we solved the exercises of the T E Xbook. Examples of the L A T E X companion [START_REF] Mittelbach | The L A T E X companion[END_REF] are available on the CD that comes with the book.

The XML file was converted into HTML, math formulas are left unchanged. We explain in some cases that what we see is not what we expected. Here FL means Firefox on Linux (unless specified, it is Firefox 2.0, on Fedora Core 3) and FM means Firefox on MacIntosh (unless specified, it is Firefox 2.0 on a PowerBook G4, MacOS 10.4).

Installing math fonts for use with a web browser is not always easy: they are installed as explained on the Mozilla web page, but this page seems unclear to me: on one Linux machine, Firefox is happy with the fonts, but uses the wrong font when printing, on another one, Firefox says that fonts Math1, Math2 and Math4 are missing, but the printed result is correct.

RR n°6181

Special features

You are not supposed to insert page breaks in your document, but if you put twenty tables in a row, you will get error messages of the form: two many unprocessed floats, and then you are in trouble. In this case, the only remedy is to insert some \clearpage commands; in this document, we used the <xbox> command in order to produce an empty <clearpage> element in the XML document, and we adapted the style sheets.

There is a \clearpage before this section; you will not notice it because there is a natural page break there. On the other hand, it is likely that you will see the page breaks in Chapter three, but there is no easy solution: there is no text in the current chapter to fill the gaps. In order to improve the layout, we changed the ordering of the figures, starting with tables 3 and 4, that occupy a full page, and inserting smaller tables after that. Moreover, table 4 was too big to fit on a page (the baseline in this document is much larger than in the L A T E X companion) and we split it into two parts. We are happy since this gives 8 full pages with floats, and a single bad page, the last text page of the chapter.

Concerning colors, you can put any attribute you like to any object (there is no attempt to validate the document against some DTD). In the case of math formulas, identifiers, numbers and operators accept some common attributes including font information and colors, these are currently ignored when converting XSL/FO into Pdf (but this can easily be changed, it suffices to add some lines of code to the raweb-cfg.sty file. However, the color attribute is honored for the <mstyle> element (all symbols appearing in the L A T E X companion for which no Unicode element has been found are replaced by a red X using this method). For the text case, the <inline> element is translated into <span> element in the HTML and a <fo:inline> element in the Pdf, all attributes are copied; in the previous sentence we have used \xbox{inline}{\XMLaddatt{color}{#F00000}\XMLaddatt{style}{color:#E00000}red} $\mathbox{mstyle} [

color][\#D00000]{X}$ \def\UnimplementedOperator{\mathbox{mstyle}[color][red]{X}}

This example shows that you can use a named color, or one defined in RGB syntax, using six hexadecimal digits; use sharp or backslash sharp as indicated here.

Compiling the example file

These are the options you can use when compiling the file testmath.tex -noentnames -trivialmath=7 -leftquote=2018 -rightquote=2019 -nozerowidthspace

The first option says that you prefer ⇚ to ⇚ (this is useless if you use an XSLT processor to convert the XML document). Option 'trivialmath=7' says that simple math expressions are translated as text; option 'mathvariant' says that a command like \mathbb should add a mathvariant attribute; these two options set initial values to some counters, they are not needed, because the associated file testmath.ult resets them to the values needed here. Following options are problematic. If you say 'nostraightquotes', this changes the translation of the apostrophe character to character U+B4, this option produces a nice HTML file, but the Pdf is not so nice. Here we modify left qnd right quotes to U+2018 and U+2019. If you say 'zerowidthspace', Tralics inserts an invisible character in verbatim mode, that is supposed to inhibit ligatures when converting the XML file into Pdf file, the trouble is that this character is shown as a normal space by my browser in certain cases. In Tralics version 2.10, the translation changed: the old behavior can be obtained by saying -nozerowidthelt. Otherwise an element is created, this element is transformed into a zerowidthspace character when the document is converted to Pdf, is omitted when the document is converted to HTML. This means that the option is useless.

INRIA

The following files are needed for the compilation:

• a configuration file, that behaves like the default one; namely one that defines the root element to be <std> and the dtd file to be classes.dtd;

• the source file testmath.tex, and the associated testmath.ult file;

• the class file report.clt (and the auxiliary file std.clt);

• the standard math packages amsmath.plt, amscd.plt, delarray.plt, amsxtra.plt, amsgen.plt, amsbsy.plt, amsopn.plt;

• the file fancyvrb.plt for the special verbatim mode; and

• the file RR.plt for the meta data.

When converting the document to HTML, we use the 'xsltproc' program. The style sheet is testmathhtml.xsl; this is a short style sheet; but it needs cls.xsl and RR.xsl. Conversion to XSL/FO uses RRfo.xsl as style sheet, it needs clsfo.xsl, that includes raweb3-param.xsl, rrrafo3.xsl, clspages.xsl, RRfosimple.xsl, clsfotable.xsl. Note: this list is likely to change; we have to separate clearly the RA (activity report), the RR (research report) and CLS (standard classes). All these files are in the directory xml or styles of the Tralics distribution, but the XSLT processor wants to see them in the current directory.

Conversion from XSL/FO to pdf is achieved by compiling the file wtestmath.tex containing the following lines \def\xmlfile{testmath.fo} \def\LastDeclaredEncoding{T1} \input{xmltex.tex} \end{document} It requires xmltex.tex and other files from the xmltex distribution, so that you must install these files first. There are some bugs or incompatibilities in the fotex distribution, so that you must use the two files fotex.xmt, fotex.sty as distributed in the xml directory. Additional required files are fotex-add.sty, raweb-uni.sty, and fotex.cfg. Finally the file wtestmath.cfg should be a symbolic link to raweb-cfg.sty.

Overview of math mode

The main change between Tralics version 2.9 and 2.10 concerns handling of math formulas. Two steps are required for processing them: first a tree is created, after that, it is converted. This mechanism is similar to the behavior of T E X, but some details are not yet implemented, and some information is lost (for instance, \mathbin is a command that says that the object that follows should be of type 'binary'; this information is used by the program, but the resulting XML tree does not contain this information (we cannot simply add an attribute pair class=bin to the object).

When Tralics sees a math formula, it constructs recursively a tree, also called a math list. The action after a token has been read is the following: If the token is expandable (a user defined command for instance), expansion takes place, this can read some tokens, it can add new tokens to the stream (to be read again). If the token is a mode-independent command it will be executed (for instance, you can change the meaning of some commands). Otherwise, the token is added to the tree, but there are some exceptions. The easy case is when a whole subtree is read, for instance when the token is a left brace, a \begin command, etc. In some cases, the execution level is incremented (said otherwise, the behavior is the same as a group defined by braces in non-math mode). In a case of \begin, a token list is read, and the behavior depends on whether this is a user defined environment (normal expansion rules apply), or a built-in one. Most built-in environments are matrix-like, and each cell is evaluated in a group; this has the following consequence: if the math formula contains an unwanted ampersand character, an error will be signaled when that character tries to finish the RR n°6181 cell-group (because the current group is of type math), and an error is signaled at the end of the math expression (because the ampersand character has added a second group after the first, a cell-group, where the end-of-math character expected a math-group). A third error will be signaled later: when the tree is converted into a MathML object, Tralics may complain about non-math tokens in the expression. A font change command like \mathbb changes the internal state and adds two tokens to the tree, one that selects the blackboard font (before the argument) and a token that selects the current font (after the argument).

In the case of $L^1(\mathbb{T})$ the tree has eight nodes. One is a subtree, containing the argument of the command. They are six characters, and two commands (select double-struck font, or select normal font). When the tree is converted into a MathML expression, some nodes are converted to basic XML elements (the letters), some are ignored (the font change commands), and others are used to construct an XML tree. We shall see later that parentheses, braces, and tokens like that can induce <mrow> elements; translation of the hat character is non-obvious, because MathML provides <msub> and <mover> as possible translations; a command like \nolimits placed after a token is an indication for the translation of the hat that follows. When the tree is converted the current style is looked at, this quantity depends on the position in the tree (the style of the numerator of a fraction or the style of an exponent after the hat is smaller than the current style, while the style of the numerator of a \cfrac is always text style) or the presence of style change commands. Some commands depend on the style (for instance \mathchoice) and are conditionally interpreted.

The characters in the formula above are of type letter (L, T), or type non-letter (the digit, or the parentheses), or other (the hat). An interesting question is: what happens if the single L (or any other character) is replaced by a double one? A first answer is that this just adds a new token to the tree (there is a special case: ^^1 is a non-obvious way to represents the character q). The superscript and subscript operators (generally associated to hat and underscore characters) are hybrid commands: most commands, for instance \frac, are prefix commands (they come before their arguments), a few commands, like \over, are infix operators (the first argument is before the operator). In the case of hat, there is one argument after the operator, but the operator acts on the kernel that is to its left (in the example the kernel is L, but a kernel can have an index and an exponent, so that the order of tokens can be: kernel, underscore, index, hat, exponent). Two hat characters in a row signal an error. Characters that are neither letters nor digits generally translate to a <mo> element. No attempt is made to convert two plus characters into a double plus character (some people use ':=' as an operator, meaning 'is equal by definition', and expect no white space between the two characters). Translation of L is a <mi> element; Tralics tries to converts LL or TT into a single element, according to the following rule. Assume that \T is defined to be \mathbb{T} and \TT is defined to be \mathbb{TT}. Then \TT produces a single element with two characters, while \T\T produces two elements with a single character. On the other hand, a strange rule of MathML says that the font used for a <mi> element (that lacks font attributes) depends on the number of characters in it; for this reason, in a formula like xy, the translation is a sequence of two <mi> elements, without attributes, containing a single character (implicit product). In a case like 17, a single <mn> element is constructed, because this represents a number (in a case like x 12 , an implicit comma could be added in the case where the expression refers to row 1 column 2 of the matrix x; however, do not expect such a behavior in a near future). The source code of the expression above is $x_{12}$. Without the braces, the translation is x 1 2 (if you do not see the difference, there is a bug somewhere).

If the internal counter \@nomathml is negative, the tree is converted to a character string in a trivial manner; in a case like \cfrac12, you will see \cfrac{1}{2}, because we have a sub-tree with two nodes (the two arguments of the command). In reality, the command takes an optional argument, and its value is printed only if it is not empty. In a case like L 1 (T), you will see two font changes as explained above. If you want to see the characters \mathbb there are two solutions: the easy one works only since version 2.10: Tralics inserts in the tree all commands that behave like \relax; these commands are ignored when converting the tree into a MathML expression, but the name is used INRIA otherwise; thus \let \mathbb \relax does the job. Otherwise, it suffices to redefine \mathbb in order to expand to the desired string (using \string for instance). Note: since version 2.10, a font change command that takes an argument defines a semi-simple group, by insertinf \begingroup and \endgroup commands.

Examples from the TEXbook

Typing math formulas, TB 16

The T E X book starts slowly; first Knuth explains that math formulas are enclosed in special math brackets, dollar signs. He also says that spaces are ignored in math mode.

'$x$', '$2$', '$ x$', '$ 2 $', '$(x + y)/(x -y)$', '$(x+y) / (x-y)$'
Easy formulas: 'x', '2', 'x', '2', '(x + y)/(x -y)', '(x + y)/(x -y)'.

We show here some Greek letters, and some other symbols: $\Gamma, \nu,\kappa$, $\phi,\emptyset, \epsilon,\in,\approx,\mapsto$ $(\phi,\theta,\epsilon,\rho)$, $(\varphi,\vartheta,\varepsilon,\varrho)$, $$\alpha, \beta, \gamma, \delta.$$ Greek letters Γ, ν, κ, and other symbols: φ, ∅, , ∈, ≈, →; standard Greek letters, (φ, θ, , ρ), and variants (ϕ, ϑ, ε, ), a display math formula:

α, β, γ, δ. \begingroup \catcode'\*=3 *x^2*, \( x_2\), \begin{math}\Sigma\end{math} **A** \[ B\] \begin{displaymath} C \end{displaymath} \endgroup
We show here that any character of category code 3 can be used as math delimiter: x 2 , as well as two alternative ways introduced by L A T E X: x 2 , Σ. We show that display math can be entered by doubling the character of category 3 (actual rules are more complicated, see the T E XBook), or using a L A T E X environment (additional environments will be explained in later chapters), or using brackets. Note that brackets are very useful, because they are so easy to type.

A B C Exercise 16.1: γ + ν ∈ Γ.
Exercise 16.2: \le,\ge,\ne, \leq,\geq, and \neq: ≤, ≥, =, ≤, ≥, =.

RR n°6181

Complex formulas with superscripts (up high) and subscripts (down low) . 3 )

$x^2$, $x_2$, $2^x$, $x^2y^2$, $x ^2y ^2$, $x_2y_2$, $_2F_3$, $x^{2y}$, $2^{2^x}$, $2^{2^{2^x}}$, $y_{x_2}$, $y_{x^2}$. Translation x 2 , x 2 , 2 x , x 2 y 2 , x 2 y 2 , x 2 y 2 , 2 F 3 , x 2y , 2 2 x , 2 2 2 x , y x2 , y x 2 . $((x^2)^3)^4$, ${({(x^2)}^3)}^4$.

4

. There is some magic implied in these formulas. Let's try to explain the problem. Translation of the first formula is as if all characters were of the same type; this is not completely true, as demonstrated by a bug in Tralics 2.9.4, that places some <mrow> elements incorrectly (we shall explain this later). The MathML recommendation says that some operators are stretchy, so that the width and height can depend on the context. This is not the case in xmltex, so that, in the Pdf version, all parentheses have the same size. The same is true for the HTML version in the first formula. Now, the <mrow> elements delimit a scope, so that inner parentheses are smaller than outer parentheses (but only for HTML, second formula); note that the placement of the exponent depend on the context, so that, in the second formula, all three superscripts at placed at different positions. In the case of the first formula, placement of the exponent depends only on the the size of the parentheses (hence, in the Pdf version, they should be aligned, in the HTML version, they are not).

The MathML recommendation says that the second alternative is better; but Knuth says: "The first alternative is preferable, because it is much easier to type, and it is just as easy to read."

'${}_2F_3$', '${_2}F_3$', '${_2F_3}$'
Exercise 16.3: Three ways to have an empty kernel: ' 2 F 3 ', ' 2 F 3 ', ' 2 F 3 '. The translation is the same in all cases because of the following two rules: if a math list starts with a subscript or superscript operator, an empty math list is added before, it serves as kernel (thus, braces in the first example are useless); a math list is packaged by putting it in a <mrow> element, unless the list has one element (in the second example, there are two tokens between the braces, converted to a single <msub> element, the math list has a single element, braces are useless). In these two cases, the main math list has two <msub> elements, and a <mrow> is added. In the last case, the main math list has a single element, a <mrow>, thus, no <mrow> is added and braces are useless.

'$x+_2F_3$' and '$x+{}_2F_3$'.
Effect of braces after plus sign: 'x + 2 F 3 ' and 'x + 2 F 3 '. The MathML recommendation says that distance between the plus sign and the letter F should be the same in both cases; in the first case, index 2 is attached to the plus sign, in the second case to the letter F.

${x_2}_3$, $\displaystyle {\sum}'$

Note that an <mrow> element is added for a math list with a single element in the case where it is followed by a subscript or a subscript. Reason one: in a case like x 23 , you will get an error if braces are omitted; in the same fashion, an error is signaled (when converting to Pdf) if <mrow> is missing.

Reason two, in a case like , the apostrophe is not placed above the sum if there is a <mrow> (the sum operator has type Op, but not the group, unless there is a \mathop before it).

Exercise 16.4: Double superscript, x y z , x y z .

$x^2_3$, $x_3^2$, $x^{31415}_{92}+\pi$, $x_{y^a_b}^{z_c^d}$. $P_2^2$ and $P{}_2^2$.

Simultaneous superscripts and subscripts

x 2 3 , x 2 3 , x 31415 92 + π, x z d c y a b .
Vertical alignment: P 2 2 and P 2 2 . In the first case, scripts are attached to the letter P, and alignment can depend on the slant of the letter.

'$\prime$', $y_1^\prime$, $y_2^{\prime\prime}$, $y_3^{\prime\prime\prime}$, $f'[g(x)]g'(x)$, $y_1'+y_2''$, $y'_1+y''_2$, $y'''_3+g'^2$

RR n°6181

Primes and shorthand: ' ', y 1 , y 2 , y 3 , f [g(x)]g (x), y 1 + y 2 , y 1 + y 2 , y 3 + g 2 . In the code shown here, the character used as delimiter for XML attributes is character U+39, the quotes around the math formulas are U+60 and U+B4 (this character can be changed via an option of the program, in verbatim mode it is always U+39, straight quote). The prime character used in the formula is U+2032. This is not the right character. Thus, in Tralics 2.9.5, translation of prime changed, it is now character U+39. The same formula is now: ' ', y 1 , y 2 , y 3 , f [g(x)]g (x), y 1 + y 2 , y 1 + y 2 , y 3 + g 2 .

$x\varprime y^\varprime, x\Prime y^\Prime, x\tprime y^\tprime,x\bprime y^\bprime,x\qprime y^\qprime$

The amsmath package provides the symbols shown above; as you can see, these characters are not meant to be used as an exponent: x y , x y , x y , x y , x y .

$\sqrt 2$, $\sqrt{x+2}$, $\underline4$, $\overline{x+y}$, $\overline x+ \overline y$, $x^{\underline n}$, $x^{\overline{m+n}}$, $\sqrt{x^3+\sqrt\alpha}$ Translation √ 2, √ x + 2, 4, x + y, x + y, x n , x m+n , x 3 + √ α.
There are problems with underline and overline on FM. Vertical position is not always good, and the length is sometimes incorrect. On the fifth formula, rules are sometimes invisible in the printed version. There is a text version in Tralics: Mfoo, Tfoo, Mfoo, Tfoo, Mfoo, Tfoo.

$\root 3 \of 2$, $\root n \of {x^n + y^n}$, $\root n+1 \of a$, $\sqrt [START_REF]Introduction to amslatex 3.2. Display and alignment structures for equations 3.3. Matrix-like environments 3.4[END_REF]{2}$, $\sqrt[n]{x^n + y^n}$, $\sqrt[n+1]a$, '$\sqrt [START_REF]Introduction to amslatex 3.2. Display and alignment structures for equations 3.3. Matrix-like environments 3.4[END_REF]{~~}$'.

Translation 3 √ 2, n √ x n + y n , n+1 √ a, 3 √ 2, n √ x n + y n , n+1 √ a, ' 3 √ '.
$\sqrt{\mathstrut a} + \sqrt{\mathstrut d} + \sqrt{\mathstrut y}$, $\sqrt{a} + \sqrt{d} + \sqrt{y}$, $\overline{a} + \overline{d} + \overline{y}$, $\overline{\mathstrut a} + \overline{\mathstrut d} + \overline{\mathstrut y}$.

Many more binary operators

x × y • z, x • y • z, x ∪ y ∩ z, x y z, x ∨ y ∧ z, x ± y ∓ z. Aliases x ∧ y ∨ z. INRIA $x=+1$, $3.142-$, $(D*)$ $x=\mathmo[form][prefix]{+}1$ $3.142\mathmo[form][prefix]{-}$ $(D\mathmi[mathvariant][normal]{*})$ $(D\mathmo[lspace][0][rspace][0]{*})$
Binary as ordinary symbols: x = +1, 3.142-, (D * ). The HTML version is slightly different from the T E X version. You can declare the plus sign as prefix operator, this gives x = +1, you can define the minus sign as prefix operator, this gives 3.142-. Removing the space around the star is more complicated, a solution consists of using an identifier in upright variant like this (D * ), or by setting the lspace and rspace attributes to zero: (D * ).

$K_n^+,K_n^-$, $z^*_{ij}$, $g^\circ\mapsto g^\bullet$, $f^*(x)\cap f_*(y)$

Binary operators in superscripts K + n , K - n , z * ij , g • → g • , f * (x) ∩ f * (y). Exercise 16.11: z * 2 and h * (z). $x=y>z$, $x:=y$, $x\le y\ne z$, $x\sim y\simeq z$, $x\equiv y\not\equiv z$, $x\subset y\subseteq z$ x = y > z, x := y, x ≤ y = z, x ∼ y z, x ≡ yX ≡ z, x ⊂ y ⊆ z.
In the Pdf version there is no space between the colon and the equals sign, but the HTML version shows some, because the rules are not the same for T E X and MathML. The best solution would be to use a single operator instead of two consecutive ones; the user can define a command \coloneq that behaves like colon-eq in normal T E X, or Tralics could be modified in order to recognise sequences like this. Translation of \not is problematic: in this document we consider it as an undefined operator, and you see a red X. We should add rules like: \not= should give \ne. $f(x,y;z)$, $f:A\to B$, $f\colon A\to B$ %\def\colon{\mathmo[lspace][0]{:}} Punctuation f (x, y; z), f : A → B, f : A → B. Note that \colon is a colon with lspace = '0pt', but the attribute is ignored in the Pdf version.

$12,345x$, $12{,}245x$, $\mathcn{12,345}x$, $\mathmn{12,345}x$ 12, 345x, 12, 245x, 12,345x, 12,345x. The translation of the first two expressions is the same, braces are useless here. A silly bug of my browser: the second digit of the first number disappears; this does not happen if the number is not the first word of a paragraph (this is why the sentence starts with a number). You should use one of the last two variants if you want the sequence of digits plus the comma to be considered as a number.

Exercise 16.12: 3 • 1416, but \mathmn{3^^b71416} gives 3 • 1416 (less space in the HTML version).

$\hat a$, $\check a$, $\tilde a$, $\acute a$, $\grave a$, $\dot a$, $\ddot a$, $\breve a$, $\bar a$, $\vec a$ \def\ihat{{\hat \imath}} \def\jhat{{\hat\jmath}} $\ihat$, $\jhat$ a, ǎ, a, á, à, ȧ, ä, ȃ, a, -→ a , ı, j. Character \jmath is a normal j, because there is no dotless j in most fonts. There is also a problem with the rendering of grave accents on FM.

$\hat{I+M}$, $\bar z+ \overline z$, $\widehat x, \widetilde x$, $\widehat{xy}, \widetilde{xy}$ $\widehat{xy}, \widetilde{xy}$ $\widehat{xyz}, \widetilde{xyz}$ % $\ghat\in{(H^{\pi_1^{-1}})}' -> Ex16.13 below

RR n°6181

Large accents I + M , z + z, x, x, xy, xy, xy, xy, xyz, xyz. As you can see, there is no difference between wide and non-wide operators. My browser shows a small hat, and a variable length tilde. For the Pdf version, we have decided to use the variable size variant.

Exercise 16.13: e -x 2 , D ∼ p α M + l, g ∈ (H π -1 1 ) , (braces added), g∈ (H π -1 1 ) (without braces). In the HTML version, without braces, there is a small opening parenthesis, a large closing one; in the Pdf version space on the left of the \in operator is missing.

More about Math, TB 17

$$ {1\over 2}\qquad {\rm and}\qquad {n+1 \over 3} \qquad {\rm and}\qquad {n+1 \choose 3}\qquad {\rm and}\qquad \sum_{n=1}^3Z_n^2. \label{eq17.1}$$ \[ \frac{1}{2}\qquad \text{and}\qquad \frac{n+1}{3} \qquad \text{and}\qquad \binom{n+1}{3}\qquad \text{and}\qquad \sum_{n=1}^3Z_n^2.\label{eq17.2}\] Example of vertical alignment. Translation of the first three expressions is a <mfrac> element, subexpressions are in text style (normal size). In the case of the last expression scripts are in script style (small size) and we have a <munderover> element for the sum (it is an operator with limits in display style) and a <msubsup> element for the Z (that is not an operator).

1 2
and n + 1 3 and n + 1 3 and

3 n=1 Z 2 n . (1)
The same, using L A T E X syntax 1 2 and n + 1 3 and n + 1 3 and Single over. The only difference in these expressions is the placement of the braces.

3 n=1 Z 2 n . (2)
x

+ y 2 k + 1 , x + y 2 k + 1, x + y 2 k + 1, x + y 2 k + 1 , x + y 2 k+1 . (3)
L A T E X style: this uses a command with two arguments, that behaves without surprise.

x

+ y 2 k + 1 , x + y 2 k + 1, x + y 2 k + 1, x + y 2 k + 1 , x + y 2 k+1 . (4)

RR n°6181

Without \displaystyle a 0 + 1

a 1 + 1 a2+ 1 a 3 + 1 a 4
Without \strut. Since a \strut is an invisible object of the size of a parenthesis, more or less the size of the digit one, its effect is hard to see.

a 0 + 1 a 1 + 1 a 2 + 1 a 3 + 1 a 4
Without both

a 0 + 1 a 1 + 1 a2+ 1 a 3 + 1 a 4
Until version 2.9.4, commands of the form \hfill were illegal in math mode. After that, they are allowed as first or last element in arguments of commands like \overline. They are ignored, unless the result is a fraction; we demonstrate here that \hfill placed at the end of the list produces a left alignment, in the case of \over, \genfrac, or \frac. Note that the \cfrac command can be used for continued fractions: its optional argument says whether the numerator is centered, left aligned or right aligned, under the assumption that the denominator is much larger than the numerator.

a 0 + 1 a 1 + 1 a 2 + 1 a 3 + 1 a 4 12345
T T D D , T T T T
. Note that the 'd' in \dfrac or \dbinom means that the expression is in display style, hence numerator and denominator are in text style; as a consequence the \choose is same as the \dbinom; on the other hand, the \over produces a fraction in text style, with numerator and denominator in display style, while the \dfrac produces a fraction in display style, with numerator and denominator in text style. In the dvi file, the distance between D and the fraction rule is the same as the width of the rule, and the distance between the T and the rule is approximatively one third of the height of the T; my HTML browser uses larger values, making the difference more obvious.

Exercise 17.7:

p 2 x 2 y p-2 - 1 1 -x 1 1 -x 2 .
Fine space added for legibility.

\[{\displaystyle{a\over b}\above3pt\displaystyle{c\over d}} \text{~~and~~} \genfrac{}{}{3pt}{}{\dfrac{a}{b}}{\dfrac{c}{d}}\]

There are six operators that behave alike: \over, \atop and \above, and the same with delimiters. The 'above' commands read a dimension, the thickness of the fraction rule. In the current version of Tralics, this has better to be explicit (if you want the value of \parskip, you must use \genfrac).

RR n°6181

This example demonstrates that the position of scripts depends on the style if the kernel is a math operator, and the presence of key words like 'limits', 'nolimits' or 'displaylimits'. Scripts can be added to a MathML object using m/sub/sup, and for an operator using m/under/over. In this last case, the attribute movablelimits corresponds to the 'displaylimits' keyword. If set, 'under' means 'sub' if the style is not display. Tralics uses 'under' or 'sub', depending on where the indices should be placed, and never sets the attribute. On the other hand, when T E X typesets a 'under' or 'sub', it sometimes uses a wrong strategy. The last expression (display style sum without limits) uses a \msubsup element; in this case, there is an implicit \nolimits, we cannot make it explicit, because such a command has to follow an operator, and there is no easy way to check that the first child of the element is an operator (it is easy to see that it is a <mo> element, a bit more complicated to see that it contains a Unicode character, and quite impossible to say that its translation leaves T E X in state where \nolimits is allowed). Note also that we could convert the argument to an operator, but this is not always a good idea. In this example the HTML versin is correct, the Pdf version is wrong.

∞ -∞ m n=1 , ∞ -∞ m n=1 , π 2 0 m n=1 \[\lim_ax+\lim\nolimits_l x+\lim\limits_ax+\lim\displaylimits_ax\] \[\textstyle \lim_lx+\lim\nolimits_l x+\lim\limits_ax+\lim\displaylimits_lx\] \[\sin_lx+\sin\nolimits_l x+\sin\limits_lx+\sin\displaylimits_ax\] \[\textstyle \sin_lx+\sin\nolimits_l x+\sin\limits_lx+\sin\displaylimits_lx\]
More about limits. Knuth says that \nolimits\limits produces limits; so that \sin\limits produces limits; a special feature of amsmath is that the token that follows the \sin is ignored if it is a \limits token. According to amsmath, an index A should be below the operator, an index L is a normal subscript; the example here shows that Tralics behaves more like T E X. In the first expression given here, and in exercise 17.9 that follows, scripts use an explicit 'script style' command, hence should be typeset in scriptstyle size. This is not the case in the HTML version: we have an atop in an atop, and the style of the inner one is wrong. The second formula uses a L A T E X command, this is not the right command for stacking indices because the first argument uses a smaller style than the second. The 0≤i≤m 0<j<n

P (i, j), 0≤i≤m 0<j<n
P (i, j)
Exercise 17.8:

p i=1 q j=1 r k=1 a ij b jk c ki .
Exercise 17.9:

1≤i≤n 1≤j≤q 1≤k≤r a ij b jk c ki or 1≤i≤n 1≤j≤q 1≤k≤r a ij b jk c ki . \[\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}}\] 1 + 1 + 1 + 1 + 1 + 1 + √ 1 + x. \[
a b c    d      1 2    t x y z
There are problems with slash, backslash, double vertical bar on Tralics 2.9.4. Concerning the double vertical bar, the following expression contains two different characters: = . The first character is Unicode U+2016 (entity ‖ in the file mmlalias.ent), obtained by \Vert in Tralics 2.9.4, accessible as \@Vert in following versions; the second character is Unicode U+2225 (entity ∥, ∥ and ∥ in the file mmlalias.ent), obtained by \parallel in Tralics 2.9.4, and also by \Vert in following versions. We changed this because the first character has fixed size as the following demonstrates 1 2 (the effect is only visible in HTML). Translation of backslash changed: it is now Unicode U+2216, you can use the backslash character (Unicode U+5C) by saying \char'\^^5c. Example: old is X \ Y , new is X Y , note the different spacing. On FM the rendering of up-down-array is wrong.

RR n°6181

Example of \bigl and \bigr, followed by the same code without these operations; currently there is no difference in the HTML version; in the Pdf there is more space in the equations on the LHS between closing brace and opening brace (same for bracket).

(x -s(x)) (y -s(y)) (x -s(x))(y -s(y)) [x -s[x]] [y -s[y]] [x -s[x]][y -s[y]] ||x| -|y|| ||x| -|y|| Example of big \[ \big(\big[\big\lbrack \big\{\big\lbrace\big\lfloor \big\lceil\big\langle\big/ \big|\big\|\big\uparrow \big\downarrow\big\updownarrow\frac 12 \big\Updownarrow \big\downarrow \big\Uparrow\big\Vert\big\vert \big\backslash\big\rangle \big\rceil\big\rfloor\big\rbrace\big\}\big\rbrack\big]\big)\] /| ↑↓ 1 2 ↓⇑ |
In the HTML version, everything is Big; in the Pdf version, everything is small from slash to backslash. Said otherwise, in the case of a pair big-left, big-right, you see a big operator; in other cases, Firefox shows a variable size operator, but not T E X.

\[ \big(\bigl[\Big\lbrack \Bigl\{\bigg\lbrace\biggl\lfloor \Bigg\lceil\Biggl\langle /|\|\uparrow \downarrow\updownarrow\frac 12 \Updownarrow\downarrow\Uparrow\Vert\vert\backslash \Biggr\rangle\Bigg\rceil\biggr\rfloor\bigg\rbrace\Bigr\}\Big\rbrack\bigr]\big)\]

A formula with all variants

/| ↑↓ 1 2 ↓⇑ |
Up to version 2.9.4, there was a bug in handling these big things. Currently, Tralics inserts \left and \right delimiters wherever possible. In the Pdf version, this formula is identical to the previous one.

In HTML, operators between slash and backslash (that have no big) are small before the fraction, large after that. This is strange.

Exercise 17.10:

∂ 2 ∂x 2 + ∂ 2 ∂y 2 |ϕ(x + iy)| 2 = 0.
Phi is $\phi,^^^^03c6$, ^^^^03c6 and varphi is $\varphi,^^^^03d5$, ^^^^03d5,

There is a problem in the rendering of the letter phi; the straight phi character is Unicode U+03D5.

As the example given here shows, the rendering of phi and varphi in math mode, at least on my machine: Phi is φ, φ, φ and varphi is ϕ, ϕ, ϕ, epsilon is , varepsilon is ε. We changed the translation, so that HTML and Pdf version show, in math mode, the desired result.

$\bigl (x\in A(n)\bigm|x\in B(n)\bigr)$, $\bigcup_n X_n\bigm\|\bigcap_n Y_n$, INRIA $\displaystyle{ {a+1\over b}\bigg/{c+1\over d}}$ Other big (x ∈ A(n)|x ∈ B(n)) and n X n n Y n and a + 1 b / c + 1 d .
Exercise 17.12:

(x + f (x)) / (x -f (x)). \[1+\left(\frac{1}{1-x^2}\right)^3,\qquad \pi(n)=\sum_{k=2}^n \left\lfloor\frac{\phi(k)}{k-1}\right\rfloor, \qquad \left|\left|x\right|-|\left|y\right|\right|, \qquad \left(\sum_{k=1}^n A_k\right),\qquad \biggl(\sum_{k=1}^n A_k\biggr)\]
Exercise 17.13: Comparison between \left and \bigl; translation is the same in Tralics.

1 + 1 1 -x 2 3 , π(n) = n k=2 φ(k) k -1 , ||x| -|y|| , n k=1 A k , n k=1 A k .
Exercise 17.14: was wrong in Tralics 2.9.4.

π(n) = n m=2     m-1 k=1 (m/k)/ m/k -1     |x| = x, if x ≥ 0 -x, if x < 0 T E X sets \nulldelimiterspace, unused by Tralics. 1 2 = 1 2 = 1 2 = 1 2
The \vcenter command is not implemented. Any box can be put into a formula by simply saying \hbox or \vbox or \vtop or \box or \copy; this is not implemented in Tralics, you can insert text in math mode via \text or \hbox.

Exercise 17.15: This shows the use of \mathchoice.

\def\puzzle{\mathchoice{D}{T}{S}{SS}} \[\puzzle{\puzzle \over\puzzle^{\puzzle^\puzzle}} \qquad \frac{\puzzle}{\puzzle^{\puzzle^\puzzle}} \]

D T T S SS T T S SS
Exercise 17.16: The \square command is built-in: . The \mathpalette command is introduced in Tralics 2.9.5, not tested yet.

\def\legendre{\overwithdelims()}\def\Legendre{\genfrac(){}{}} \def\euler{\atopwithdelims<>}\def\Euler{\genfrac<>{0pt}{}} \def\grimm{\abovewithdelims][4pt}\def\Grimm{\genfrac][{4pt}{}} \[{a\legendre b}, \Legendre{a}{b}, {n \euler k}, \Euler{n}{k}, {\dfrac ab \grimm \dfrac cd}\Grimm{x}{y} \]

RR n°6181

Exercise 17.17: Knuth says: the size of the surrounding delimiters depends only on the size, not on the size of the fractions, this is false for Tralics:

a b , a b , n k , n k ,       a b c d          x y   
If f is the value of \delimiterfactor and δ the value of \delimitershortfall, and we have a formula that extents y 1 units above the axis, and y 2 units below, if y = 2 max(y 1 , y 2 ), then the delimiter size is at least y • f /1000, and at least y -δ. This does not apply to Tralics.

The remainder of the chapter discusses some low-level commands that are not fully implemented in Tralics. The commands \textfont, \scriptfont and \scriptscriptfont take a small number as argument, and provide a reference to a font. The following code \font\tenrm=somefont at 12pt \font\Helvetica=someotherfont scaled 1013 \textfont0=\tenrm \scriptscriptfont2=\scriptfont3 \the\fontdimen3\scriptscriptfont15 $\textfont0=\tenrm 9\hbox{$9\textfont0=\Helvetica$}$% ${\textfont0=\Helvetica 9}$ % exercise 17.18 gives: 0.0pt999. The dimension should be zero, and the math formula contains three identical digits. Exercise 17.18 says that the fonts used by T E X in the last case is not Helvetica.

You cannot use more than 16 different math fonts in a formula. Assume that you need symbol A from font a; you can say that \textfont6 is your font a, and your symbol is character 137 in that font. What if you want symbol B from font b? you can use font number 7, but this is obviously not the solution. We explain here the amsmath strategy by telling what happens if you use \tt in a math formula. First of all, in a formula, this evaluates to \mathtt, and the real command is \@mathtt. This is a self-modifying command; after first use it is equivalent to \fam9 (this means that normal characters in text size use the \textfont9). The first use allocates the number 9, and defines the font, moreover the font information is remembered (the font \textfont9 will be defined for all subsequent math formulas). Note that the value of \textfont9 can be cmtt12, but this is recomputed if the current font size changes. For most other commands, the number is allocated when the font is declared, this means that a slot is allocated even when the font is never used.

Four slots are preallocated, with the names operators, letters, symbols and largesymbols. If you load packages amsmath, amscd, amssymb, and bm, four other slots are used, and there are only 8 slots remaining. In the case of this document, we test all 14 MathML fonts. How is this possible? In fact some characters are typeset outside math mode (sans-serif characters for instance) and in some cases poor-man-bold is used. Moreover, we had to remove some font families (these are commented out in the file raweb-uni.sty).

Exercise 17.19: Math code are not implemented in Tralics, \oplus is character U+2295 and \bullet is character U+2022. \mathcode'<="2203 \mathcode'*="313C \mathcode'a="8000 {\catcode'a=13 \gdef a{A}} $a<b*c$ %\mathchardef\@M=10000

INRIA

In T E X, the previous code is equivalent to A * b < c, in Tralics, it gives: a < b * c. The last line is commented out: the assignment is done at bootstrap. You should use \@M as the constant 10000, not as control-P in family 7 (binary operation).

Following code is unlikely to work \def\sum\{\mathchar"1350} \mathchardef\sum"1350 \def\n@space{\nulldelimiterspace\z@ \m@th} \newdimen\p@ \p@=1pt \def\bigl#{\mathopen{\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}} \delcode 'x="123456 \def\langle{\delimiter"426830A } \bigl\delimiter"426830A \def\sqrt{\radical"270370 } \def\idehat{\mathaccent"362 } 2.3. Fine points of Mathematics Typing, TB 18

Punctuation

Say: If x < 0, we have shown that

y = f (x).
Do not say: for x = a, b, or c, but: for x = a, b, c, or use a tie: or c.

Exercise 18.1: R(n, t) = O(t n/2 ), as t → 0 + . Adding braces improves the hTML version: R(n, t) = O(t n/2 ).

Non-italics letters in formulas

T E X has 32 predefined operators, some of them behave like sums according to the placement of limits.

arccos x + arcsin x + arctan x + arg x + cos x + cosh x + cot x + coth x + csc x + deg x det x + dim x + exp x +gcd x + hom x +inf x + ker x + lg x +lim x + liminf x limsup x + ln x + log x +max x + min x + Pr x + sec x + sin x + sinh x +sup x tan x + tanh x +injlim x + projlim x
The last two operators are defined by amsmath. Variants shown later. More formulas (there should be small space around these operators, that is invisibile on my browser).

sin 2θ = 2 sin θ cos θ O(n log n log log n) P r(X > x) = exp(-x/µ) max 1≤n≤m log 2 P n lim x→0 sin x x = 1

RR n°6181

Exercise 18.2:

p 1 (n) = lim m→∞ ∞ ν=0 1 -cos 2m (ν! n π/n)
Example of formulas using \rm: Var(X), x max -x min , LL(k) ⇒ LR(k), exp(x + constant), and x 3 + lower order terms.

Some formulas using \hbox for roman font: Var(X), LL(k) ⇒ LR(k), exp(x + constant), and x 3 + lower order terms.

The same formulas using \text for roman font: Var(X), LL(k) ⇒ LR(k), exp(x + constant), and x 3 + lower order terms.

\def\Varliminf{\mathop{\underline{\mathmo{lim}}}} \def\Varlimsup{\mathop{\overline{\mathmo{lim}}}} \[\lim_{n\to\infty}x_n\text{ exists}\iff \Varlimsup_{n\to\infty}x_n=\Varliminf_{n\to\infty}x_n.\]
Exercise 18.3:

lim n→∞ x n exists ⇔ limsup n→∞ x n = liminf n→∞ x n . lim n→∞ x n exists ⇔ lim n→∞ x n = lim n→∞ x n .
The code above is wrong, because 'lim' is a known operator, with movable limits, hence, in non-display mode, both the underline and the real subscript will move. The real definitions adds movablelimits = 'false' to the operator.

$\gcd(m,n)=\gcd(n,m\bmod n)$, or $x\equiv y+1\pmod{m^2}$ $x\equiv0(\pmod y^n)$.

Modulo: gcd(m, n) = gcd(n, m mod n), or x ≡ y + 1 (mod m 2 )
Exercise 18.4: x ≡ 0( (mod y) n ). This is strange.

Exercise 18.5: In this example, there are braces around n/p, but not k/p; this can affect the size of the slash operator (HTML version only).

n k ≡ n/p k/p n mod p k mod p (mod p) Example of bold face a + b = Φ m ; normal Phi is U+03A6, bold Phi is U+1D6BD, italic Phi is U+1D6F7, bold italic Phi is U+1D731, sans serif bold Phi is U+1D76B, sans serif bold italic Phi is U+1D7A5.
In the current version of Tralics, font changes apply only to ASCII letters. Commands like \cal are robust, so that $\cal Ab\Phi$ produces AΦ; command \mit is not implemented. Note that in some cases, digits and lower case letters do not exist in the font, and may be replaced by random glyphs.

Exercise 18.6: If you want x T Mx = 0 ⇔ x = 0 in Tralics 2.9.4, you have to explicitly say that you want a bold face zero, and an upright T, see below. In version 2.9.5, nothing special needed. Note how we use colon-equal here.

$\bf\bar x^{\mathmo{T}}Mx={\rm0}\iff x=\mathmn[mathvariant][bold]{0}$

Compare $This\ is\ math\ italics$ with {\it This is text italics}.

INRIA

Compare $different$ and $\it different$. We have also $\it last\mathmo{:=}first$, $\it x\_coord(point\_2)$ Compare T his is math italics with This is text italics. Compare dif f erent and different. We have also last := first, x _coord (point_2 ).

Exercise 18.8: We use \mathit instead of \it here.

available + n i=1 max(full (i), reserved (i)) = capacity
Exercise 18.9: The following code was obtaining by taking the answer from the T E Xbook, with the following modifications: the \sfcode of the semi colon not changed; math formulas put outside scope of \bf, because my browser shows letters (not digits) in bold face otherwise. Note that the XML to HTML processor converted the whole environment (seven paragraphs) into a single paragraph with <br> as separator (inter-paragraph width too big), and a huge left margin (for fun). We show here the start of the code:

\begin{xmlelement+}{pseudocode}\XMLaddatt{leftskip}{5cm} \obeylines \def\coleq{\mathmo{:=}} \textbf{for} $j\coleq 2$ \textbf{step} $1$ \textbf{until} $n$ \textbf{do} ... \end{xmlelement+} for j := 2 step 1 until n do begin accum := A[j]; k := j -1; A[0] := accum; while A[k] > accum do begin A[k + 1] := A[k]; k := k -1; end; A[k + 1] := accum; end.

Spacing between formulas

Compare

F n = F n-1 + F n-2 , n ≥ 2.
with (lot of white space in the formula)

F n = F n-1 + F n-2 , n ≥ 2.
and (no unnecessary white space in the formula)

F n = F n-1 + F n-2 , n ≥ 2.
Normally, the spacing should be the same in the last two formulas. In fact, Knuth says that \quad is the same as \hskip 1em\relax. The translation of a \quad in math mode is <mspace width="1.em">, but, the \hskip command reads a dimension, and converts one em into ten points 1 .

1 Maybe, one day, Tralics will have an em that depends on the context

RR n°6181

Exercise 18.10: Three versions:

Let H be a Hilbert space, C a closed bounded convex subset of H, T a non-expansive self map of C. Suppose that as n → ∞, a n,k → 0 for each k, and

γ n = ∞ k=0 (a n,k+1 -a n,k ) + → 0. Then for each x in C, A n x = ∞ k=0 a n,k T k x converges weakly to a fixed point of T .
Let H be a Hilbert space, C a closed bounded convex subset of H, T a non-expansive self map of C. Suppose that as n → ∞, a n,k → 0 for each k, and

γ n = ∞ k=0 (a n,k+1 -a n,k ) + → 0. Then for each x in C, A n x = ∞ k=0 a n,k T k x converges weakly to a fixed point of T .
Let C be a closed, bounded, convex subset of a Hilbert space H, and let T be a non-expansive self map of C. Suppose that as n → ∞, we have a n,k → 0 for each k, and

γ n = ∞ k=0 (a n,k+1 -a n,k ) + → 0. Then for each x in C, the infinite sum A n x = ∞ k=0 a n,k T k x
converges weakly to a fixed point of T . Comments: the translation of the three characters: space, backslash, space is formed of two spaces. Such a construct is used four times in the first version. This produces a nice dvi file, but HTML interprets the double space the same as a single space. In the second version, we have used a double tilde character. This inhibits line breaks. (My browser does not seem to honor this). No special characters appear in the last example.

Spacing within formulas

$a\,b\>c\;d\!e\quad f\qquad g\ h$~j %\the\thinmuskip\the\medmuskip\the\thickmuskip

The math spacing commands: a b c de f g h j.

In T E X, the value of the glue inserted depends on three registers: \thinmuskip (3mu), \medmuskip (4mu plus 2mu minus 4mu) and \thickmuskip (5mu plus 5mu). You can try to execute the line above that is commented out: all dimensions come out as 0mu in Tralics, but the math formula contains 0.166667em, 0.222222em, 0.277778em, etc, this is the same as 3mu, 4mu and 5mu, because 1em=18mu. In Tralics, \mskip 18mu is equivalent to \hskip1em, and, as said above, this is the same as \hskip10pt. The same is true for \mkern18mu; the translation is an empty <mspace> element, with attribute value = '10.0pt'. The amount of space given by backslash-space changed from 6pt to 4pt (this is the same amount of space used by the \text command). $\int_0^\infty f(x)\,dx$, $y\,dx-x\,dy$, $dx\,dy=r\,dr\,d\theta$, $x\,dy/dx$ Translation ∞ 0 f (x) dx, y dx -x dy, dx dy = r dr dθ, x dy/dx. Exercise 18.11:

x 1 dt t ∞ 0 t -ib t 2 + b 2 e iat dt = e ab E 1 (ab), a, b > 0 $55\,\mathrm{mi/hr}$, $g=9.8\,\mathrm{m/sec}^2$, $1\mathrm{ml}=1.000028\,\mathrm{cc}$
Units: 55 mi/hr, g = 9.8 m/sec 2 , 1ml = 1.000028 cc. Note that digits are outside the scope of \mathrm.

Exercise 18.12: Inline math, displaystyle: = 1.054 × 10 -27 erg sec.

$(2n)!/\bigl(n!\,(n+1)!\bigr)$, $\sqrt2\,x$, $\sqrt{\,\log x}$, $O\bigl(1/\sqrt n\,\bigr)$, $[\,0,1)$, $\log n\,(\log\log n)^2$, $x^2\!/2$, $n/\!\log n$, $\Gamma_{\!2}+\Delta^{\!2}$, $R_i{}^j{}_{\!kl}$, $\int_0^x\!\int_0^y dF(u,v)$ \[\frac{52!}{13!\,13!\,26!}\qquad \int\!\!\!\int_D dx\,dy\] INRIA Test: (2n)!/ (n! (n + 1)!), √ 2 x, √ log x, O (1/ √ n ), [ 0, 1), log n (log log n) 2 , x 2 /2, n/log n, Γ 2 + ∆ 2 , R i j kl , x 0 y 0 dF (u, v) 52! 13! 13! 26! D dx dy Same formulas, without thin spaces Test: (2n)!/ (n!(n + 1)!), √ 2x, √ log x, O (1/ √ n), [0, 1), log n(log log n) 2 , x 2 /2, n/ log n, Γ 2 + ∆ 2 , R i j kl , x 0 y 0 dF (u, v) 52! 13!13!26! D dx dy Exercise 18.14: intervals with left/right: ]-∞, T [ × ]-∞, T [; with mathopen, mathclose ] -∞, T [×] -∞, T [; with nothing ] -∞, T [×] -∞, T [. And with left/right: -∞, 3 4 × -∞, 3 4 ; with mathopen, mathclose ] -∞, 3 4 [×] -∞, 3 4 [; with nothing ] -∞, 3 4 [×] -∞, 3 4 [. Exercise 18
.15: The spacing in x + +1 differs between T E X and MathML.

Ellipses

$x_1+\cdots+x_n$, $x_1=\cdots=x_n=0$, $A_1\times\cdots\times A_n$, $f(x_1,\ldots,x_n)$, $x_1x_2\ldots x_n$, $(1-x)(1-x^2)\ldots(1-x^n)$, $n(n-1)\ldots(1)$.
Translation of these formulas

x 1 + • • • + x n , x 1 = • • • = x n = 0, A 1 × • • • × A n , f (x 1 , ..., x n ), x 1 x 2 ...x n , (1 -x)(1 -x 2 )...(1 -x n ), n(n -1)...(1).
Exercise 18.16:

Answer x 1 + x 1 x 2 + • • • + x 1 x 2 ...x n , (x 1 , ..., x n ) • (y 1 , ..., y n ) =x 1 y 1 + • • • + x n y n . Prove that (1 -x) -1 = 1 + x + x 2 + • • • . Clearly a i < b i , for i = 1, 2, ... , n.
The coefficients c 0 , c 1 , ..., c n are positive. With braces surrounding the LHS:

(1 -x) -1 = 1 + x + x 2 + • • • .
Exercise 18.17: Clearly a i < b i , for i = 1, 2, ..., n. Note that the '2' here is a math digit, while it is text digit in the sentence above.

Exercise 18.18: Knuth used \dots.

Line breaking

The T E X book explains how T E X can break a math formula. This does not apply to Tralics. Commands \nobreak and \allowbreak do nothing in math mode.

Braces

You should use braces only for grouping. You can use a brace character via \{ is text or math mode. This character is a delimiter (it can be preceded by \left or \big. $\{a,b,c\}$, $\{1,2,\ldots,n\}$, $\{\mathrm{red,white,blue}\}$ $\{\,x\mid x>5\,\}$, $\{\,x:x>5\,\}$, $\bigl\{\,\bigl(x,f(x)\bigr)\bigm|x\in D\,\big\}$ $\bigl\{\,\bigl(x,f(x)\bigr)\bigm\mid x \in D\,\big\}$ $\bigl\{\,\bigl(x,f(x)\bigr)\mid x\in D\,\big\}$ Translation {a, b, c}, {1, 2, ..., n}, {red, white, blue},

{ x | x > 5 }, { x : x > 5 }, { (x, f (x)) |x ∈ D } { (x, f (x)) |x ∈ D }. Note that \mid gives better spacing than a single bar { (x, f (x)) | x ∈ D }, { (x, f (x)) | x ∈ D }.
Exercise 18.21:

x 3 | h(x) ∈ {-1, 0, +1}
Exercise 18.22: { p | p and p + 2 are prime }.

RR n°6181

We show here the use of the cases enviroment, this is a two-column cmatrix, with a left brace delimiter on the left.

|x| = x, if x ≥ 0; -x, otherwise. f (x) =      1/3 if 0 ≤ x ≤ 1; 2/3 if 3 ≤ x ≤ 4; 1/3 elsewhere;
Exercise 18.23: The \cases command is not implemented, but there is a environment. You cannot use \noalign. After a double backslash you can put a dimension in brackets, but this is currently ignored.

\[\overbrace{x+\cdots+x}^{k\; \textrm{times}} \qquad \underbrace{x+y+z}_{>\,0}\]

We show here braces can stretch horizontally, when used as over-accent or under-accent.

k times x + • • • + x x + y + z > 0

Matrices

The plain T E X command \matrix should not be used. The 'array' environment can be used in math mode, and you must specify for each column the alignment method. The 'matrix' environment can be used, cells are centered. He we use 'pmatrix', because it adds automatically parentheses.

\[A=\begin{pmatrix}x-\lambda&1&0\\0&x-\lambda&1\\0&0&x-\lambda\end{pmatrix}\] \[\begin{pmatrix}a&b&c\\d&e&f\end{pmatrix} \begin{pmatrix}u&x\\v&y\\w&z\end{pmatrix}\] A =    x -λ 1 0 0 x -λ 1 0 0 x -λ    a b c d e f    u x v y w z   
Exercise 18.24: This looks bad in the HTML version, but it OK is Pdf. Delimiters are \lgroup and \rgroup.

     a b c d e f               u x v y w z          INRIA Exercise 18.25: A =      

RR n°6181

José Grimm

Exercise 18.32:

Φ ⊂ N L * 1 /N = L * 1 ⊆ • • • ⊆ N L * n /N = L * n .
Exercise 18.33: I(λ) = D g(x, y)e iλh(x,y) dx dy.

Exercise 18.34:

1 0 • • • 1 0 f (x 1 , ..., x n ) dx 1 .
.. dx n . Note: my browser shows small integral signs, and larger ones in the previous exercise.

Exercise 18.35: Using cases environment

x 2m ≡ Q(X 2 m -P 2 W 2 m ) -2S 2 (m odd) P 2 2 (X 2 m -P 2 W 2 m ) -2S 2 (m even) (mod N ).
Exercise 18.36: with a \frac

(1+x 1 z + x 2 1 z + • • • )...(1 + x n z + x 2 n z 2 + • • • ) = 1 (1 -x 1 z)...(1 -x n z) Exercise 18.37: j≥0   k≥0 a jk z k   = n≥0 z n     k0,k1,...≥0 k0+k1+•••=n a 0k0 a 1k1 ...     .
Exercise 18.38: Using \frac and \binom

(n 1 + n 2 + • • • + n m )! n 1 ! n 2 !...n m ! = n 1 + n 2 n 2 n 1 + n 2 + n 3 n 3 ... n 1 + n 2 + • • • + n m n m .
Exercise 18.39: Using \genfrac

Π R a 1 , a 2 , ..., a M b 1 , b 2 , ..., b M = R n=0 (1 -q a1+n )(1 -q a2+n )...(1 -q a M +n ) (1 -q b1+n )(1 -q b2+n )...(1 -q b N +n ) .
Exercise 18.40:

p prime f (p) = t>1 f (t) dπ(t).

INRIA

Exercise 18.41: In this formula, we want the denote the plural of the token a by as apostrophe followed by the letter s. The first attempt is not good. The second is a bit better, because it is a-prime followed by s. The first expression is formed of open brace, underbraced formula, closing brace; and this produces large braces in the HTML version; small braces are obtaing by replacing the first token by a list, containing the brace and little bit space. Exercise 18.42:

      a b c d e f g h 0 i j k k       .
A non trivial question: what is the distance X between two lines in a matrix like these? or said otherwise, what is the vertical glue Y added between two lines? Let x be the value of \baselineskip, y the value of \lineskiplimit and z the value of \lineskip. Then, the quantity y is computed so that X = x, unless this gives Y < y, case where z is used instead. Typically, for a normal paragraph, x = 12, y = 0, z = 1, and for a 'align' environment, we have x = 15, y = 3, z = 4. In the case of an array, all three values are zero. This means: normal baseline in a paragraph is 12pt, but there is at least one pt between two lines, and in the case of multiline equations, the baseline is larger, as well as the clearance. In the case of an array, no extra space is added. However, a strut is added to each line, this is an invisible rule; as a consequence, the total height plus depth of each line is the matrix is at least 12pt, hence X is at least 12pt. This has as consequence that, in the big matrix above, parentheses do touch. We changed, in the file raweb-cfg.sty, the code of the \@array command: z = 5, and y is 3 or 5, depending on whether the 'displaystyle' attribute array of the array is true (if the attribute is true, then all entries are typeset in \display mode; this is the case for all environments like 'gather' or 'align' that are translated by Tralics as an array).

Exercise 18.43: Note: entries are left aligned because of explicit \hfil.

det c 0 c 1 c 2 ... c n c 1 c 2 c 3 ... c n+1 c 2 c 3 c 4 ... c n+2 . . . . . . . . . . . . c n c n+1 c n+2 ... c 2n
Exercise 18.44:

x∈A f (x) def = x∈A x =0 f (x).

RR n°6181

José Grimm

Exercise 18.45: This is not so nice

2 ↑↑ k def = 2 2 2 • • • 2 k
Exercise 18.46: Vertical arrow centered via the use of phantom on the left; command \hidewidth not used (the purpose of the command is to make \halign believe that the cell has a very small width; this will produce an overfull box, but who cares: there is enough white space at both ends).

0 ↓ 0 → O k ι → E ρ → L → 0 ↓ φ ↓ ψ 0 → O C → π * O D δ → R 1 f * O V (-D) → 0 ↓ θi⊗γ -1 R 1 f * (O V (-iM )) ⊗ γ -1 ↓ 0 2.4. Displayed Equations, TB19
X n = X k if and only if Y n = Y k and Z n = Z k .
Compare the following two examples: the translation is the same, but you cannot put arbitrary text in a math formula! $$Y_n=X_n\bmod p \quad\hbox{and}\quad Z_n=X_n\bmod q \qquad\hbox{for all }n\ge 0.$$ $$Y_n=X_n\bmod p \quad\hbox{and}\quad Z_n=X_n\bmod q\qquad\hbox{for all $n\ge0$}.$$ Y n = X n mod p and Z n = X n mod q for all n ≥ 0.

Y n = X n mod p and Z n = X n mod q for all n ≥ 0.

Exercise 19.1: The exercise contain for foumulas; for the first three ones, we give a L A T E X variant. In the first case, if \Big commands are omitted, the last parenthesis is larger than the first one in th HTML version; an additional pair of braces has been added.

$$\sum_{n=0}^\infty a_nz^n\qquad \hbox{converges if}\qquad |z| < \Bigl(\limsup_{n\to\infty}\root n\!\of{|a_n|}\,\Bigr)^{-1}.$$ INRIA \[\sum_{n=0}^\infty a_nz^n\qquad \text{converges if} \qquad |z| < (\limsup_{n\to\infty}\sqrt[n\!]{|a_n|}{\,)}^{-1}. \] ∞ n=0 a n z n converges if |z| < limsup n→∞ n |a n | -1 . ∞ n=0 a n z n converges if |z| < (limsup n→∞ n |a n | ) -1 .
Next two formulas.

$${f(x+\Delta x)-f(x)\over\Delta x}\to f'(x)\qquad \hbox{as $\Delta\to0$.}$$ \[\frac{f(x+\Delta x)-f(x)}{\Delta x}\to f'(x)\qquad \text{as }\Delta\to0.\] $$\|u_i\|=1,\qquad u_i\cdot u_j=0\quad\hbox{if $i\ne j$.}$$ \[\|u_i\|=1,\qquad u_i\cdot u_j=0\quad\text{if } i\ne j.\] f (x + ∆x) -f (x) ∆x → f (x) as ∆ → 0. f (x + ∆x) -f (x) ∆x → f (x)
as ∆ → 0.

u i = 1, u i • u j = 0 if i = j. u i = 1, u i • u j = 0 if i = j.
Last formula; you cannot use the \matrix command defined by plain T E X, but you have to use the matrix environment.

\[\it\text{The confluent image of}\quad \begin{Bmatrix}\text{an arc}\hfill\\\text{a circle}\hfill\\\text{a fan}\hfill \end{Bmatrix} \quad\text{is}\quad \begin{Bmatrix}\text{an arc}\hfill\\\text{an arc or a circle}\hfill\\ \text{a fan or an arc}\hfill\end{Bmatrix}.\]

The confluent image of

     an arc a circle a fan      is     
an arc an arc or a circle a fan or an arc

     .
Since version 2.9.5, you can use font changes in \text commands and friends (the previous formula is in italics). This is a more elaborate example x vs y = 1 2 x vs 1 2 x

RR n°6181

José Grimm

Exercise 19.3: We demonstrate in this example that using $$\hbox{$formula$}$$ is non-trivial.

\everymath={A} \everyhbox={B} \def\X{\ifhmode H\else \ifvmode V \else \ifmmode M \else U\fi\fi\fi} \def\Y{\X\ensuremath{\beta}} $$ \Y\hbox{\X$\Y $\X}\Y \text{\X}$$

M βBHAM βHM βH

Guess what happens if \X were replaced by \Y? the problem might be solved in a future version. Note that \text does not insert the every-hbox token list.

Exercise 19.4: Look at these four identical formulas.

1 - 1 2 + 1 3 - 1 4 + • • • = ln 2 1 - 1 2 + 1 3 - 1 4 + • • • = ln 2 (14) 1 - 1 2 + 1 3 - 1 4 + • • • = ln 2 (14) 1 - 1 2 + 1 3 - 1 4 + • • • = ln 2
In T E X, equations are centered, and an equation number is added to the left or the right. In the HTML version, an equation-with-number is a 3-column table, columns 1 and 3 are of width 4em (this is defined in the CSS file), one of them contains the equation number. If the equation number is big, the width of the column might be larger than 4em, columns 1 and 3 could have different widths, so that column 2 is not centered. Otherwise it is centered, and the equation is centered in column 2 (is there a way to do this better?)

Normally, there should be a way to put the equation at some position (say 3cm from the left margin). This is done in L A T E X via a package option (can we easily modify L A T E X so that each equation can be centered or not?). In this examples, first two formulas should be centered, other ones should flushed left. Equations two and three have a number.

Note on Equation Numbering

For a very long time, I have used the \eqno command without any difficulty; of course, you have to be very careful if you introduce an equation between equations (11) and ( 12), you have to change every reference for any equation starting with 12. A big advantage of L A T E X is its automatic numbering scheme; more precisely if you flag an equation with \label{eq+12}, you can get its number via \ref{eq+12} (the only difficulty then is to find mnemonic tag names). In a first pass, L A T E X computes the value of the label, and stores it in a file, in a second pass, it reads the file, and uses this number. No number is computed by Tralics, in some cases, this can be annoying. A side effect of the translation of the \label command is the addition of an id (for instance 'id12' to the equation), and translation of the \ref is a <ref> element with a reference to the id.

Equation numbers are computed by the XML-to-whathever processor. In fact, in the case of conversion from XML to HTML, the style sheet computes the equation number twice: once when the equation is converted, and once when the <ref> is converted. In the case of XML to XSL/FO, a number is computed only for <ref>, the equation number is added to the equation by L A T E X, when the XSL/FO is converted to Pdf (this is not really important, because nobody looks at the FO file).

INRIA

Assume that you have hundreds of equations, and you want to refer the previous one; very often it is tagged '(*)', in some cases '(**)'. Some people use '(***)'. Exercise 19.7 that follows says that, in math mode, these come out as ( * ), in some cases ( * * ) and ( * * * ). In particular, a non-trivial question is: should equation numbers by typeset as math or as text? In Tralics, we implemented \eqno and \tag; that's a bit tricky, let's explain some difficulties.

• The MathML recommendation says: automatic equation numbering and automatically resolving references to equations is outside the scope of MathML, but can be done by use of style sheets or other means. "The <mlabeledtr> construction provides support for both of these functions in a way that is intended to facilitate XSLT processing". The idea is to construct an array, the first column contains equation numbers, with an attribute that says if the tag should be on the left or the right. This allows more than one tag per formula (there can be more than one row). The problem is that my browser ignores the whole line. This is bad news. • If a tag is part of a math formula, it can consist in any math construct. In our implementation, it may be an attribute so that only characters are allowed. You cannot use α or β as tag. In L A T E X, tags are typeset in text mode, and math shift characters are sometimes used. These are removed by Tralics.

• A tag can appear anywhere in a formula, and more than one tag can be used. Thus Tralics reads all tags and merges them (it complains if more than one label appears in a formula).

• The final tag, after merge, removal of special characters, etc., is passed to a command; you can redefine it. In general it will either typeset the tag, or convert it to an attribute.

Summary: There are three ways to obtain an equation number. First, if an equation has a label, an equation number will be assigned to it automatically, when converting from XML to HTML, or whatever. The second method consists in using the amsmath command \tag, described below. Finally, you can use the T E X command \eqno. This command reads everything up to the end of the formula, expanding tokens when needed; if this yields foo, then \y@tag{foo} is evaluated again; this the same as if you said \tag*{foo}. Its effect by default is to convert the tag as an attribute to the formula. Moreover, the attribute eqnpos is added to the formula, with a value of left and right, depending on whether \leqno or \eqno has been used.

x 2 -y 2 = (x + y)(x -y). (15R) (15L) x 2 -y 2 = (x + y)(x -y).
Equation number of (7) is on the left, of (8) on the right, and (9) depends on the class option.

(7)

x 2 -y 2 = (x + y)(x -y).

RR n°6181

José Grimm

x 2 -y 2 = (x + y)(x -y).

(8)

x 2 -y 2 = (x + y)(x -y). (9)
Exercise 19.5:

k≥0 1 1 -q k z = n≥0 z n / 1≤k≤n (1-q k ). ( 16´
)
Exercise 19.6: In T E X, you can put an en-dash in an equation number by using \hbox. This is not allowed in Tralics: the equation 1 = 1 below gives an error. On the other hand, any character can be put in an equation number; the case of an apostrophe is a bit special: it is not converted to an exponent, but replaced by \apostrophe.

The example below illustrates one complexity. The end of the tag (via \eqno) is the end of the formula. In order to get the end of the formula, all tokens have to be expanded. The question is what to do with \char: remember that this command reads and typesets a character. In this case it cannot typeset a character; assume that we delay its interpretation. In this case, the command that follows the backquote will be expanded (this is wrong: we do not want to put an acute accent somewhere). Hence, the \char command reads a character, and pushes back a character token, with the same value, but category code 12. We explained above that \mathchar is not implemented. This means that there is one and only one active math character: the apostrophe, it produces a prime exponent even when it has category code 12. This is not desired: a tag should consist in characters only. This explains why something special is done. You can define the \apostrophe command as you like (the default value is character U+B4, but you can use an apostrophe, case where an exponent will be created when the token list is read again; formula 2 = 2 gives a double superscript error, guess why). Note how we insert an en-dash (of course \textendash is a non-math command, we had to modify some files in order to allow this character in the Pdf). Exercise 19.8: Knuth says: if \hsize is less than 10000pt, then the natural width of the equation will be too large. Tralics ignores the shrink part of the glue. In the case of the HTML document, the text will flush in the right margin (and the equation number will be far away). We have replaced 10000 by 600, this should be big enough to see something.

INRIA \[\quad x=y\hskip10000pt minus 1fill\eqno(5)\]

x = y (5)

Multi-line displays

Exercise 19.9: The \eqalign feature of plain T E X is not implemented; you can use the align environment like here:

T (n) ≤ T (2 lg n ) ≤ c(3 lg n ) -c(2 lg n ) < 3c • 3 lg n = 3c n lg 3 .
Using aligned, you can get

     α = f (z) β = f (z 2 ) γ = f (z 3 )      x = α 2 -β y = 2γ
Exercise 19.10:

P (x) = a 0 + a 1 x + a 2 x 2 + • • • + a n x n , P (-x) = a 0 -a 1 x + a 2 x 2 + • • • + (-1) n a n x n . (10)
Currently, the following code does not work. The best we can do is using phantoms:

\def\xcenter#1#2#3{\phantom{#3}{#1#2#3}\phantom{#1}} \[\xcenter{(x+y)(x-y)}{=}{x^2-xy+yx-y^2} \] \[\xcenter{{}}{=}{x^2-y^2;}\label{192-0}\] RR n°6181 \[\xcenter{{(x+y)^2}}{=}{x^2+2xy+y^2 .}\label{192-5}\] (x + y)(x -y) = x 2 -xy + yx -y 2 = x 2 -y 2 ; (11)
(x + y) 2 = x 2 + 2xy + y 2 . ( 12
)
Exercise 19.12: First two equations use \leqno, Equations ( 13) and ( 14) have a label.

(9) gcd(u, v) = gcd(v, u);

(10) gcd(u, v) = gcd(-u, v). gcd(u, v) = gcd(v, u); (13) gcd(u, v) = gcd(-u, v). (14)
Exercise 19.13: Note: Knuth has a small space before the first dx, this seems unnecessary. Some operators are big by default in MathML, so that no \big is required. However, there is a rule in Tralics that says that small parentheses are used in f (x)dx, even when the integral has limits. In this cases, this mechanism produces small parentheses. The remedy is to put f(x) in a group; the size of the parentheses depend only on what is in the group. In a case like (x 2 + y 2 ), large parentheses are used. If you want small ones, you must use the \smash command, and you get (x 2 + y 2 ). In the pdf version, the vertical bar is too small.

\[\xcenter{\left(\int_{-\infty}^{\infty}e^{-x^2}dx\right)^2}{=} {\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(\smash{x^2+y^2})}dx\,dy}\] \[\xcenter{}{=}{\int_0^{2\pi}\int_0^\infty e^{-r^2}r\,dr\,d\theta}\] \[\xcenter{}{=}{\int_0^{2\pi}{\left(-\frac{e^{-r^2}}{2}| _{r=0}^{r=\infty}\right)}\,d\theta}\] \[\xcenter{}{=}{\pi.}\label{e19.13}\] ∞ -∞ e -x 2 dx 2 = ∞ -∞ ∞ -∞ e -(x 2 +y 2 ) dx dy = 2π 0 ∞ 0 e -r 2 r dr dθ = 2π 0 - e -r 2 2 | r=∞ r=0 dθ = π. (15)

INRIA

Exercise 19.14: Knuth explains that eqalign and eqalignno environments are based on \halign, so that \noalign can be used. In environments like gather, you can try \multicolumn. As you can see here, the word 'and' occurs at the left of the table, not at the left margin; this is the same as what happens with \eqalign.

x = y + z and

x 2 = y 2 z 2
Exercise 19.16: This uses \gather. There are no equation numbers, because \hfil, \hfill or \hfilneg are not allowed.

x ≡ x if x ≡ y then y ≡ x if x ≡ y and y ≡ z then x ≡ z.

Long formulas

The long formula is

σ(2 34 -1, 2 35 , 1) = -3 + (2 34 -1)/2 35 + 2 35 /(2 34 -1) + 7/2 35 (2 34 -1) -σ(2 35 , 2 34 -1, 1).
It can be split as

σ(2 34 -1, 2 35 , 1) = -3 + (2 34 -1)/2 35 + 2 35 /(2 34 -1) + 7/2 35 (2 34 -1) -σ(2 35 , 2 34 -1, 1).
Exercise 19.17:

x n u 1 + • • • + x n+t-1 u t = x n u 1 +(ax n +c)u 2 + • • • + (a t-1 x n +c(a t-2 + • • • + 1))u t = (u 1 + au 2 + • • • + a t-1 u t )x n +h(u 1 , ..., u t ). ( 16
)
Attempt to use multline for the long formula.

σ(2 34 -1, 2 35 , 1) = -3 + (2 34 -1)/2 35 + 2 35 /(2 34 -1) + 7/2 35 (2 34 -1) -σ(2 35 , 2 34 -1, 1).
Exercise 19.18:

1≤j≤n 1 (x j -x 1 )...(x j -x j-1 )(x -x j )(x j -x j+1 )...(x j -x n ) = 1 (x -x 1 )...(x -x n ) . ( 17
)
Exercise 19.19: This is a silly expression. It is formed of A and B over C. We show here the code of A, B and, using the shorthands of Knuth. We redefine locally the \\ command. The \Paren command puts parentheses around the argument., the \Slash command produces a slash.

RR n°6181

{ \def\\#1;{\noexpand\Paren{#1;q^2}_\infty} \xdef\formA{q^{\frac 12 n(n+1)}\\ea;\\eq\noexpand\Slash a;} \xdef\formB{\\caq\noexpand\Slash e;\\cq^2\!\noexpand\Slash ae;} \xdef\formC{(e;q)_\infty(cq/e;q)_\infty} }

The question is: What is the size of the parentheses? In the case of f (x)dx some browsers show parentheses whose size are the same as that of the current group; if nothing special is done, it includes the integral sign and the bounds, this is wrong. For this reason, Tralics inserts some braces for opening and closing delimiters. If a group is created for the parenthesis, it contains no big objects (e.g., something with exponents). If possible, opening and closing parentheses are part of the same group. The algorithm is not obvious: consider what should be done if x or f (x) is replaced by its square. The following exercise is interesting. Note: in the Pdf version, all formulas look the same, this is because parentheses have fixed size. See also discussion after exercise 16.2: there are no multiple scripts here.

We give here four variants. In case one, there is no group, and the size of the parentheses is given by the exponent of the q. Hence they are too big. Tralics tries to compensate, but this does not work well, because of the index attached to parenthesis; there are two parts (ea; and q 2 ) ∞ . In the second case, we have added an empty group. In this case, we have a group with (ea; followed by q 2 followed by a group with ) followed by ∞ . This gives small parentheses. Variant three is logically better: we put the parentheses in a group, so that its size depends only on the content of the group; in this case Tralics leaves the formula unchanged. If you feel that the parentheses are too big, you can reduce them: variant four uses \smash.

A non trivial point is that the size of the slash character is also variable. In the case where a group is used (variant 3 and 4), it size depends on the q 2 that follows. Otherwise, when Tralics tries to insert a group, in order to reduce the size of the parentheses, it uses a complicated algorithm: when a group is created for the parentheses, it does not include big objects. In particular, since each semi-colon is followed by q 2 , this group cannot contain both parentheses. Expressions can be split after binary operators or relations, in the case of a/b = c, only the equals sign is considered. Understanding exactly where the expression is split is not easy. Obviously, in the case when there are two q 2 in the expression, none of them is in a group. Since the slash character is between these two expressions, it is outside of the group, its size is affected by the exponent of the first q. This gives a very big slash (in the case of the Pdf version, only small characters are used).

\def\Paren#1{(#1)} \def\Paren#1{(#1){}} \def\Paren#1{{(#1)}} \def\Paren#1{{(\smash{#1})}} \def\Slash{/} \[ \frac{\formA\formB}{\formC} \] \[ \frac{\textstyle\formA\qquad \atop\hfill\textstyle\formB}{\formC} \]

The whole formula version 1 q 1 2 n(n+1) (ea;q 2 ) ∞ (eq/a;q 2 ) ∞ (caq/e;q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ Version two q 1 2 n(n+1) (ea;q 2 ) ∞ (eq/a;q 2 ) ∞ (caq/e;q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ INRIA Version 3 q 1 2 n(n+1) (ea; q 2 ) ∞ (eq/a; q 2 ) ∞ (caq/e; q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ Version 4 q 1 2 n(n+1) (ea; q 2 ) ∞ (eq/a; q 2 ) ∞ (caq/e; q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ The split formula q 1 2 n(n+1) (ea; q 2 ) ∞ (eq/a; q 2 ) ∞ (caq/e; q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ One trick in order to get a smaller slash: define \Slash to be a group consisting of a slash (and something else, here a \kern of width minus 1pt). The whole formula version two q 1 2 n(n+1) (ea;q 2 ) ∞ (eq/a;q 2 ) ∞ (caq/e;q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ Version 4 q 1 2 n(n+1) (ea; q 2 ) ∞ (eq/a; q 2 ) ∞ (caq/e; q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞ The split formula, version 4 q 1 2 n(n+1) (ea; q 2 ) ∞ (eq/a; q 2 ) ∞ (caq/e; q 2 ) ∞ (cq 2 /ae; q 2 ) ∞ (e; q) ∞ (cq/e; q) ∞

Higher Mathematics, TLC2

In this chapter we present examples from the L A T E X companion, second edition, chapter 8; the book is distributed with a CDrom containing all examples. These examples are formed of two parts; black and blue, the blue part contains material to be inserted before the \begin{document}; whenever needed, we shall explain what these commands are assumed to do, what they do, and how the feature might be implemented. Unless stated otherwise, the black part is taken verbatim.

RR n°6181

Introduction to amslatex

The following packages are defined for use with Tralics:

• amsmath is the main package, it loads amstext, amsbsy, amsopn; Options are sumlimits, nosumlimits, namelimits, nonamelimits, centertags, tbtags, cmex10, and fleqn.

• amsgen contains some useful commands (currently unused).

• amstext defines the \text command, which is built-in in Tralics.

• amsbsy loads amsgen. It provides \boldsymbol and \bm, which do nothing in Tralics.

• amsopn, no options. The package defines commands like \lim, that are built-in in Tralics.

• amscd, implementes commutative diagrams .

• amsthm, not yet implemented (theorems are built-in in Tralics).

• amsxtra, not yet implemented.

• upref, not yet implemented.

• amsfonts, not yet implemented; this package and the following recognize options psamsfonts.

• amssymb. The package defines 204 symbols, all of them implemented in the Tralics kernel, except the following one, that are declared undefined by the amsmath package: \vartriangle, \doublebarwedge, \varpropto, \smallsmile, \smallfrown, \lvertneqq \gvertneqq, \npreceq, \nsucceq, \varsubsetneq(q) \varsupsetneq(q), \nsubseteqq, \nsupseteqq, \(n)shortmid, \(n)shortparallel. • eufrak. The package defines family \Eufrak (this command is \mathfrak in Tralics), this is assumed to use the font family 'euf'. The eufrak package is redundant if the amsfonts package is used.

• eucal. The package defines family \Euscript (this command is \mathcal in Tralics), this is assumed to use the font family 'eus'. Accepts options 'mathcal' and 'mathscr' (this make \mathscr equivalent to \mathcal.

All undefined math symbols are defined to be \ams@unimp, a command that expands to an undefined command, the one defined here to produce a red X.

\def\UnimplementedOperator{\mathbox{mstyle}[color][red]{X}}

Display and alignment structures for equations

Source code for some formulas used below: In Tralics, if a formula has no \label, no number is associated to it. Here we have a formula using the equation environment, or a displaymath formula enclosed in a \[, \] pair.

(a + b) 2 = a 2 + 2ab + b 2 sin 2 η + cos 2 η = 1
Example 8-2-2. This uses options 'reqno' option of the amsmath package (equations to the right), it puts equation-number = 'left' on the document element. It uses also 'fleqn', that sets flushedequation = 'true'; in L A T E X, you must define \mathindent, here to 1pc, as the distance between the left margin and the formula; ignored by Tralics. Same formulas as above, with a label added, in order to show the difference.

(a + b) 2 = a 2 + 2ab + b 2 (18) sin 2 η + cos 2 η = 1
Example 8-2-3. The code was modified in order to add labels; you see three 3 numbers; one per environment, equation, align, and eqnarray. Also text added between the groups of equations. First environment is equation:

x 2 + y 2 = z 2 (19)
Second environment is align:

x 2 + y 2 = z 2 x 3 + y 3 < z 3 ( 20
)
Third environment is eqnarray:

x 2 + y 2 = z 2 x 3 + y 3 < z 3 (21)
Note: amsmath adds a new complexity to how spaces are handled: spaces after \\ are no more ignored. This mechanism is not implemented in Tralics.

Example 8-2-4. We modified the examples by adding a label; you can see that this produces an equation number for equation*, (22) as well as equation, (23).

n 2 + m 2 = k 2 (22) n p + m p = k p p > 2 (
From now on, we redefine the \tag command via \tagasattribute; the second equation with a tag gives:

sin 2 η + cos 2 η = 1 (3)
The magic is that this uses \formulaattribute, a command added in Tralics 2.9.5 that adds an attribute pair to the formula; our style sheet handles a formula with a tag in the same way as a formula with an id (after converting the id into a tag). There are four commands of the form \XXattribute that add an attribute to an element under construction: the math formula, the math expression, the current row, the current cell. In these cases \mathattribute cannot be used (it adds an attribute to the last element created). It is not possible to use \XMLaddatt in math mode, and it is not possible to use this command after a math formula in order to add an attribute (If the token that follows a display math formula is not a \par, then \noindent is inserted, thus, if this token is \XMLaddatt, the current element is an empty paragraph). Example

(a + b) 4 = (a + b) 2 (a + b) 2 = (a 2 + 2ab + b 2 )(a 2 + 2ab + b 2 ) = a 4 + 4a 3 b + 6a 2 b 2 + 4ab 3 + b 4
Example 8.2.8. The L A T E X companion explains that the amsmath package can be loaded with options 'centertags' or 'tbtags'. In the first case, tags centered with the formula (left or right), in the second case, tags are on the first line (on the left) or last line (on the right). By default, Tralics does nothing, and in the case of 'tbtags', it sets split-tags = 'tb' on the root element.

(a + b) 3 = (a + b)(a + b) 2 = (a + b)(a 2 + 2ab + b 2 ) = a 3 + 3a 2 b + 3ab 2 + b 3 \newcommand\relphantom[1]{\mathrel{\phantom{#1}}}
f h,ε (x, y) = εE x,y tε 0 L x,yϕ(εu) ϕ(x) du = h L x,z ϕ(x)ρ x (dz) + h[ 1 t ε E y tε 0 L x,y x (s) ϕ(x) ds -t ε L x,z ϕ(x)ρ x (dz) + 1 t ε E y tε 0 L x,y x (s) ϕ(x) ds -E x,y tε 0 L x,yϕ(εs) ϕ(x) ds ] (24
(a + b) 3 = (a + b)(a + b) 2 = (a + b)(a 2 + 2ab + b 2 ) = a 3 + 3a 2 b + 3ab 2 + b 3 and x 2 + y 2 = 1 x = 1 -y 2 \begin{align} \text{Compare } x^2 + y^2 &= 1 & x^3 + y^3 &= 1 \\ x &= \sqrt {1-y^2} & x &= \sqrt[3]{1-y^3} \end{align} \begin{align} x&= y & X &= Y &a &= b+c \\ x' &= y'& X' &= Y' &a' &= b\\ x + x' &= y + y' & X + X' &= Y + Y' & a'b &= c'b \end{align}
Example 8-2-13. This example has two column-pairs. Compare x 2 + y 2 = 1

x 3 + y 3 = 1 x = 1 -y 2 x = 3 1 -y 3
This example has three column-pairs.

x = y X = Y a = b + c x = y X = Y a = b x + x = y + y X + X = Y + Y a b = c b \begin{flalign} \text{Compare } x^2 + y^2 &= 1 & x^3 + y^3 &= 1 \\ x &= \sqrt {1-y^2} & x &= \sqrt[3]{1-y^3} \end{flalign} \begin{flalign} x &= y & X &= Y & a &= b+c \\ x' &= y' & X' &= Y' & a' &= b \\ x + x' &= y + y' & X + X' &= Y + Y' & a'b &= c'b \end{flalign}
Example 8-2-14 This example has two column-pairs. Compare x 2 + y 2 = 1

x 3 + y 3 = 1 x = 1 -y 2 x = 3 1 -y 3

RR n°6181

This example has three column-pairs.

x = y X = Y a = b + c x = y X = Y a = b x + x = y + y X + X = Y + Y a b = c b \renewcommand\minalignsep{0pt} \begin{align} \text{Compare } x^2 + y^2 &= 1 & x^3 + y^3 &= 1 \\ x &= \sqrt {1-y^2} & x &= \sqrt[3]{1-y^3} \end{align} \renewcommand\minalignsep{15pt} \begin{flalign} x &= y & X &= Y & a &= b+c \\ x' &= y' & X' &= Y' & a' &= b \\ x + x' &= y + y' & X + X' &= Y + Y' & a'b &= c'b \end{flalign}
Example 8-2-15 This example has two column-pairs. Compare x 2 + y 2 = 1

x 3 + y 3 = 1 x = 1 -y 2 x = 3 1 -y 3
This example has three column-pairs. Example 8-2-17

x = y X = Y a = b + c x = y X = Y a = b x + x = y + y X + X = Y + Y a b =
x 2 + y 2 = 1 x = 1 -y 2
and also y 2), [START_REF]Introduction to amslatex 3.2. Display and alignment structures for equations 3.3. Matrix-like environments 3.4[END_REF]. Since (1') is obtained by a reference to the first equation, the whole set of equations is numbered, namely (25). It is currently impossible to use a reference, we locally change \ref, so that it produces a number, here 17. This is also the current value of the equation counter. Hence, the full tag, concatenation of all four tags is *,*,17x,ALSO (17); we have replaced the apostrophe by x, because of a bug in current Tralics. This full tag is put on the math formula.

= 1 -x 2 (a + b) 2 = a 2 + 2ab + b 2 (a + b) • (a -b) = a 2 -b 2 \begin{equation} \begin{aligned}[b] x^2 + y^2 &= 1\\ x &= \sqrt{1-y^2} \\ \text{and also }y &= \sqrt{1-x^2} \end{aligned} \qquad \begin{gathered}[t] (a + b)^2 = a^2 + 2ab + b^2 \\ (a + b) \cdot (a -b) = a^2 -b^2 \end{gathered}\end{equation} Example 8-2-18 4 x 2 + y 2 = 1 x = 1 -y 2 and also y = 1 -x 2 (a + b) 2 = a 2 + 2ab + b 2 (a + b) • (a -b) = a 2 -b 2
V j = v j X i = x i -q i x j = u j + i =j q i V i = v i -q i v j X j = x j U i = u i
Note: the style sheet that converts XML to HTML attributes a number to each equation that has a label, and \ref uses this number. If the equation has a tag, no number should be attributed, and \ref should use the tag. This might change.

INRIA

Note: L A T E X uses \text to format the tag, and as a consequence, spaces are not ignored. In Tralics, nothing special is done, and they are ignored. Should be fixed some day.

x 2 + y 2 = z 2 x 3 + y 3 = z 3 x 4 + y 4 = r 4 x 5 + y 5 = r 5 x 6 + y 6 = r 6 A 1 = N 0 (λ;Ω ) -φ(λ;Ω ) A 2 = φ(λ; Ω ) φ(λ; Ω) A 3 = N(λ; ω) (25)
Same example, with default behavior of \tag. Note that the equation number is still the same. The equation has an another label, it is now equation ( 26), but \ref is still defined to be 17.

x 2 + y 2 = z 2 x 3 + y 3 = z 3 x 4 + y 4 = r 4 ( * )
x 5 + y 5 = r 5 *

x 6 + y 6 = r 6 (17 ) 17) Example 8-2-26. The book explains that the tag is not correctly positioned. We modified the example by adding a label, and this gives an equation number in the HTML file. This number is vertically centered, whatever the size of the formula.

A 1 = N 0 (λ;Ω ) -φ(λ;Ω ) A 2 = φ(λ; Ω ) φ(λ; Ω) ALSO(
A 3 = N(λ; ω) (26
|I 2 | = T 0 ψ(t) u(a, t) - a γ(t) dθ k (θ, t) θ a c(ξ)u t (ξ, t) dξ dt ≤ C 6 f Ω S -1,0 a,-W 2 (Ω,Γ l ) |u| • →W e A 2 (Ω;Γ r , T ) (27)

RR n°6181

Example 8-2-27. Equation ( 28) should be the same as (27); but in order to test our algorithm we have have replaced some \lvert and \rvert by \lVert and \rVert, that are the same as \Vert, but declared as mathopen and mathclose symbols

|I 2 | = T 0 ψ(t) u(a, t) - a γ(t) dθ k (θ, t) θ a c(ξ)u t (ξ, t) dξ dt ≤ C 6 f Ω S -1,0 a,-W 2 (Ω,Γ l ) |u| • →W e A 2 (Ω;Γ r , T ) (28) \begin{gather} \raisetag{-40pt} \text{The sign function: \ } \mathcal{S}(x) = \begin{cases}-1 & x < 0 \\ 0 & x = 0 \\ 1 & x >

0\end{cases} \end{gather}

Example 8-2-28, showing the command \raisetag. It is defined as doing nothing in Tralics (the tag, i.e., the equation number, is inserted by the style sheet that converts from XML to HTML.) We have redefined here the command as follows

\def\raisetag#1{% \dimen0=#1\relax \ifdim\dimen0<0pt \dimen0=-\dimen0 \formulaattribute{tag-down}{\the\dimen0}% \else \formulaattribute{tag-up}{\the\dimen0}\fi}
Thus \raisetag with a value of -10pt will add tag-down = '10pt' to the formula element. In this case, the style sheet adds style = 'padding-top:10pt' to the cell containing the equation number. In the case of a positive value, padding-bottom is used instead. In this example, we use 40pt.

The sign function:

S(x) =      -1 x < 0 0 x = 0 1 x > 0 (

INRIA

Example 8-2-29: the amsmath package provides a subequations environment to support "equation subnumbering" with tags of the form (2a), (2b), (2c), and so on. All the tagged equations within it use this sub-numbering scheme based on two normal L A T E X counters parentequation and equation. First group, with only labels eq:1 and eq1:C

f = g f = g Lf = Lg (30)
The Tralics implementation is trivial: the environment does nothing. Thus, the \label command in the subequations corresponds to the current section. Second group, with only labels eq:2 and eq2:C

f = g f = g Lf = Lg + K (31)
We have removed two \labels from the align, because it produces a single equation number and accepts a single label. Thus, the text after the equations reads: Note the relationship between (3.2) and (3.2): only 30 and 31 differ. & \text{if $r -j$ is even.} \end{cases} \end{equation}

Matrix-like environments

Example 8-3-1

P r-j = 0 if r -j is odd, r! (-1) (r-j)/2 if r -j is even. \begin{gather*} \begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix} \quad \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \\ \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \quad \begin{Bmatrix} 1 & 0 \\ 0 & -1 \end{Bmatrix} \\ \begin{vmatrix} a & b \\ c & d \end{vmatrix} \quad \begin{Vmatrix} i & 0 \\ 0 & -i \end{Vmatrix} \end{gather*} Example 8-3-2, using a single equation 0 1 1 0 0 -i i 0 0 -1 1 0 1 0 0 -1 a b c d i 0 0 -i \newcommand\hdotsfor[2][x]{\multicolumn{5}{c}{.\ .\ .\ .\ .\ .\ .\ .\ .}} \setcounter{MaxMatrixCols}{20} RR n°6181 \[ \begin{Vmatrix} \,a&b&c&d&e&f&g&h&i&j &\cdots\,{} \\ &a&b&c&d&e&f&g&h&i &\cdots\,{} \\ & &a&b&c&d&e&f&g&h &\cdots\,{} \\ & & &a&b&c&d&e&f&g &\cdots\,{} \\ & & & &\ddots&\ddots&\hdotsfor[2]{5}%\,{} \end{Vmatrix} \]
Example 8-3-3. The example uses \hdotsfor, a command equivalent to \multicol-umn{5}{c}{leaders}. Leaders cannot be implemented in MathML, so that the command is redefined in this case.

a b c d e f g h i j • • • a b c d e f g h i • • • a b c d e f g h • • • a b c d e f g • • • . . . . . . . . . . . . . . .
In the example above, there was a \,{} at the end of each line. We had to remove it on the last line, because Tralics complains if a cell contains \multicolumns and additional commands. The following example is refused by Tralics; but L A T E X is happy with it, but x is typeset outside math mode. Thus the question: what is the exact effect of the last \,{} in the L A T E X case?

$\begin{array}{ccc} 111&222&333\\ \hdotsfor{2}x&t\\ \end{array}$
Example 8-3-4. This example uses the environment smallmatrix, which is defined by Tralics to be the same as matrix, i.e., a matrix without delimiters, 1 0 0 -1 the same with \left and \right parentheses 1 0 0 -1 . There is some text after the matrix. It happens that matrices in text style are badly rendered by Firefox. There is a huge amount of white space on the left of each column.

0 ≤ i ≤ m 0 < j < n P (i, j) i ∈ Λ 0 ≤ i ≤ m 0 < j < n P (i, j) \DeclareMathOperator\add{add} \DeclareMathOperator\cf {cf} \DeclareMathOperator\cov{cov} \DeclareMathOperator\non{non} \DeclareMathOperator\End{End} \[ \begin{CD} \cov (L) @>>> \non (K) @>>> \cf (K) \\ @VVV @AAA @AAA \\ \add (L) @>>> \add (K) @>>> \cov (K) \\ \end{CD} \]
Example 8-3-6. You must be careful with the CD environment, because the at-sign is an active character, that reads some text, depending on the character that follows; more examples are given below.

cov(L) → non(K) → cf(K) ↓ ↑ ↑ add(L) → add(K) → cov(K)
\[ \begin{CD} S^{W_\Lambda}\otimes T @>j>> T \\ @VVV @VV{\End P}V \\ (S \otimes T)/I @= (Z\otimes T)/J

\end{CD} \]

Example 8-3-7

S WΛ ⊗ T j → T ↓ ↓ End P (S ⊗ T )/I = (Z ⊗ T )/J
Example 8-3-8. This uses \longrightarrow, that produces character U+27F9, unknown to FM.

S WΛ ⊗ T j -→ T ↓ ↓ End P (S ⊗ T )/I = (Z ⊗ T )/J RR n°6181 \[ \mathcal{Q} = \begin{delarray}[t] ( {cc} ) X & Y \end{delarray} \begin{delarray}[t] [ {cc} ] A & B \\ C & D \end{delarray} \begin{delarray}[b] \lgroup{cc}\rgroup L \\ M \end{delarray} \]
Example 8-3-9. This example uses the delarray package that changes the meaning of the array environment. In the current version of Tralics, there is no \array command, hence no possibility to redefine it. The delarray.plt file defines a delarray environment that is used here.

Q = X Y A B C D      L M     

Compound structures and decorations

\[ 0 \xleftarrow [\zeta]{} F \times \Delta (n -1) \xrightarrow {\partial_0 \alpha(b)} E^{\partial_0 b}\] Example 8-4-1 0 ←- ζ F × ∆(n -1) ∂0α(b) → E ∂0b \begin{equation*} \cfrac {1}{\sqrt{2} + \cfrac {1}{\sqrt{3} + \cfrac {1}{\sqrt{4} + \cfrac[r] {1}{\sqrt{5} + \cfrac[l] {1}{\sqrt{6} + \dotsb } }}}} \end{equation*} Example 8-4-2 1 √ 2 + 1 √ 3+ 1 √ 4+ 1 √ 5+ 1 √ 6+••• \begin{equation} \boxed { W_t -F \subseteq V(P_i) \subseteq W_t }\end{equation} Example 8-4-3 W t -F ⊆ V (P i ) ⊆W t \[
u ≡ v + 1 mod n 2 u ≡ v + 1 mod n 2 u = v + 1 (mod n 2 ) u = v + 1 (n 2 )
The in-text layout:

u = v + 1 (mod n 2 ) (m mod n) = k 2 ; x ≡ y (mod b) ; x ≡ y mod c ; x ≡ y (d) . \begin{equation} \frac{1}{k} \log_2 c(f) \quad \tfrac{1}{k} \log_2 c(f) \end{equation} Text: $ \sqrt{ \frac{1}{k} \log_2 c(f) } \quad \sqrt{ \dfrac{1}{k} \log_2 c(f) }\, $. Example 8-4-8 1 k log 2 c(f ) 1 k log 2 c(f ) Text: 1 k log 2 c(f ) 1 k log 2 c(f ) . \begin{equation} \binom{k}{2} 2^{k -1} + \tbinom{k -1}{2} 2^{k -2} \end{equation} Text: $ \binom{k}{2} 2^{k -1} + \dbinom{k -1}{2} 2^{k -2} $. $ \dot{S} \quad \ddot{P} \quad \dddot{Q} \quad \ddddot{R} $ Example 8-4-9 k 2 2 k-1 + k-1 2 2 k-2 Text: k 2 2 k-1 + k -1 2 2 k-2 .
Example 8-4-10: Four dots above: character unknown by FM. Ṡ P ... T k i,j

Variable symbol commands

A series $H_1, H_2, \dots, H_n$, a sum $H_1 + H_2 + \dots + H_n$, an orthogonal product $H_1 \times H_2 \times \dots \times H_n$. A series $H_1, H_2, \dotsc\,$, a sum $H_1 + H_2 + \dotsb\,$, an orthogonal product $H_1 \times H_2 \times \dotsm\,$, and an infinite integral:

\[ \int_{H_1} \int_{H_2} \dotsi \; {-\Gamma}\, d\Theta \] Example 8-5-1. A series H 1 , H 2 , • • • , H n , a sum H 1 + H 2 + • • • + H n , an orthogonal product H 1 × H 2 × • • • × H n . Example 8-5-2. A series H 1 , H 2 , • • • , a sum H 1 + H 2 + • • • , an orthogonal product H 1 × H 2 × • • • ,
ψ δ (t)E t h = ψ δ (t)E t h ψ δ (t)E t h = ψ δ (t)E t h ψ δ (t)E t h = ψ δ (t)E t h Do not change style ------→ ψ δ (t)E t h = ← ------ ψ δ (t)E t h Do not change style without amsmath ψ δ (t)E t h ------→ = ψ δ (t)E t h ← ------ Do need amsmath ------→ ψ δ (t)E t h = ψ δ (t)E t h ------→ Do need amsmath \[ \sqrtsign{1 + \sqrtsign{1 + \sqrtsign{1 + \sqrtsign{1 + \sqrtsign{1 + \sqrtsign{1 + x}}}}}} \]
Example 8-5-4

1 + 1 + 1 + 1 + 1 + √ 1 + x 3.6.
x→0 sin 2 (x) x 2 = 1 lim n→∞ |a n+1 |/|a n | = 0 lim -→ (m λ i • M ) * ≤ lim ← - A/p→λ(A) A p ≤ 0 lim -→ (m λ i • M ) * ≤ lim ← - A/p→λ(A)
A p ≤ 0 \let\abs\relax \DeclareMathOperator \meas {meas} \DeclareMathOperator*\esssup {ess \, sup} \DeclareMathOperator*\supminus{sup -minus*} \newcommand\abs [START_REF]1.1. Special features 1.2. Compiling the example file 1.3. Overview of math mode 2. Examples from the TEXbook[END_REF]{\lvert#1\rvert} \newcommand\norm [START_REF]1.1. Special features 1.2. Compiling the example file 1.3. Overview of math mode 2. Examples from the TEXbook[END_REF]

INRIA

Example 8-6-3. We removed the line break between equations 2 and 3. Note that an asterisk is printed as a normal character. Note the use of the \smash command:

f ∞ = esssup x∈R n |f (x)| f ∞ = esssup x∈R n |f (x)| meas 1 {u ∈R 1 + : f * (u) > α} = esssup x∈R i meas i {u ∈R n : |f (u)| ≥ α} (∀α ∈ sup -minus * f * R * + ) \[\varlimsup_{n\to\infty}\calQ (u_n, u_n -u^{\#}) \ge \csc (\calQ' (u^{\#})) \] Example 8-6-4 lim n→∞ Q(u n , u n -u # ) ≥ cosec(Q (u # )) 3
0 + (k + p) j ± (f +q) (pk) y j (h+y) (l + q) (pk) b 0 + (k + p) j ± (f +q) (pk) y j (h+y) (l + q) (pk)
Example 8-7-2. Same, with \DS replaced by \displaystyle

b 0 + (k + p) j ± (f + q) (pk) y j (h + y) (l + q) (pk) b 0 + (k + p) j ± (f + q) (pk) y j (h + y) (l + q) (pk) \[ \biggl( \mathbf{E}_{y} \int_0^{t_\varepsilon}

RR n°6181

L_{x, y^x(s)} \varphi(x)\, ds \biggr) \] Example 8-7-3. This demonstrates that commands like \Large do affect the size delimiters as \biggl.

In Tralics, translation of math formulas is unaffected by font size commands. Thus, second part of example omitted.

E y tε 0 L x,y x (s) ϕ(x) ds \[ \sqrt[\beta]{k} \qquad \sqrt[\leftroot{2}\uproot{4} \beta]{k} \qquad \sqrt[\leftroot{1}\uproot{3} \beta]{k} \]
Example 8-7-4 Commands \leftroot and \uproot implemented as no-op.

β √ k β √ k β √ k $\sqrt{x} + \sqrt{y} + \sqrt{z}$, $\sqrt{x} + \sqrt{\mathstrut y} + \sqrt{z}$, $\sqrt{x} + \sqrt{\smash{y}} + \sqrt{z}$, $\sqrt{x} + \sqrt{\smash[b]{y}} + \sqrt{z}$ Example 8-7-5, explaining smash. √ x + √ y + √ z, √ x + y + √ z, √ x + √ y + √ z, √ x + √ y + √ z
More uses of smash (top, bottom, all):

√ x + 1 2 + √ z, √ x + √ 1 2 + √ z, √ x + 1 2 + √ z, √ x + √ 1 2 + √ z. \[ f_p (x) = \begin{cases} \frac{1}{\smash[b]{p}} & x = p \\ \frac{\strut \smash[t]{\frac{(1 -x)^{\frac{1}{2}} } { x -\sin (x -p) } } } {\sqrt{1 -p} \, \cos (x -p)} & x \neq p \end{cases} \]
Example 8-7-6. The \strut above needed by amsmath, see TLC2.

f p (x) = 1 p x = p (1-x) 1 2 x-sin(x-p) √ 1-p cos (x-p) x = p \[ \sqrt{ \frac{a+b}{x_j} } \quad \sqrt{ \frac{a+b}{\smash{x_j}} } \quad \sqrt{ \frac{a+b}{{}\smash{x_j}} } \quad INRIA \sqrt{ \frac{a+b}{\smash{x_j+b}} } \]
Example 8-7-7. The empty group above needed by amsmath, see TLC2. 3.9. The bold equivalence j<B λ : $ \bm{\sqrt [START_REF]Fine points of Mathematics Typing[END_REF]{x \times \alpha}} $ but $\let\unboldmath\relax

x j λ B ∞ + πB 1 ∼ B ∞ + πB 1 ∼ B ∞ + πB 1 B ∞ + πB 1 ∈ (B,

RR n°6181

\bm{\sqrt [START_REF]Fine points of Mathematics Typing[END_REF]{x \mathbin{\mbox{\unboldmath$\times$}} \alpha}} $ or the similar \def\sqrtsign{\sqrt{}} $ \bm{\sqrtsign}{\bm{x} \times \bm{\alpha}} $ %% $\bf \sqrt \it {\bf x \IT \times \bf \alpha \IT } $ see below A %% $\bf {\sqrt} \it {\bf {x} \IT \times \bf {\alpha} \IT } $ see below B Example 8-8-8. Second formula modified: you cannot use \unboldmath. Third formula: the command \sqrtsign is identical to \sqrt; you may wonder what the argument is. Currently \bm is the same as \mathbf, it takes one argument and typesets it in bold face font. Hence, Tralics executes the line shown above, marked 'see below A'. Here \bf and \it are the tokens inserted by the \bm command corresponding to the new and old font (in reality, these tokens have complicated names). Thus, the argument of \sqrt is the \it command. Note that the \sqrt command uses a local group (is this good idea?), so that the \it command changes font locally; said otherwise, current font remains bold, and \IT is \bf. It is a wonder that this works. We noticed that L A T E X font change commands like \mathbf typeset their arguments in a group, and modified the Tralics code; thus the equivalent of line marked 'see below B' is executed. Suddenly \sqrt looses its argument. For this reason, we changed the command \sqrtsign to \sqrt{}. The example is

2 √ x × α but 2 √ x × α

\label{eq:binom1} \end{align}

Example 8-8-10. Changed a little bit: it is currently not possible to put a \quad in a \text in math mode. Thus, the \text contains only the word 'for'.

Sample page of mathematical typesetting

First some large operators both in text: Q f (x, y, z) dx dy dz and γ∈Γ e C ∂( X γ ); and also on display: (

Q f (w, x, y, z) dw dx dy dz ≤ ∂Q f max w |w 2 + x 2 | ; z |y 2 + z 2 | ; w ⊕ z x ⊕ y Q Q   f *     Q(t)   √ 1 -t 2
) 32
Other examples here omitted.

Symbols in formulas

\[ a \# \top _x^\alpha x^\alpha_b \] \[ a \mathrel{\#} \mathop{\top}_x^\alpha x^\alpha_b \] \thinmuskip=10mu \medmuskip=17mu \thickmuskip=30mu \[ a -b = -\max \{ x , y \}\]
Example 8-9-1. In this example, \# and \top are changed into a Rel and a Op operator, so that <msub> or <mover> is used in the translation, but in the current version of Tralics, no information is attached to the symbol. Example 8-9-4. This example demonstrates that 1) spacing is wrong if an ordinary symbol is used instead of a binary symbol, 2) adding \mathrel or \mathbin in Tralics does not change this behavior, 3) using the declare-something command is not enough in Tralics: no error is signaled, but no symbol appears. Example 8-9-5. This example indicates how embellished operators can have type Rel or whatever. As usual, nothing special is added to the XML file. This means that the equal-with-hat should be a relation in the HTML file, an ordinary symbol in the Pdf version. a = b but a =b which is not a =b $ u \not< v$ or $a \not\in \mathbf{A} $, {\makeatletter\let\not\@@not $ u \not< v$ or $a \not\in \mathbf{A} $} $ \not\leq \ \not\succeq \ \not\sim $ $ \nleq \ \nsucceq \ \nsim $ Example 8-9-6. By default \not< is translated at \neg<; this is wrong, so that we redefined it. The only trouble is that \not\in does not work. We show here both behaviors: uX < v or aX ∈ A, u¬ < v or a ∈ A Example 8-9-7. This is not really good. X ≤ X X ∼ and X ∼

$\Longarrownot\longleftrightarrow \qquad \arrownot\hookleftarrow$

Example 8-9-8, demonstrating how to negate an arrow X ←→ X ← , this is not implemented in Tralics. Example of a \phantom, a \hphantom and a \vphantom. In the case of a \hphantom, the 1 should be vertically aligned as in the case of 2/1, otherwise should be aligned as in the case E/E (where E is the big expression); in the case of a \vphantom, it should be centered otherwise flushed right (aligned with the numerator).

INRIA

x 1 2 3 F oo1 1 = x 1 2 3 F oo1 1 = 2 1 = x 1 2 3 F oo1 x 1 2 3 F oo1 = x 1 2 3 F oo1 1

RR n°6181

In Tralics 2.9.4, translation of \uplus was a character ⊎, translation of \biguplus was ⨄, characters U+22E8 (multiset union) and U+2A04 (n-ary union operator with plus). Thus lines 33 and 34 correspond to \uplus, while lines 35 and 36 correspond to \biguplus. On FL, I see a big operator on line 33, a smaller one on line 34 (the version without index being smaller than the other ones), and small operators on lines 35 and 36. On FM, I see a very big operator on line 33, a small one on line 34, question marks on lines 35 and 36. Thus, translation of \biguplus seems to be wrong. Thus, we changed it: in Tralics 2.9.5, \biguplus is the same character as \uplus. Same formulas as above, with command \biguplus used instead of \uplus

x a, x a b, x a b, x

a b (40) \[ A\xleftarrow{u}B\xleftarrow[d]{}C\xleftarrow[d]{u} D\xrightarrow{u}E\xrightarrow[d]{}F\xrightarrow[d]{u}G \]
This example shows the use of \xleftarrow and \xrightarrow. Optional argument below the arrow, mandatory argument below.

A u ←-B ←- d C u ←- d D u → E → d F u → d G \[\begin{CD} @. 0 @. 0\\ @.
@VVV @VVV\\ 0 @>>> D^{1 \times q} @>.R>> D^{1 \times p} @>\pi>> M @>>> 0\\ @. @| @VV.UV\\ 0 @>>> D^{1 \times q} @>.J>> D^{1 \times p} @>\kappa>> D^{1 \times (p-q)} @>>>0\\ @. @VVV @VVV\\ @. 0 @.

0\\ \end{CD}\]

This example shows how to produce a commutative diagram (adapted from [START_REF] Fabiańska | Applications of the Quillen-Suslin theorem to multidimensional systems theory[END_REF])

0 0 ↓ ↓ 0 → D 1×q .R → D 1×p π → M → 0 ↓ .U 0 → D 1×q .J → D 1×p κ → D 1×(p-q) → 0 ↓ ↓ 0 0 INRIA \[\begin{CD} @. 0 @. 0\\ @.
@VLLVV @VVDV\\ 0 @<\mathrm{above}<< D @))\mathrm{below}) D @>\mathrm{above}>\mathrm{below}> 0\\ @. @\vert @VLLVDV\\ @. 0 @.

0\\ \end{CD}\]

A variant that shows how to put data above and below the arrows.

0 0 LL ↓ ↓ D 0 above ←- D → below D above → below 0 LL ↓ D 0 0
Some formulas that were badly rendered:

u(t) = 1 2 ( ẋ1 (t -h) -ẍ1 (t)). z 2 (t) = - 1 2 ( ψ(t) + 2 ψ(t)), v(t) = 1 2 (-ψ(t) + ψ(t)).
More formulas: formula A:

u(t) = 1 2 , formula B: u(t) = 1 2 , formula C: u(t) = 1 2
, formula D:

u(t) = 1 2 , and finally u(t) = 1 2 + 1. Using display style 1 2 (x(1)
+ ψ(t))

Font tests

We assume that the property of each math font is one (later one we shall set it to zero), and the translation of a character is an ASCII character with an attribute. Otherwise, it is a Unicode character between U+1D400 and U+1F7FF. In our test we use internal font commands like \mml@font@italic.

\def\F#1{\mbox{#1: }\csname mml@font@#1\endcsname} \def\La{AB=c+1+23} \def\Lb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \def\Lc{$\Lx abcde$ $\Lx fghijklm$ $\Lx nopqrs$ $\Lx tuvwxyz$} \def\Ld{0123456789} \def\Test#1{\par Test of #1: \def\Lx{\csname mml@font@#1\endcsname} In the Pdf version, we have problems with script and bold script for lower letters and digits. In the MTML version, Firefox has no script, fraktur or double struck font.

Test of boldscript:

A A AB B B = c c c + + , A A AB B BC C CD D DE E EF F FG G GH H HI I IJ J JK K KL L LM M MN N NO O OP P PQ Q QR R RS S ST T TU U UV V VW W WX X XY Y YZ Z
Z, a a ab b bc c cd d de e e f f f g g gh h hi i ij j j k k kl l lm m m n n no o op p pq q qr r rs s s t t tu u uv v vw w wx x xy y yz z z , . The Pdf version should be the same. The HTML version is different; only characters in the BMP are shown (for instance, the set of integers, complex numbers, etc, are often represented using a blackboard font, using characters U+2124, U+2102, these are not repeated at U+1D551 and UD1D3A).

Testing internal commands that read/write math font properties. \def\entity#1{\xmllatex{\&\#x#1;}{}} \makeatletter \mathfontproperty2=3 $\mathbf{x}$ Font property:\the\mathfontproperty\mml@font@bold, Character propery:\the\setmathchar\mathbf'x.\\ \mathfontproperty\mathbf=0 Bold x: \setmathchar\mathbf'x={\entity{1d431}}$\mathbf{x}$ ComplexC: \setmathchar\mathbf'c={\entity{2102}}$\mathbf{c}$ RR n°6181 6.1. Introduction

\newcommand\Apply[2]{\mathbox{apply}{\mathbox{#1}{}#2}} $\mathbox{mfenced}{{a+b}}^2$ % F1 $\Apply{power}{\Apply{plus}{\mathci{a}\mathci{b}} \mathcn{2}}$ %F2 ${(a+b)}^2$ % F3
The four lines above show a command and three math formulas, representing the square of the sum of a and b. The MathML recommendation, in its introduction, explains that there are three types of elements: presentation elements (formula F1) and content elements (formula F2), as well as interface elements (the toplevel <math> element, not discussed here). In any case, a formula is a tree; leafs are token elements or canonically empty elements. The main difference between these two types is the following: in the case of formula F2, there is a possibility to evaluate the formula, for instance, with a=2 and b=3, this should yield 25. In the case of F1, we have a formula with a superscript; in a case like x 2 , it is impossible to tell if this means the square of the variable x, or the second component of the vector x.

In the example F3, there are five leafs, two identifiers, a number, two operators. The default translation is a token element in presentation markup. This means that the translation of 'a' is implicitly a <mi> obtained by \mathmi, instead of a <ci> obtained by \mathci. A non-trivial question is how to translate 'xy25' (the default is one or two identifiers, followed by a number). Our formulas contain characters that are neither letters nor digits: parenthesis, plus sign, superscript character. These are operators; in the case of presentation markup, an operator can be represented as a special element (<msup> for a construction base plus exponent), or a token element (a <mo> element for a sum). In the case of content markup, special element can be used (for instance <list>, or empty elements, like <plus/>.

In content markup, the sum of two objects is specified by a <apply> element, whose children are the operator <plus/> followed by the objects, and a list of three objects is represented by a <list> element whose children are the objects. In presentation markup, a sum is a sequence (an explicit or implicit <mrow> element) containing the arguments and operators in order. In the same fashion, a list can be defined as the sequence of all elements, plus the separators (opening parentheses, closing parentheses, commas, etc.); it can also be specified by a <mfenced> element, whose attributes define what is at the start of the list, the end of the list, and between the elements. These attributes have a default value adapted for lists, meaning that f (x, y, z) can be obtained by the juxtaposition of f and a <mfenced> element containing x, y and z. In the case of formula F1, the content of <mfenced> element is the translation of {a+b}; because of the braces this is a <mrow> element, with three children. Formulas F1 and F3 are equivalent: a base and an exponent, the base contains an opening parenthesis, the identifier a, the operator plus, the identifier b, and a closing parenthesis. The renderer gives (a + b)

2 .

The second formula renders as ^(+(a, b), 2). My Web browser knows only some of the operators; hence it is possible that you see the same as ab2. In the Pdf version, we implement the <apply> element as follows: first the operator, then the arguments as a list. We could do better, but all nary operators can have implicit arguments: it is possible to represent the sum of all f (x) such that x satisfies some condition, for instance, x ∈ N and x is a square. Since Tralics does not generate content markup, this is not implemented at all.

INRIA

${\mathbox{apply}{\mathbox{minus}{}\mathci{a}\mathci{b}}}$ %2.1.3

Simple example of presentation markup: -(a, b). Note that the minus operator takes one or two arguments.

More complicated examples

${x^2+{4\*x}+4}=0$ Rendering: x 2 + 4x + 4 = 0. Note the use of nested elements, to denote terms, for example, the lefthand side of the equation; this is obtained here by simply putting braces in the T E X source. The  MathML character entity is used here to indicate to a renderer that there are special spacing rules between the 4 and the x and that the 4 and the x should not be broken onto separate lines. This special character can be obtained by the \* command whose meaning is: do not consider any special spacing rule, but allow a break here. We decide to translate \* in this way because it converts an invisible product into an invisible product. We do not believe in hyphenation for math formulas (inline formulas should be small, and not split, big formulas should be in display mode). Translation from XML to Pdf is empty for this character.

$x=\frac{{-b}\pm\sqrt{b^2-{4\* a\* c}}}{2\* a}$ Second example, x = -b± √ b 2 -4ac 2a
. Notice that the 'plus or minus' sign is given by the entity name ± this is equivalent to using the character reference &#00B1;. When converting an XML document into Pdf, the character reference is required (notice that the style sheet that converts from XML to XSL/FO replaces entity names by character references, so that this is not a problem). On the other hand, there are cases where entity names are refused in a HTML document: if that document is presented as XML, and the DTD makes no reference to MathML (this very document is likely to be XHTML1.0 strict).

$z\mathbox{mfenced}{{x+y}}$ $A=\begin{bmatrix}x&y\\z&w\end{bmatrix}$

Example three: z (x + y). The MathML recommendation says that there is some ambiguity: what is the relation between z and the expression x + y that follows? implicit product or function application? A translator like Tralics cannot guess.

Example four A =

x y z w . Most elements have a number of attributes that control the details of their screen and print rendering. The attributes for operator elements given using <mo> are set to default values determined by a dictionary. Translation of the environment is a <mfenced> element, with two attributes; all other attributes are ignored in the XML to Pdf conversion. No dictionary is currently used; translation of a <mo> is complicated: the difference between lim and is that we have a sequence of 3 ASCII characters, and a character reference (that could be given in base 10, in base 16, or directly as a UTF-8 character). The XML reader converts this into a command (with a complicated name) that expands to \sum, that expands to whatever is defined by the style files. . This example has two interesting points. The first one is that some operators can have optional arguments (in this case, the default value 2 is used). The second point is that the first child of <apply> can be any function; in this example, it is a <csymbol> element (equivalent of <mo>), whose value is the character ± (that has to be entered as a character, not a command). Other content markup examples omitted.

$\mathbox{mrow}{\mathbox{apply}{\mathbox{eq}{}\mathci{A} \mathbox{matrix}{\mathbox{matrixrow}{\mathci{x}\mathci{y}} \mathbox{matrixrow}{\mathci{z}\mathci{w}}}}}$

Next example = (A, xyzw). This example is badly rendered in the Pdf (matrix operators not implemented), and my favorite HTML browser shows the same result! Deprecated styles: 'a' should be a normal a, 'a' should be a sans-serif a, and 'a1' should be fraktur. In the case of 'ab', the a should be bold upright, and the b should be italic. The MathML recommendation says that 'mathvariant' should have precedence over 'fontstyle', which is deprecated, and not used by Tralics. In the Pdf, attributes of \mstyle are currently ignored.

Presentation Markup

$x$ $\mathmi{\char32x\char32}$ $D$ $\mathmi{\char32sin\char32}$ $\mathmi[mathvariant][script]{L}$ $\mathmi{}$

Examples for 3.2.3: 'x' (an x without spaces), 'x' (an x with spaces), 'D', 'sin', 'L' and '' (empty identifier). An italic font should be used unless defined by an attribute, or an upright font if the element has more than one character. In the Pdf, spaces are incorreclty counted as characters.

$\sin(x)$ $\mathmi{sin}\ApplyFunction x$ $1+x+\mathmo{...}+n$ $1+x+\mathmi{...}+n$ $\pi, \ImaginaryI,\ExponentialE$ INRIA This is sin(x), using , Unicode character U+2061: 'sinx'. Ellipses using <mo>: '1 + x + ... + n' and <mi>: '1 + x + ... + n', constants π, i, e (these are somehow unusual in Pdf). $2, \mathmn{0.123}, \mathmn{1,000,000}, \mathmn{2.1e10}, \mathmn{0xFFEF}, \mathmn{MCMLXIX}, \mathmn{twenty one}$. $2+{3\*\ImaginaryI},\frac12, \pi, \ExponentialE$.

A <mathmn> element represents a number, typeset with an upright font, for instance 2, 0.123, 1,000,000, 2.1e10, 0xFFEF, MCMLXIX, twentyone. Numbers, that could be <mathcn> (content markup numbers), but are not <mathmn> (presentation markup numbers): 2 + 3i, 1 2 , π, e. $+, <,\le, \mathmo{<=}, \mathmo{++}, \sum,\mathmo{.NOT}, \mathmo{and}, \*,\mathmo[mathvariant][bold]{+}$ $({a+b})$, $[{0,1})$, $f\ApplyFunction {({x,y})}$ $x\* y$, $f\ApplyFunction{(x)}$, $\sin\ApplyFunction x$ and $m_{1\InvisibleComma2}$.

Example of <mathmo> (operators): +, <, ≤, =, ++, , .N OT, and, , +. In the Pdf version, font attributes are ignored for operators (they are complicated to implement, and only 'bold' variant is available with the current math fonts).

More examples: (a + b), [0, 1), f (x, y).

Invisible operators: xy, f (x), sin x and m 12 .

$\frac{\DifferentialD}{\DifferentialD x}$

Embellishment d dx . The MathML recommendation says that the spacing around an embellished operator like + 4 should be the same as that of the operator at its core. An expression like 4 + is not an embellished operator, but phantoms are. More surprising: a fraction whose numerator is an operator is an embellished operator, the example shown here being the motivation. ). The rule is the following. An enbellished operator (for instance an underlined parenthesis) should stretch vertically, as it it were not embellished, this is not implemented in the Pdf. A maximum size can be given (either as a dimension, or a ratio to the default size, a value of 1 says that the operator should not stretch. Horizontal stretching: x → maps to y. In the Pdf version, we have a normal arrow.

$\mtext{ Theorem 1: }$ $X\mathbox{mtext}{\mathcnothing{^^^^2009}}X$ $X\mathbox{mtext}{\mathcnothing{^^^^2009^^^^200a^^^^200a^^^^2009% ^^^^200a^^^^200a}}X$' $X\mkern10muX$ $X\mtext{ /* a comment */ }X$' $\mathmo{ there exists }{{\delta>0}\mathmo{ such that }{{f\ApplyFunction{(x)}}<1}}$

RR n°6181

Text: ' Theorem 1: ', 'X X' 'X X' (expression obtained by inserting twice three characters: thickspace, thinspace and verythinspace, should be the same as 'X X', 'X /* a comment */ X'. Other example: thereexists δ > 0 suchthat f (x) < 1. The MathML rules say that initial and final space should be removed and consecutive space characters should be replaced by a single space character in elements like <mtext> or <mo>. This is not done in the Pdf version, and you will see the following: normally <mtext> is typeset via \text, and spaces are typeset as usual outside math mode; the default for all other operators is a math font, and spaces are ignored. A non-trivial question is: what amount of space is inserted between the 'exists' and the δ that follows? my browser uses none, this is not good, T E X uses a small space, but ignores the space before it, the MathML recommendation is unclear, and the sample renderings of the MathML test suite show no space between two <mtext> elements or between a <mtext> and a comma.

${x\mathbox{malignmark}[edge][right]{}}^2$

Alignment: x 2 . The empty element used in this formula is ignored in the Pdf version, (and, it seems, by my browser also). It defines an alignment mark, that is ignored outside tables. The idea is the following. If you want a table where all elements are centered, except for the first row, first column, and element at position (2,2), the easy way is to use a <mtable> element, specifying that alignment is left, center, etc, specify alternative alignment for the first row, or some specific elements. If this is not sufficient, an alternate method is provided. Typically each row contains a single cell, with some empty <maligngroup> elements. You can specify alignments for groups in the same way as alignment for cells, with two additions: if the group contains numbers, you can say that decimal points are aligned (there is an implicit point at the end of the group); moreover you can explicitly set a mark. In the example above, the mark is between the letter x and the superscript. Using a mark does not alter rendering of the expression.

$\mathbox{ms}{\mathcnothing{\&}}$ $\mathbox{ms}{\mathcnothing{\&}}$ $\mathbox{ms}{\mathcnothing{double quote is "}}$ $\mathbox{ms}[lquote][aa][rquote][bb]{\mathcnothing{test}}$

Literals &, &, doublequoteis", test. This element is not yet correctly converted in Pdf. There should be some kind of quotes around the expression, the quotes may be given by attributes; my browser shows strange characters. x +z and x+y+z x +z . These two expressions should produce the same result, the numerator and the denoninator have the same width. Said otherwise, spacing around the plus symbol (inside or outside phantom) should be that of a prefix plus operator if it is the first element in a row, followed by something else, should be infix if it is the sole element, or neither first nor last, should be postfix otherwise. The first expression is wrong, because the MathML documentation says that a <mrow> is necessary so that the <mfenced> has just one argument; a pair of braces should be added, this gives the \mrow. Examples that follow are wrong because '01' or 'xy' produce a single <mn> or <mi> element; in the case of an identifier this may depend on the font. You can use a separator (space or \relax) or uses braces (no <mrow> is produced if there is a single element in the math list). Note: spaces are ignored in math mode; it is not completely clear whether or not a space is allowed as separator. 1 0 e x dx $\underbrace{x+y+z}\mathattribute{accentunder}{true} \text{~versus~} \underbrace{x+y+z}\mathattribute{accentunder}{false} $, $\hat x \text{~versus~}\hat x\mathattribute{accent}{false}$, $\overbrace{x+y+z}\mathattribute{accent}{true} \text{~versus~} \overbrace{x+y+z}\mathattribute{accent}{false}$, $\mathop{\int\limits_0}\limits^\infty \text{~versus~} \int\limits_0^\infty$ Underscript, overscripts: x + y + z versus x + y + z , x versus x, x + y + z versus x + y + z. Converting mathml to Pdf is not obvious because if a brace character is an accent-declared overscript, we must apply some command to the kernel. In order for this example to work, another command must be applied if the brace is non-accent (we use the same command, that's simplier). In a case like . As explains above, this could be typeset, by aligning the \X. the material between two \X commands should be left-aligned, or aligned on the decimal point. In some cases, the \X is a direct child of the cell, but not always. For this reason, it is nearly impossible to typeset this correctlty in T E X.

Bibliography

Exercise 16. 5 :

 5 F (w, z) = ∂F (w, z)/∂z and F (w, z) = ∂F (w, z)/∂w. \let\none\mmlnone $R_i{}^{jk}{}_l$ versus $\mathbox{mmultiscripts}{Ri\none\none jk \none l\none}$ Exercise 16.6: R i jk l versus R i j kl (MathML example, section 3.4.7.2, only second index raised).

Exercise 16. 9 :

 9 Deleting an element from an n-tuple leaves an (n -1)-tuple. Exercise 16.10: Letters with descenders are Qfgjpqy. $x+y-z$, $x+y*z$, $x*y/z$ Basic binary operators: x + y -z, x + y * z, x * y/z. $x\times y\cdot z$, $x\circ y\bullet z$, $x\cup y\cap z$, $x\sqcup y\sqcap z$, $x\vee y\wedge z$, $x\pm y \mp z$. Aliases $x\land y\lor z$.

  x_n}, {\textstyle \sum x_n}, {\scriptstyle \sum x_n}, {\scriptscriptstyle \sum x_n}$ Different sums x n , x n , P xn, P xn. The position of the index is unaffected by the style. \[ {\displaystyle \int_{-\infty}^{\infty} \sum_{n=1}^m}, {\textstyle \int_{-\infty}^{\infty} \sum_{n=1}^m}, {\displaystyle\int\limits_0^{\frac{\pi}{2}} \sum\nolimits_{n=1}^m} \]

x

  lim l x + lim l x + lim a x + lim l x sin l x + sin l x + sin l x + sin a x sin l x + sin l x + sin l x + sin l x \[\operatorname*{sin}_a \operatornamewithlimits{sin}_a \qopname\relax{n}{sin}_a \operatorname{sin}_l \qopname\relax{o}{sin}_l \mathop{\rm sin}_a\mathop{\rm sin}\limits_a\] \[\textstyle\operatorname*{sin}_l \operatornamewithlimits{sin}_l \qopname\relax{n}{sin}_l\operatorname{sin}_l \qopname\relax{o}{sin}_l \mathop{\rm sin}_l\mathop{\rm sin}\limits_a\]These are L A T E X commands that can define operators like sin or lim: l sin l sin l sin l sin l sin l sin a INRIA \[\sum_{\scriptstyle0\le i\le m\atop\scriptstyle0<j<n}P(i,j)\qquad \sum_{\stackrel{0\le i\le m}{0<j<n}}P(i,j)\]

  \def\X{\char''} \[{ \{\underbrace{\overbrace{\mathstrut a,\ldots,a}^{k\;a\X\mathrm{s}}, \overbrace{\mathstrut b,\ldots,b}^{l\;b\X\mathrm{s}}}_{k+l\;\mathrm{elements}}\} }\quad\text{vs}\qquad { {\{\,}\underbrace{\overbrace{\mathstrut a,\ldots,a}^{k\;a'\mathrm{s}}, \overbrace{\mathstrut b,\ldots,b}^{l\;b'\mathrm{s}}}_{k+l\;\mathrm{elements}}{\}\,}.}\]

{

  a, ..., a k a s , b, ..., b l b s k+l elements } vs { a, ..., a k a s , b, ..., b l b s k+l elements } .

$

  \hbox{upright} \it \text{Italic\bf Boldface} {\tt \text{x = y$^2$}}$ Translation: uprightItalicBoldfacex = y 2 . Exercise 19.2: Compare B. L. User's solution, Knuth's solutions and \tfrac: y = 1 2

\ 1 )

 1 [1=1\eqno\hbox{(3--1)} \] \[0=0\eqno(*,{**},{***},16'\char'\'\char'\^,3^^^^20131)\] \[\def\apostrophe{'} 2=2\eqno(16'\char'\')\] \[\def\apostrophe{'} 3=3\eqno(16')\] 0 = 0 (*,**,***,16´´^,3-Exercise 19.7: It is possible to insert the equation number in the formula.What you can see here is that the spacing for two and three stars is the same: Knuth says that T E X converts binary star to type Ord, in the case of three stars, the middle one is of type Ord.

  \begin{eqalignno} (x+y)(x-y)&=x^2-xy+yx-y^2\\ &=x^2-y^2;&(4)\\ (x+y)^2&=x^2+2xy+y^2 ; \end{eqalignno} \begin{leqalignno} (x+y)(x-y)&=x^2-xy+yx-y^2\\ &=x^2-y^2;&(4)\\ (x+y)^2&=x^2+2xy+y^2 . \end{leqalignno}

  \begin{equation} (a+b)^2 = a^2+2ab+b^2\end{equation} \[ \sin^2\eta+\cos^2\eta = 1 \] \begin{equation} x^2 + y^2 = z^2 \end{equation} \begin{align} x^2 + y^2 &= z^2 \\ x^3 + y^3 &< z^3 \end{align} \begin{eqnarray} x^2 + y^2 &=& z^2 \\ x^3 + y^3 &<& z^3 \end{eqnarray} \begin{equation*} n^2 + m^2 = k^2 \end{equation*} \begin{equation} n^p +m^p \neq k^p \qquad p > 2 \end{equation} \begin{multline} \tag{2} \sum_{t \in \mathbf{T}} \int_a^t \biggl\lbrace \int_a^t f(t -x)^2 \, g(y)^2 \,dx \biggr\rbrace \,dy \\ = \sum_{t \notin \mathbf{T}} \int_t^a \biggl\lbrace g(y)^2 \int_t^a f(x)^2 \,dx \biggr\rbrace \,dy \end{multline} INRIA Example 8-2-1. This uses the 'leqno' option of the amsmath package, that is assumed to put equation numbers on the left. In Tralics, this will set the attribute equation-number = 'left' of the document element.

2 x 3 + y 3

 233 \thismathattribute{background}{white} \rowattribute{mathvariant}{bold} x^2 + y^2+100 &= z^2 \\ \cellattribute{columnalign}{left} x^3 + y^3+1 &< z^3 INRIA \end{align} Translation (bold attribute ignored in th Pdf version): x 2 + y 2 + 100 = z b)^3 &= (a + b) (a + b)^2 \\ &= (a + b)(a^2 + 2ab + b^2) \\ &= a^3 + 3a^2b + 3ab^2 + b^3 \end{split}\end{equation} Example 8.2.7 Single equation on several lines with alignment

  ) \begin{gather} (a + b)^2 = a^2 + 2ab + b^2 \\ (a + b) \cdot (a -b) = a^2 -b^2 \end{gather} Example 8-2-10, equation groups without alignment.(a + b) 2 = a 2 + 2ab + b 2 (a + b) • (a -b) = a 2 -b 2\begin{gather} D(a,r) \equiv \{ z \in \mathbf{C} \colon |z -a| < r \} \notag \\ \operatorname{seg} (a, r) \equiv \{ z \in \mathbf{C} \colon \Im z < \Im a, \ |z -a| < r \} \\ C (E, \theta, r) \equiv \bigcup_{e \in E} c (e, \theta, r) \end{gather} Example 8-2-11 D(a, r) ≡ {z ∈ C : |z -a| < r} seg(a, r) ≡ {z ∈ C : Iz < Ia, |z -a| < r} C(E, θ, r) ≡ e∈E c(e, θ, r) \begin{align} (a + b)^3 &= (a + b) (a + b)^2 \\ &= (a + b)(a^2 + 2ab + b^2) \\ &= a^3 + 3a^2b + 3ab^2 + b^3 \end{align} \begin{align} x^2 + y^2 & = 1 \\ x & = \sqrt{1-y^2}\end{align} INRIA Example 8-2-12

  &= 1 \\ x &= \sqrt{1-y^2} \\ \text{and also }y &= \sqrt{1-x^2} \end{aligned} \qquad \begin{gathered} (a + b)^2 = a^2 + 2ab + b^2 \\ (a + b) \cdot (a -b) = a^2 -b^2 INRIA \end{gathered} \end{equation}

  -\partial\times E \\ E' &= \partial\times B -4\pi j \, \end{rcase} \quad \text {Maxwell's equations} \end{equation*} Example 8-2-19 5 B = -∂ × E E = ∂ × B -4πj Maxwell's equations \renewcommand\minalignsep{5pt} \begin{equation} \begin{aligned} V_j &= v_j & X_i &= x_i -q_i x_j & &= u_j + \sum_{i\ne j} q_i \\ V_i &= v_i -q_i v_j & X_j &= x_j & U_i &= u_i \end{aligned} \end{equation} Example 8-2-20

  \begin{align} A_1 &= N_0 (\lambda ; \Omega') -\phi ( \lambda ; \Omega') \\ A_2 &= \phi (\lambda ; \Omega') \phi (\lambda ; \Omega) \\ \intertext{and finally} A_3 &= \mathcal{N} (\lambda ; \omega) \end{align} Example 8-2-21A 1 = N 0 (λ;Ω ) -φ(λ;Ω ) A 2 = φ(λ; Ω )φ(λ; Ω)and finallyA 3 = N(λ; ω)Example 8-2-22, 8-2-23, 8-2-24 explain that spacing around equations can be wrong; we omit them. \begin{align} x^2+y^2 &= z^2 \label{eq:A} \\ x^3+y^3 &= z^3 \notag \\ x^4+y^4 &= r^4 \tag{$*$} \\ x^5+y^5 &= r^5 \tag*{$*$} \\ x^6+y^6 &= r^6 \tag{\ref{eq:A}$'$} \\ A_1 &= N_0 (\lambda ; \Omega') -\phi ( \lambda ; \Omega') \\ A_2 &= \phi (\lambda ; \Omega') \, \phi (\lambda ; \Omega) \tag*{ALSO (\theequation)} \\ A_3 &= \mathcal{N} (\lambda ; \omega) \end{align} Example 8-2-25. In the Companion, first equation is numbered (1), second equation has no number, third is (*), then come *, (1'), (2), ALSO (2) and (3). Since Tralics does not compute equation numbers, you will not see (1), (

  r -j$ is odd,} \\ r! \, (-1)^{(r -j)/2}

5 .

 5 The style of the subarray should be smaller

  \sum_{i=1}^n \qquad \int_0^\infty \qquad \lim_{n \to 0} \] Text: $\sum_{i=1}^n$, $\int_0^\infty$, $\lim_{n \to 0}$.

  4-11. Commands \accentset and \underaccent are defined in the amsmath.plt file, they produce a <munder> or <mover> element, with attribute accent or mathaccent set to true. Note that accents might be too big. * X $ h M C M ABC $(xyz)\spdddot$ \quad $(xyz)\spddot$ \quad $(xyz)\spdot$ $(xyz)\spbreve$ \quad $(xyz)\spcheck$ $(xyz)\sphat$ \quad $(xyz)\sptilde$ Example 8-4-12. (xyz) ... (xyz) .. (xyz) . (xyz)˘(xyz) ∨ (xyz) (xyz) ∼ \[ \overset{*}{X} > \underset{*}{X} \iff \sideset{}{'}\sum_{a,b \in \mathbf{R^*}} \overset{a}{\underset{b}{X}} = X \] Example 8-4-13. Commands \overset and \underset are defined in the amsmath.plt file, they produce a <munder> or <mover> element. *

(

  for all ups and downs) then ∆ sum of ups = ∆ sum of downs \newcommand\abs[1]{\lvert#1\rvert} \setlength\mathindent{0pt} \begin{gather*} \lim_{x \rightarrow 0} \frac{ \sin^2(x) }{ x^2 } = 1 \\ \varliminf_{n \rightarrow \infty} \abs{a_{n+1}} / \abs{a_n} = 0 \\ %{ JG \varinjlim (m_i^\lambda \cdot M)^* %} JG \le \varprojlim_{A/p \rightarrow \lambda(A)}A_p \le 0 \end{gather*} Example 8-6-2. Braces uncommented out for the last equation.

  lim

  {\lVert#1\rVert} \begin{gather*} \norm{f}_\infty = \esssup_{x \in R^n} \abs{f(x)} \\ \norm{f}_\infty = \smash{\esssup_{x \in R^n}} \abs{f(x)} \\ \meas_1 \{ u \in R_+^1 \colon f^*(u)>\alpha \} = \esssup_{x \in R^i} \; \meas_i \{ u \in R^n \colon \abs{f(u)} \geq \alpha \} \\ \quad (\forall \alpha \in \supminus_{f^*} R_{*+}) \end{gather*}

  .7. Fine tuning the mathematical layout \let\LB={ \let \RB=} \Test \] Example 8-7-1. Original L A T E X version, plus version with braces added.

  b

  in formulas $ \forall n \in \mathbb{N} : \mathfrak{M}_n \leq \mathfrak{A} $ \DeclareMathAlphabet\mathbb{U}{fplmbb}{m}{n} $ \lbrace n,m \in \mathbb{N} \mid \mathfrak{N}_{n,m} \rbrace $ \DeclareMathAlphabet\mathscr{T1}{hlcw}{m}{it} $A_B \neq \mathscr{A}_\mathscr{B} \neq \mathcal{A}_\mathcal{B}$ Example 8-8-1 ∀n ∈ N : M n ≤ A Example 8-8-2 {n, m ∈ N | N n,m } Example 8-8-3 The \DeclareMathAlphabet command takes five arguments and defines the first one to be \relax. A B = A B = A B \newcommand\bfB{\mathbf{B}} \newcommand\bfx{\mathbf{x}} \bmdefine\bpi{\pi} \bmdefine\binfty{\infty} \section{The bold equivalence $\sum_{j < B} \prod_\lambda : \bm{\sum_{x_j} \prod_\lambda}$} \begin{gather} B_\infty + \pi B_1 \sim \bfB_{\binfty} \bm{+}\bpi \bfB_{\bm{1}} \bm {\sim B_\infty + \pi B_1} \\ B_\binfty + \bpi B_{\bm{1}} \bm{\in} \bm{\biggl\lbrace} (\bfB, \bfx) : \frac {\partial \bfB}{\partial \bfx} \bm{\lnapprox} \bm{1} \bm{\biggr\rbrace} \end{gather} Example 8-8-4. Currently \bndefine is \def and \bm is \mathbf.

6 {{{{{Q

 6 Example 8-8-7: same code different packages.

  or the similar √ x × α \bmdefine\bhat{\hat} % This does not work %$\hat a \neq \bm{\hat a} \neq \bm{\hat a} = \bhat a \neq \bm{\widehat a}$ $\hat a \neq \bm{\hat a} \neq \bm\hat a = \bhat a \neq \bm\widehat a$ Example 8-8-9 modified a = a = a = a = a \section{Sample page of mathematical typesetting} First some large operators both in text: \( \iiint\limits_{\mathcal{Q}} f(x,y,z)\,dx\,dy\,dz \) and \(\prod_{\gamma\in\Gamma_{\widetilde{C}}} \partial(\widetilde{X}_\gamma)\); and also on display: \begin{equation} \begin{split} %% This line is deliberately long so as to show %% differences in widths; it is a little over the measure %% in article/cmr. \iiiint\limits_{\mathbf{Q}} f(w,x,y,z)\,dw\,dx\,dy\,dz &\leq \oint_{\bm{\partial Q}} f' \left( \max \left\lbrace \frac{\lVert w \rVert}{\lvert w^2 + x^2 \rvert} ; \frac{\lVert z \rVert}{\lvert y^2 + z^2 \rvert} ; \frac{\lVert w \oplus z \rVert}{\lVert x \oplus y \rVert} \right\rbrace\right$ in the open interval \( \left] -1, 1 \right[ \) the infinite sum in Equation~\eqref{eq:binom1} is convergent; however, this does not hold throughout the closed interval \( \left[ -1, 1 \right] \). \begin{align} (1 -x)^{-k} &= 1 + \sum_{j=1}^{\infty} (-1)^j \ibinom{k}{j} x^j \quad \text{ for } k \in \mathbb{N}; k \neq 0.

For

  x in the open interval ]-1, 1[ the infinite sum in Equation (32) is convergent; however, this does not hold throughout the closed interval [-1, 1].(1 -x) -k = 1 + ∞ j=1 (-1) j k jx j for k ∈ N; k = 0.

2 .

 2 This example demonstrates that spacing in math formulas depend on three registers that the user can change, but the value is ignored by Tralics. a -b = -max{x, y} Example 8-9-3. This demonstrates that different spacing is used for \bigl/\bigr or \left/\right. Tralics tries very hard to convert big open/close pairs to left-right ones. \thinmuskip=10mu \medmuskip=17mu \thickmuskip=30mu \[ a \Bigl( \sum x \Bigr) \neq a \left( \sum x \right) \] y + z \] \[ a \mathbin{\neg} b \qquad x \mathrel{\square} y + z \] \[ a \bneg b \qquad x \rsquare y + z \]

  = b \text{ but } a \tilde{=} b \text{ which is not } a \mathrel{\tilde{=}} b \]

Test of multiscripts: 0 F 1 y

 01 Differences between \uplus and \biguplus. Consider the following input lines. \[{\uplus a}, {\uplus _ab}, {\mathop \uplus_ab}, {\mathop \uplus\limits_ab} \] \[{x\uplus a}, {x\uplus _ab}, {x\mathop \uplus_ab}, {x\mathop \uplus\limits_ab} \]

  \textstyle a, a b, a b, a b

  Test of normal: AB = c + 1 + 23, ABCDEF GHIJKLM N OP QRST U V W XY Z, abcde f ghijklm nopqrs tuvwxyz, 0123456789. Test of upright: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789. Test of bold: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789. Test of italic: AB = c + 1 + 23 , ABCDEFGHIJKLMNOPQRSTUVWXYZ , abcde fghijklm nopqrs tuvwxyz , 0123456789 . Test of bolditalic: AB = c + 1 + 23 , ABC DE F GH I J K LM N OP QRS T U V W X Y Z , abcd e f g hi j k l m nopq r s tuv w x y z , 0123456789 . Test of script: AB = c + + , ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, .

  3.2, content markup. = (+(^(x, 2), * (4, x), 4), 0) This example shows that content markup is sometimes easier. Next example = (x, ÷(±(-(b), √ (Degree = 2, -(^(b, 2), * (4, a, c)))), * (2, a)))

\def\X# 1 #

 1 2{\mathbox{#1}{\mathcnothing{\char32#2\char32}}} $\X{mi}{x}\X{mo}{+}{\X{mi}{a}\X{mo}{/}\X{mi}{b}}$ $x+{a/b}$ Compare 'x + a/b' with 'x + a/b'. These two examples should look the same; in the first case the content of each element is a space, a character, a space; for the second example, there are no spaces.$\mathmi[fontweight][bold][mathvariant][normal]{a}$ $\mathmi[fontweight][bold][mathvariant][sans-serif]{a}$ $\mathmi[fontweight][bold][mathvariant][fraktur]{a1}$ $\mathbox{mstyle}[fontstyle][italic]{\mathbf{a}b}$

$

  \underline{(}\frac ab \overline)$. $\mathmo[maxsize][1]{(} \frac ab\mathmo[maxsize][1]{)}$, $(\frac ab)$ $x\mathop\rightarrow\limits_{\mtext{ maps to }}y$ Stretching: ( a b ). With maxsize ( a b ), and without ( a b

$

  {2\* x}+y-z$, $({x,y})$ Example of <mrow>: 2x + y -z, (x, y).\[\frac{(\frac ab\mathattribute{linethickness}{0})\qquad \frac ab}{\frac cd}\mathattribute{linethickness}{2}\qquad \frac{1}{x^3+\frac x3} = \frac{1}{x^3+\frac x3} \mathattribute{bevelled}{true}\qquad \frac{1+\sqrt 5}{2} \]Example of <mfrac>; if the bevelled attribute is true, a diagonal line should separate numerator and denoninator (not implemented in Pdf).

$

  \mathbox{mstyle}[maxsize][1]{(\frac ab)}$ INRIA Example of <mstyle>: ( a b ). Attributes of the element are used by children as default value. In the example, both opening and closing parentheses should use maxsize=1. This mechanism is not yet implemented in the Pdf. $\mathbox{merror}{ \mtext{ Unrecognised element: mfraction; arguments were: } {1+\sqrt5}\mtext{ and } 2}$ Error: Unrecognised element: mfraction; arguments were: 1 + √ 5 and 2. \def\test{C\mathbox{mpadded}[width][0em]{\kern-0.3em\text{|}}} $\test$, $\mathbox{semantics} {\test\mathbox{annotation-xml}[encoding][MathML-Presentation]{\mathbb{C}}}$ $\mathbb{C}$ $\mathbox{mpadded}[width][0em]{C}\kern0.3em\text{|}$ Padding: C|, C|C. The previous expression contains two letters C with a vertical bar over it. None of them looks OK on my browser, because of the negative space. The Pdf version contains a third C because the <semantics> element is not implemented. The formula should mimic C. Positive padding C | is better in my browser. $\frac{x+y+z}{x\phantom{\mathmo[form][infix]{+}y}+z}$ $\frac{x+y+z}{x\phantom{+}\phantom{y}+z}$ Phantom: x+y+z

  \def\mfence{\mathbox{mfenced}} Fences: $\mfence{x}$, $(x)$, $\mfence{xy}$, $f\ApplyFunction\mfence{xy}$, $(x,y)$, $\mfence{{a+b}}$, $\mfence[open][[]{0\relax1}$. Wrong $\mfence{a+b}$, $\mfence{01}, \bf\mfence{xy}$, right: $\bf\mfence{x y}$, $\bf\mfence{{x}{y}}$.Fences: (x), (x), (xy), f (xy), (x, y), (a + b), [01). Wrong (a + b), (01) , (xy), right: (xy), (xy). Note that separators do not show in the Pdf, so that it is unclear why some expressions are wrong.

  )^2$ ${(x+y)}^2$ $\int_0^1{\ExponentialE^x\*{\DifferentialD x}}$ Scripts: Compare (x + y) 2 (without braces) with (x + y) 2 (recommended),

)

  difference between an operator with underscript to which an overscript is added, and an operator with two scripts. $\mathbox{mmultiscripts}{F1\none\mathbox{mprescripts}{}0\none} \ApplyFunction{({;a;z})}$ $\mathbox{mmultiscripts}{Ri\none\none jk \none l\none}$Multiscripts: 0 F 1 (; a; z) and R i j kl . $(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array})$, $\mathbox{mtable}{\mathbox{mlabeledtr}[id][e-is=m-c-square]{ \mathbox{mtd}{\text{(,and an numbered equation: (2.1) E = mc 2 . $\def\X{\mathbox{maligngroup}{}} INRIA \def\A{{{\X\mathmn{8.44}\*\X x} \X +{\X \mathmn{55} \*\X y}}\X=\X0} \def\B{{{\X\mathmn{3.1} \*\X x} \X -{\X \mathmn{0.7}\*\X y}}\X=\X{-\mathmn{1.1}}} \mathbox{mtable}[groupalign][\char'\{decimalpoint left left decimalpoint left decimalpoint\char'\}]{ \mathbox{mtr}{\mathbox{mtd}{{\A}}} \mathbox{mtr}{\mathbox{mtd}{{\B}}}} $ Alignment 8.44x + 55y = 0 3.1x -0.7y = -1.1

  ((x 2 ) 3 ) 4 , ((x 2 )

	Rendering:
	Translation of the first formula
	<formula type='inline'>
	<math xmlns='http://www.w3.org/1998/Math/MathML'>
	<mrow>
	<mo>(</mo>
	<mo>(</mo>
	<msup><mi>x</mi> <mn>2</mn> </msup>
	<msup><mo>)</mo> <mn>3</mn> </msup>
	<msup><mo>)</mo> <mn>4</mn> </msup>
	</mrow>
	</math>
	</formula>
	Translation of the second formula
	<formula type='inline'>
	<math xmlns='http://www.w3.org/1998/Math/MathML'>
	<msup>
	<mrow><mo>(</mo>
	<msup>
	<mrow>
	<mo>(</mo>
	<msup><mi>x</mi> <mn>2</mn> </msup>
	<mo>)</mo>
	</mrow>
	<mn>3</mn>
	</msup>
	<mo>)</mo>
	</mrow>
	<mn>4</mn>
	</msup>
	</math>
	</formula>
	INRIA

  Exercise 16.8: Ifx = y,then x is equal to y. (this exercise says what you should not do).

Translation a + d + y, √ a + √ d + √ y, a + d + y, a + d + y.

Exercise 16.7: 10 10 , 2 n+1 , (n + 1) 2 , √ 1 -x 2 , w + z, p e1 1 , a bc de , 3 h n (αx).

n+n Note: In the current version of Tralics, it is unclear what happens when you put style commands randomly in a math formula; in any case, Tralics uses the correct math style, but has difficulties in inserting <mstyle> elements: what is the scope? Currently such an element is added to the current math list, if it contains a style change command; in the example above, we have two such commands, thus three different styles, and a single list (first example) or three lists (second example). Translation of the first example is wrong, translation of the second example is correct because the style command

  is the first token of the list.

	Double over. It is an error if you say A over B over C without adding braces. As you can see, if a
	fraction is in text style, its numerator and denominator are in script style, so that it is sometimes
	better to use a slash.
	a b 2	and	a b 2	and	a/b 2	and	a b/2	.	(5)
	L A T E X style (nothing special here).
	a b 2	and	a b 2	and	a/b 2	and	a b/2	.	(6)
	Exercise 17.1: Compare x + y	2 k+1 with x + y 2/(k+1) . If a fraction is in script style, its numerator
	and denominator are in script script style, i.e. smaller. In T E X, there are four styles and three sizes
	(display style and text style have the same size). In MathML, the size is defined by a level, zero,
	one, or two, but larger levels are possible; thus more than three sizes are possible. There is however
	a minimal font size.
	Exercise 17.2: Compare a+1 b+1 x with ((a + 1)/(b + 1))x.
	Exercise 17.3: Wrong use of \over in	x = (y 2 k + 1)	.
	Exercise 17.4: 7 1 2 ¢, using the \textcent command.
	Exercise 17.5: Same as in the T E Xbook, but not cramped.
	\[n+\scriptstyle n + \scriptscriptstyle n\]
	\[n+{\scriptstyle n + {\scriptscriptstyle n}}\]
	\[a_0+{1\over\displaystyle a_1 +
	{\strut 1\over\displaystyle a_2+
	{\strut 1\over\displaystyle a_3+
	{\strut 1\over a_4}}}}\]
	\[{ {a \over b}\over 2} \qquad \text{and}\qquad { a\over {b\over 2}}
	\qquad \text{and}\qquad { a/ b\over 2} \qquad \text{and}\qquad { a\over b/2} Translation
	\] \[ \frac{\frac{a}{b}}{2} \qquad \text{and}\qquad \frac{a}{\frac{b}{2}} \qquad \text{and}\qquad \frac{a/b}{2} \qquad \text{and}\qquad \frac{a}{b/2} \] 1 a 0 + 1 a 1 + 1 a 2 + 1 a 3 + a 4
										INRIA

n+n+n n +

  INRIAAs mentioned above, a construction like A over B over C needs braces, where over is a generic name for \over and variants, including \choose. Nothing special is required for \frac or \binom, so that L A T E X variant is omitted.

					n k 2	or	n k 2	or	n k/2	or	n 1 2 k
	%%$${1\over2}{n\choose k}$$; $$\displaystyle{n\choose k}\over2}$$ : TeXbook
	$\displaystyle \frac{1}{2}\binom{n}{k}$,
	$\displaystyle{n\choose k}\over \displaystyle 2$,
	$\dfrac{\dbinom{n}{k}}2$.
	{\def\P{\mathchoice{D}{T}{S}{SS}}
	$\displaystyle{\P\choose \P}\P\over \displaystyle \P$,
	$\dfrac{\dbinom{\P}{\P}\P}\P$.}
					n			n
	Exercise 17.6:	1 2	n k	and	k 2 ; L A T E X version	k 2	; version with \P:
								1
								1	12345
	\[ {x\atop y+2}, {n \choose k}, \text{latex},
	\genfrac{}{}{0pt}{}{x}{y+2},\binom{n}{k} \]
	The \atop construction is like \over, without fraction rule; you should not use it in L A T E X, you should
	use \genfrac instead. The command \atopwithdelims (see below for an example) is followed by
	two delimiters, say A and B, it puts A before the fraction and B after it. You can use \genfrac
	with A and B as arguments (third argument is like thickness, fourth argument is style). The \choose
	command is nothing else than \atopwithdelims(). You should not use it.
						x y + 2	,	n k	, latex,	x y + 2	,	n k
	\[{ {n\choose k}\over 2} \text{ or } { n\choose{k\over2} }
	\text{ or } { n\choose k/2} \text{ or } {n\choose{1\over2}k}\]

  a 11 a 12 ... a 1n Exercise 18.26: A sentence where each word is an underlined math formula (text only): This does not always work right. The same, where the \smash is used to hide the depth of the text (all lines vertically aligned): This does not always work right.

					a 21 a 22 ... a 2n . . . . . . . . . . . . a m1 a m2 ... a mn	     	   	y 1 y k . . .	   
	Border matrix 2
	Small matrices 1 1 0 0 and a l	b m	c n . Note that horizontal alignment is only approximative.
	2.3.9. Vertical Spacing
	\def\Limsup{\mathop{\smash\limsup\vphantom\liminf}}
	$\Limsup\limits_3=\limsup\limits_3$
	Compare: limsup 3	= limsup
	\def\undertext#1{$\underline{\hbox{#1}}$}
	\undertext{This} \undertext{does} \undertext{not} \undertext{always}
	\undertext{work} \undertext{right}.
	\def\undertext#1{$\underline{\smash{\hbox{#1}}}$}
	\undertext{This} \undertext{does} \undertext{not} \undertext{always}
	\undertext{work} \undertext{right}.
	$\rm Fe_2^{+2}Cr_2^{\vphantom{+2}}O_4^{\vphantom{+2}}$
	Use of phantoms: Fe +2 2 Cr 2 O 4
	2.3.10. Special features for math hackers
	{\everydisplay{a}\everymath{b} \def\X{x\nonscript\qquad y}
	\[u = \text{ v $w$ }\frac{\X}{\textstyle\X} \]}
					au = v bw	x	xy	y
	2.3.11. Summary
	Exercise 18.30: sin 18 • = 1 4 ( √	5-1).
	Exercise 18.31: k = 1.38 × 10 -16 erg/ • K.

3

! The second index should be lower than the first.

Commands \raise and \lower not yet implemented. Commands \llap and \rlap not yet implemented.

3

Commands \nonscript, \everymath and \everydisplay are OK.

Exercise 18.27: n th from the T E Xbook, n th is L A T E X, and n th is textsuperscript.

Exercise 18.28: S -1 TS = dg(ω 1 , ..., ω n )Λ, uses \mathnormal, no bf lambda? Exercise 18.29: Pr( m = n | m + n = 3 ). 2 Command \bordermatrix not yet implemented 3 Fixme

•

  The current implementation is: if the formula has a label, it has an equation number. It cannot have more than one label/id/equation number. (here 'formula' designates the element that contains the translated math formula). The style sheet computes the equation number via <xsl:number level='any' count='formula[@id]' />.

• What happens if a formula has a tag and a label? Currently the tag is ignored. What we should do is modify the template above (count all formulas with id and without tags), this gives a value if the equation has no tag, and use the value of the tag otherwise. Note that, if you say \tag{x}, this gives (x) as equation number, and \eqref gives this value back. On the other hand, \eqno(x) is equivalent to \tag*{(x)}.

  Translation of \multline is a table, elements are centered, except first, last, and lines using \shoveleft or \shoveright. No & should be given; last line should not be terminated with \\.

	Example 8-2-5. First line of a multline
			Centered Middle line
				A right Middle
			Another centered Middle
		Yet another centered Middle
		A left Middle
			Last line of the multline
	Example 8-2-6. This is the default behavior for tags.
		t	t
			f (t -x) 2 g(y) 2 dx dy
	t∈T	a	a
			a	a
	=		g(y) 2	f (x) 2 dx dy	(2)
	t ∈T	t	t
		t	t
			f (t -x) 2 g(y) 2 dx dy
	t∈T	a	a
			a	a
	=		g(y) 2	f (x) 2 dx dy
	t ∈T	t	t
					23)
	RR n°6181

Same formulas, with \multlinegap set to zero. This has no effect in Tralics

  and an infinite integral:

	H1 H2

Table 1 .

 1 Words in mathematics Vertically extensible symbolsAlso, if ∆ max up = ∆ min down

	\begin{gather}
	\text{Also, if } \Delta_{\text{max up}}
	= \Delta_{\text{min down}} \notag \\
	\text{(for all ups and downs) then} \notag \\
	\Delta_{\text{sum of ups}}
	= \Delta_{\text{sum of downs}}
	\end{gather}
	INRIA

Table 5 .

 5 Symbols of class \mathrel, (arrows, continued)

	* *	+ +	--
	\amalg	* \ast	\baro
	\barwedge	X \bbslash	\bigtriangledown
	\bigtriangleup	\Cap	∩ \cap
	\Cup	∪ \cup	\curlyvee
	\curlywedge	† \dag	† \dagger
	‡ \ddag	‡ \ddagger	\diamond
	\divideontimes	÷ \div	\dotplus
	\doublecap	\doublecup	X \fatbslash
	\fatsemi	X \fatslash	\gtrdot
	\intercal	\interleave	∧ \land
	X \lbag	\leftslice	\leftthreetimes
	\lessdot	∨ \lor	\ltimes
	\merge	X \minuso	X \moo
	∓ \mp	X \nplus	± \pm
	X \rbag	\rightslice	\rightthreetimes
	\rtimes	\setminus	\smallsetminus
	\sqcap	\sqcup	\sslash
	$ \star	\talloblong	× \times
	\triangleleft	\triangleright	\uplus
	\varbigtriangledown	\varbigtriangleup	\varcurlyvee
	\varcurlywedge	× \vartimes	\veebar
	∨ \vee	∧ \wedge	\wr
	X \Ydown	X \Yleft	X \Yright
	X \Yup
	Table 3. Symbols of class \mathbin, miscellaneous
	RR n°6181

Table 6 .

 6 Symbols of class \mathord, Greek

	$ \$	I \Im	R \Re	ℵ \aleph
	k \Bbbk	\beth	\circledS	\complement
	\daleth	\ell	ð \eth	\Finv
	\Game	ג \gimel	\hbar	\hslash
	ı \imath	j \jmath	$ \mathdollar ¶ \mathparagraph
	§ \mathsection £ \mathsterling	\mho	¶ \P
	∂ \partial	£ \pounds	§ \S	℘ \wp
		Table 7. Symbols of class \mathord, letter-shaped
	RR n°6181

Table 11 .

 11 Symbols of class \mathbin, (circles)

	< <	= =	> >	\approxeq
	≈ \approx	\asymp	\backsimeq	\backsim
	\Bumpeq	\bumpeq	\circeq	∼ = \cong
	\curlyeqprec	\curlyeqsucc	\Doteq	\doteqdot
	. = \doteq	\eqcirc	\eqsim	\eqslantgtr
	\eqslantless ≡ \equiv	\fallingdotseq	\geqq
	\geqslant	≥ \geq	≥ \ge	≫ \gggtr
	≫ \ggg	\gg	\gtrapprox	\gtreqless
	\gtreqqless	≷ \gtrless	\gtrsim	X \leftrightarroweq
	\leqq	\leqslant	≤ \leq	\lessapprox
	\lesseqgtr	\lesseqqgtr ≶ \lessgtr	\lesssim
	≤ \le	≪ \llless	≪ \lll	\ll
	\precapprox	\preccurlyeq	\preceq	≺ \prec
	\risingdotseq	\simeq	∼ \sim	\succapprox
	\succcurlyeq	\succeq	\succsim	\succ
	≈ \thickapprox ∼ \thicksim	\triangleq
	Table 12. Symbols of class \mathrel, (equality and order)
	RR n°6181

Table 13 .

 13 Symbols of class \mathrel, (equality and order-negated)

	\blacktriangleleft	\blacktriangleright	\inplus
	∈ \in	\niplus	\ni
	\ntriangleleftsqslant	\ntrianglerightsqslant	\owns
	\sqsubseteq	\sqsubset	\sqsupseteq
	\sqsupset	\Subset	\Supset
	\subseteqq	⊆ \subseteq	X \subsetpluseq
	X \subsetplus	⊂ \subset	\supseteqq
	⊇ \supseteq	X \supsetpluseq	X \supsetplus
	⊃ \supset	\trianglelefteq	\trianglerighteq
	X \trianglerighteqslant X \trianglelefteqslant	\vartriangleleft
	\vartriangleright	X \vartriangle

Table 14 .

 14 Symbols of class \mathrel, (sets and inclusions)

	, ,	• • • \cdots	• • • \hdots	... \ldots	... \mathellipsis
	; ;	: \colon	. . . \ddots	. . . \vdots
	Table 15. Symbols of class \mathpunct, \mathord, \mathinner (punctuation)
					INRIA

Table 17 .

 17 Symbols of class \mathrel, (arrows-negated)X \Arrownot X \Longarrownot X \Mapsfromchar X \Mapstochar X \arrownot X \longarrownot X \mapsfromchar X \mapstochar

	X \lhook	X \not	X \rhook

Table 18 .

 18 Symbols of class \mathrel, (negation and arrow extensions). These are currently unimplemented.

	: :	\backepsilon	∵ \because	\between
	\bowtie	\dashv	\frown	\Join
	| \mid	| = \models	\nmid	∦ \nparallel
	X \nshortmid X \nshortparallel	\nVDash	\nvDash
	\nVdash	\nvdash	\parallel ⊥ \perp
	\pitchfork ∝ \propto	X \shortmid X \shortparallel
	X \smallfrown X \smallsmile	\smile	∴ \therefore
	X \varpropto	\Vdash	| = \vDash	\vdash
	\Vvdash
	Table 19. Symbols of class \mathrel (miscellaneous). Symbols short-foo, small-foo, var-foo not
		implemented.

Table 21 .

 21 Symbol pairs of class \mathopen and \mathclose extensible. \bgroup and \lgroup wrong on HTML, not better in Pdf. Moustaches not good in Pdf.

	XX \llceil\rrceil	& \binampersand\bindnasrepma	XX \Lbag\Rbag
	XX \llfloor\rrfloor	\llparenthesis\rrparenthesis

Table 22 .

 22 Symbol pairs of class \mathopen and \mathclose non-extensible> Lets of symbols missing in Unicode

	ABCDEF GHIJKLM N OP QRST U V W XY Z
	abcdef ghijklmnopqrstuvwxyz
	0123456789
	Table 23. Latin letters and arabic numerals
	INRIA

  Test of italic: AB = c + 1 + 23 , ABCDEFGHIJKLMNOPQRSTUVWXYZ , abcde fghijklm nopqrs tuvwxyz , 0123456789 . Test of bolditalic: AB = c + 1 + 23 , ABCDEFGHIJKLMNOPQRSTUVWXYZ , abcde fghijklm nopqrs tuvwxyz , 0123456789 . Test of script: AB = + + , ABCDEFGHIJKLMNOPQRSTUVWXYZ, {}| \ §, . Test of doublestruck: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789. of boldfraktur: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789. Test of sansserif: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789.

	\Test{sansserifbolditalic}
	\Test{monospace}
	Test of normal: AB = c + 1 + 23, ABCDEF GHIJKLM N OP QRST U V W XY Z, abcde
	f ghijklm nopqrs tuvwxyz, 0123456789.
	Test of upright: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm
	nopqrs tuvwxyz, 0123456789.
	Test of bold: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde
	fghijklm nopqrs tuvwxyz, 0123456789.
	Test of boldscript: AB AB AB = + + , ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ, {}| {}| {}| \ \ \ § § §, .
	Test of fraktur: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm
	nopqrs tuvwxyz, 0123456789.
	Test Test of boldsansserif: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde
	fghijklm nopqrs tuvwxyz, 0123456789.
	Test of sansserifitalic: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm
	nopqrs tuvwxyz, 0123456789.
	Test of sansserifbolditalic: AB AB AB = c c c + 1 1 1 + 23 23 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde abcde abcde
	fghijklm fghijklm fghijklm nopqrs nopqrs nopqrs tuvwxyz tuvwxyz tuvwxyz, 0123456789 0123456789 0123456789.
	$\Lx\La$, $\Lx\Lb$, \Lc, $\Lx\Ld$.}
	\Test{normal}
	\Test{upright}
	\Test{bold}
	\Test{italic}
	\Test{bolditalic}
	\Test{script}
	\Test{boldscript}
	\Test{fraktur}
	\Test{doublestruck}
	\Test{boldfraktur}
	\Test{sansserif}
	\Test{boldsansserif}
	\Test{sansserifitalic}
	RR n°6181

Test of monospace: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789.

  Test of fraktur: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789.Test of doublestruck: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789. of boldfraktur: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789.

	Test Test of sansserif: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs
	tuvwxyz, 0123456789.
	Test of boldsansserif: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde
	fghijklm nopqrs tuvwxyz, 0123456789.
	Test of sansserifitalic: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm
	nopqrs tuvwxyz, 0123456789.
	Test of sansserifbolditalic: A A AB B B = c c c + 1 1 1 + 23 23 23, A A AB B BC C CD D DE E EF F FG G GH H HI I IJ J JK K KL L LM M MN N NO O OP P PQ Q QR R RS S ST T TU U UV V VW W WX X XY Y YZ Z Z, a a ab b bc c cd d de e e
	f f fg g gh h hi i ij j jk k kl l lm m m n n no o op p pq q qr r rs s s t t tu u uv v vw w wx x xy y yz z z, 0123456789 0123456789 0123456789.

Test of monospace: AB = c + 1 + 23, ABCDEFGHIJKLMNOPQRSTUVWXYZ, abcde fghijklm nopqrs tuvwxyz, 0123456789.

We should do something with the optional argument

Translation/rendering of apostrophe not always correct RR n°6181

RR n°6181

Example 8-4-6. Modified, using \xiint, \xiiint, \xiiiint command that produce Unicode character U+222c, U+222D and U+2A0C, or simple integrals.