File: sampler.tex

package info (click to toggle)
latexml 0.8.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,920 kB
  • sloc: xml: 109,048; perl: 30,224; sh: 179; javascript: 28; makefile: 13
file content (227 lines) | stat: -rw-r--r-- 6,151 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{graphicx}
\newcommand{\mml}[1]{\texttt{m:#1}}
\newcommand{\attr}[1]{\texttt{@#1}}
%\newcommand{\mathsized}[2]{\scalebox{#1}{#2}}
\newcommand{\mathsized}[2]{\mbox{#1 $#2$}}
\title{LaTeXML Math Sampler}
\begin{document}
This document is a sampler of the kind of MathML produced by LaTeXML,
primarily for testing for sufficient MathML support.
It is \emph{not} a comprehensive test, nor a torture test.

% m:math, @display


The \mml{semantics}, \mml{annotation}, and \mml{annotation-xml} elements
will be exercised if you generate both presentation and content during post-processing
using the \verb|--pmml --cmml| options.
%m:semantics
%m:annotation, @encoding
%m:annotation-xml, @encoding


\section{Token Elements}
Token elements \mml{mi}, \mml{mo} and \mml{mn}, with various
attributes \attr{mathvariant}, \attr{mathsize} and \attr{class}.
% m:mo, m:mi, m:mn,
%   @mathvariant,
%   @minsize, @maxsize, @mathsize, @stretchy,
%   @mathcolor, @mathbackground,
%  @class = ltx_font_mathcaligraphic | ltx_font_mathscript | ltx_font_oldstyle | ltx_font_smallcaps
\begin{equation}
 A,\qquad
 \mathnormal{A},\qquad
 \mathrm{A},\qquad
 \mathit{A},\qquad
 \mathbf{A},\qquad
 \mathsf{A},\qquad
 \mathtt{A},
\end{equation}
\begin{equation}
 \mathcal{A},\qquad
 \mathscr{A},\qquad
 \mathbb{A},\qquad
 \mathfrak{A}
\end{equation}
\begin{equation}
 \mathsized{\tiny}{X},\qquad
 \mathsized{\scriptsize}{X},\qquad
 \mathsized{\normalsize}{X},\qquad
 \mathsized{\large}{X},\qquad
 \mathsized{\Large}{X},\qquad
 \mathsized{\LARGE}{X},\qquad
 \mathsized{\huge}{X},\qquad
 \mathsized{\Huge}{X}
\end{equation}

And some color, \attr{mathcolor}, \attr{mathbackground}:
\begin{equation}
  {\color{red} X}, \qquad
  {\color{blue} X}, \qquad
  {\color{green} X}, \qquad
  \fcolorbox{blue}{red}{\textcolor{green}{X}}
\end{equation}

Playing with \attr{minsize}, \attr{maxsize}, \attr{stretchy}:
% m:mi, @fence, @separator, @largeop, @symmetric, @lspace, @rspace, @movablelimits
\begin{equation}
 (a|b),\qquad
 \bigl(a\bigm|b\bigr),\qquad
 \Bigl(a\Bigm|b\Bigr),\qquad
 \biggl(a\biggm|b\biggr),\qquad
 \Biggl(a\Biggm|b\Biggr)
\end{equation}

\begin{equation}
\left( a^{b}  \middle| x \right),\qquad
\left( a^{b^{c}} \middle| x \right),\qquad
\left( a^{b^{c^{d}}} \middle| x \right)
\end{equation}

% m:mtext
% m:mspace, @width
\begin{equation}
 \mbox{Hello} + y - 1.2345
\end{equation}
Some spacing \mml{mspace}.
\begin{equation}
  xy,\qquad
  x \hspace{1em} y,\qquad
  x \hspace{2em} y
\end{equation}
% m:mglyph not used
% m:ms not used
Not used: \mml{mglyph}, \mml{ms}.

\section{General Layout Schemata}
Various layout schemata \mml{mrow}, \mml{mfrac} (with various \attr{linethickness}),
and \mml{mstyle}:
%m:mrow
% m:mfrac, @linethickness
\begin{equation}
 \frac{a}{b},\qquad
 \tfrac{a}{b},\qquad
 \dfrac{a}{b}
\end{equation}
\begin{equation}
 \binom{a}{b}
 \genfrac{}{}{0.0ex}{}{a}{b},\qquad
 \genfrac{}{}{0.01ex}{}{a}{b},\qquad
 \genfrac{}{}{0.1ex}{}{a}{b},\qquad
 \genfrac{}{}{1ex}{}{a}{b}
\end{equation}
\begin{equation}
 \genfrac{(}{)}{}{}{a}{b},\qquad
 \genfrac{(}{)}{}{}{a^2}{b^2},\qquad
 \genfrac{(}{)}{}{}{\int_a^b f(x)dx}{\int_a^b g(x)dx}
\end{equation}

Roots \mml{msqrt} and \mml{mroot}, as well as enclosures \mml{menclose}:
% m:msqrt, m:mroot
% m:menclose, @notation
\begin{equation}
 \sqrt{x},\qquad
 \sqrt[3]{x},\qquad
 \root 3 \of {x},\qquad
 \boxed{x^2},\qquad
 \not{?}
\end{equation}

% m:mstyle, @displaystyle, @scriptlevel
% m:merror

More spacing examples with \mml{mpadded}:
% m:mpadded, @lspace, @width
\begin{equation}
  a+b, \qquad
  a \,+\, b, \qquad
  a \>+\> b, \qquad
  a \;+\; b, \qquad
\end{equation}
% m:phantom
\begin{eqnarray}
  X &=& f(x) + g(x) + h(x) \\
    &=& f(x) + \phantom{g(x)} + h(x) \\
\end{eqnarray}
%% m:mfenced, @open, @close [not really used]

Not used: \mml{mfenced}, \mml{mphantom};
used only for errors: \mml{merror}.

\section{Script and Limit Schemata}
A variety of sub- and super-scripts (\mml{msub}, \mml{msup}, \mml{msubsup}),
under- and over-scripts (\mml{munder}, \mml{mover}, \mml{munderover}),
some as accents, and pre-scripts (\mml{multiscripts}, \mml{mprescripts}).
% m:sub, m:sup, m:subsup

\begin{equation}
 a^{b},\qquad
 a^{b^{c}},\qquad
 a^{b^{c^{d}}},\qquad
 a_{b},\qquad
 a_{b_{c}},\qquad
 a_{b_{c_ {d}}},\qquad
 a^{b}_{c}
\end{equation}

% m:under, m:over, m:underover
\begin{equation}
 \sum^{b},\qquad
 \sum_{b},\qquad
 \sum^{b}_{c}
\end{equation}
\begin{equation}
X = \sum_{1\le i \le j \le n} X_{ij},\qquad
X = \sum_{\mathclap{1\le i \le j \le n}} X_{ij},\qquad
%X = \smashoperator{\sum_{1\le i \le j \le n}} X_{ij},\qquad
X = \smashoperator[r]{\sum_{1\le i \le j \le n}} X_{ij},\qquad
X = \smashoperator[l]{\sum_{1\le i \le j \le n}} X_{ij}
\end{equation}

\begin{equation}
 a \overset{\mathrm{def}}{\rightarrow} b, \qquad
 a \underset{\mathrm{def}}{\rightarrow} b,\qquad
 a \overrightarrow{\mathrm{def}} b,\qquad
 a \underrightarrow{\mathrm{def}} b
\end{equation}

% m:multiscripts, m:prescripts, m:none
\begin{equation}
 {}_p F_q,\qquad
 \sideset{_a^b}{^c_d}{\sum}
\end{equation}

\section{Tabular Math}
Some basic tabular math (\mml{mtable}, \mml{mtr}, \mml{mtd});
many combinations of row and column spacing and spans
(\attr{rowspacing}, \attr{columnspacing}, \attr{columnspan}, \attr{rowspan})
are not currently tested.
%m:mtable, @rowspacing, @columnspacing, @width
%m:mtr
%m:mtd, @columnalign, @columnspan, @rowspan

\begin{equation}
  \begin{matrix} -1 & 3 \\ 2 & -4 \end{matrix}
,\qquad
  \begin{matrix*}[r] -1 & 3 \\ 2 & -4 \end{matrix*}
,\qquad
  \begin{Vmatrix} -1 & 3 \\ 2 & -4 \end{Vmatrix}
,\qquad
  \begin{Vmatrix*}[r] -1 & 3 \\ 2 & -4 \end{Vmatrix*}
\end{equation}
% m:mlabeledtr, m:maligngroup, m:malignmark not used
Not used: \mml{mlabeledtr}, \mml{maligngroup}, \mml{malignmark}.

\section{Elementary Math}
% m:mstack, m:mlongdiv, m:msgroup, m:msrow,
% m:mscarries, m:mscarry, m:msline not used
Not currently used:
\mml{mstack}, \mml{mlongdiv}, \mml{msgroup}, \mml{msrow},
\mml{mscarries}, \mml{mscarry}, \mml{msline}.
\end{document}