File: LaTeXML-math.rng

package info (click to toggle)
latexml 0.8.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,120 kB
  • sloc: xml: 85,800; perl: 27,488; sh: 245; javascript: 26; makefile: 13
file content (519 lines) | stat: -rw-r--r-- 20,270 bytes parent folder | download | duplicates (4)
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<?xml version="1.0" encoding="UTF-8"?>
<!--
  /=====================================================================\
  |  LaTeXML-math.rnc                                                   |
  | RelaxNG model for LaTeXML generated documents                       |
  |=====================================================================|
  | Part of LaTeXML:                                                    |
  |  Public domain software, produced as part of work done by the       |
  |  United States Government & not subject to copyright in the US.     |
  |=====================================================================|
  | Bruce Miller <bruce.miller@nist.gov>                        #_#     |
  | http://dlmf.nist.gov/LaTeXML/                              (o o)    |
  \=========================================================ooo==U==ooo=/
-->
<grammar ns="http://dlmf.nist.gov/LaTeXML" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="Inline.class" combine="choice">
    <a:documentation>The math module defines LaTeXML's internal representation of mathematical
content, including the basic math container \elementref{Math}.  This element is
considered inline, as it will be contained within some other block-level
element, eg. \elementref{equation} for display-math.</a:documentation>
    <ref name="Math"/>
  </define>
  <define name="Math.class">
    <a:documentation>This class defines the content of the \elementref{Math} element.
Additionally, it could contain MathML or OpenMath, after postprocessing.</a:documentation>
    <ref name="XMath"/>
  </define>
  <define name="XMath.class">
    <a:documentation>These elements comprise the internal math representation, being
the content of the \elementref{XMath} element.</a:documentation>
    <choice>
      <ref name="XMApp"/>
      <ref name="XMTok"/>
      <ref name="XMRef"/>
      <ref name="XMHint"/>
      <ref name="XMArg"/>
      <ref name="XMWrap"/>
      <ref name="XMDual"/>
      <ref name="XMText"/>
      <ref name="XMArray"/>
      <ref name="ERROR"/>
    </choice>
  </define>
  <!-- ====================================================================== -->
  <define name="Math">
    <element name="Math">
      <a:documentation>Outer container for all math. This holds the internal
\elementref{XMath} representation, as well as image data and other representations.</a:documentation>
      <ref name="Math_attributes"/>
      <ref name="Math_model"/>
    </element>
  </define>
  <define name="Math_attributes">
    <a:documentation>Attributes for \elementref{Math}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Imageable.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <optional>
      <attribute name="mode">
        <a:documentation>display or inline mode.</a:documentation>
        <choice>
          <value>display</value>
          <value>inline</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="tex">
        <a:documentation>reconstruction of the \TeX\ that generated the math.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="content-tex">
        <a:documentation>more semantic version of \attr{tex}.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="text">
        <a:documentation>a textified representation of the math.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="lexemes">
        <a:documentation>preserved grammar-near lexemes for export to external apps</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Math_model">
    <a:documentation>Content model for \elementref{Math}.</a:documentation>
    <zeroOrMore>
      <ref name="Math.class"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMath.attributes">
    <a:documentation>Common attributes for the various XMath elements.</a:documentation>
    <ref name="Positionable.attributes"/>
    <optional>
      <attribute name="role">
        <a:documentation>The role that this item plays in the Grammar.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="enclose">
        <a:documentation>an enclose style to enclose the object
with legitimate values being those of MathML's menclose notations;</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="lpadding">
        <a:documentation>left, or leading, (presumably non-semantic) padding space.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="rpadding">
        <a:documentation>right, or trailing, (presumably non-semantic) padding space.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="name">
        <a:documentation>The name of the token, typically the control sequence that created it.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="meaning">
        <a:documentation>A more semantic name corresponding to the intended meaning,
such as the OpenMath name.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="omcd">
        <a:documentation>The OpenMath CD for which \attr{meaning} is a symbol.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="scriptpos">
        <a:documentation>An encoding of the position of sub/superscripts
Before parsing, it takes two forms. On a base token or element,
it is one of (pre|mid|post), indicating where any script can be placed.
On a script token, it is an integer level.
After parsing, the concatenation is moved to the sub|super-script "operator".</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="possibleFunction">
        <a:documentation>an annotation placed by the parser when it suspects this token may be used as a function.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="decl_id">
        <a:documentation>an id to where the declaration of this object is given,
preferably the xml:id of an ltx:declare</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="href">
        <a:documentation>reference to an arbitrary url.</a:documentation>
      </attribute>
    </optional>
  </define>
  <!-- ====================================================================== -->
  <define name="XMath">
    <element name="XMath">
      <a:documentation>Internal representation of mathematics.</a:documentation>
      <ref name="XMath_attributes"/>
      <ref name="XMath_model"/>
    </element>
  </define>
  <define name="XMath_attributes">
    <a:documentation>Attributes for \elementref{XMath}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="XMath_model">
    <a:documentation>Content model for \elementref{XMath}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMTok">
    <element name="XMTok">
      <a:documentation>General mathematical token.</a:documentation>
      <ref name="XMTok_attributes"/>
      <ref name="XMTok_model"/>
    </element>
  </define>
  <define name="XMTok_attributes">
    <a:documentation>Attributes for \elementref{XMTok}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <optional>
      <attribute name="thickness">
        <a:documentation>A thickness used for drawing any lines which are part of presenting the token,
such as the fraction line for the fraction operator.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="stretchy">
        <a:documentation>Whether or not the symbol should be stretchy.
This shares MathML's ambiguity about horizontal versus vertical stretchiness.
When not set, defaults to whatever MathML's operator dictionary says.</a:documentation>
        <data type="boolean"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="mathstyle">
        <a:documentation>The math style used for displaying the application of this token
when it represents some sort of fraction, variable-sized operator or stack of expressions
(note that this applies to binomials or other stacks of expressions as well as fractions).
Values of \texttt{display} or \texttt{text} correspond to \TeX's
displaystyle or textstyle, while \texttt{inline} indicates the
stack should be arranged horizontally (the layout may depend on the operator).</a:documentation>
        <choice>
          <value>display</value>
          <value>text</value>
          <value>script</value>
          <value>scriptscript</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="XMTok_model">
    <a:documentation>Content model for \elementref{XMTok}.</a:documentation>
    <zeroOrMore>
      <text/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMApp">
    <element name="XMApp">
      <a:documentation>Generalized application of a function, operator, whatever (the first child)
to arguments (the remaining children).
The attributes are a subset of those for \elementref{XMTok}.</a:documentation>
      <ref name="XMApp_attributes"/>
      <ref name="XMApp_model"/>
    </element>
  </define>
  <define name="XMApp_attributes">
    <a:documentation>Attributes for \elementref{XMApp}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
  </define>
  <define name="XMApp_model">
    <a:documentation>Content model for \elementref{XMApp}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMDual">
    <element name="XMDual">
      <a:documentation>Parallel markup of content (first child) and presentation (second child)
of a mathematical object.
Typically, the arguments are shared between the two branches:
they appear in the content branch, with \attr{id}'s,
and \elementref{XMRef} is used in the presentation branch</a:documentation>
      <ref name="XMDual_attributes"/>
      <ref name="XMDual_model"/>
    </element>
  </define>
  <define name="XMDual_attributes">
    <a:documentation>Attributes for \elementref{XMDual}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="XMDual_model">
    <a:documentation>Content model for \elementref{XMDual}.</a:documentation>
    <ref name="XMath.class"/>
    <ref name="XMath.class"/>
  </define>
  <!-- ====================================================================== -->
  <define name="XMHint">
    <element name="XMHint">
      <a:documentation>Various layout hints, usually spacing, generally ignored in parsing.
The attributes are a subset of those for \elementref{XMTok}.</a:documentation>
      <ref name="XMHint_attributes"/>
      <ref name="XMHint_model"/>
    </element>
  </define>
  <define name="XMHint_attributes">
    <a:documentation>Attributes for \elementref{XMHint}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="XMHint_model">
    <a:documentation>Content model for \elementref{XMHint}.</a:documentation>
    <empty/>
  </define>
  <!-- ====================================================================== -->
  <define name="XMText">
    <element name="XMText">
      <a:documentation>Text appearing within math.</a:documentation>
      <ref name="XMText_attributes"/>
      <ref name="XMText_model"/>
    </element>
  </define>
  <define name="XMText_attributes">
    <a:documentation>Attributes for \elementref{XMText}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="XMText_model">
    <a:documentation>Content model for \elementref{XMText}.</a:documentation>
    <zeroOrMore>
      <choice>
        <text/>
        <ref name="Inline.class"/>
        <ref name="Misc.class"/>
      </choice>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMWrap">
    <element name="XMWrap">
      <a:documentation>Wrapper for a sequence of tokens used to assert the role of the
contents in its parent. This element generally disappears after parsing.
The attributes are a subset of those for \elementref{XMTok}.</a:documentation>
      <ref name="XMWrap_attributes"/>
      <ref name="XMWrap_model"/>
    </element>
  </define>
  <define name="XMWrap_attributes">
    <a:documentation>Attributes for \elementref{XMWrap}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <ref name="ID.attributes"/>
    <optional>
      <attribute name="rule">
        <a:documentation>The grammatical rule that should apply to the contained sequence</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="style"/>
    </optional>
  </define>
  <define name="XMWrap_model">
    <a:documentation>Content model for \elementref{XMWrap}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMArg">
    <element name="XMArg">
      <a:documentation>Wrapper for an argument to a structured macro.
It implies that its content can be parsed independently of its parent,
and thus generally disappears after parsing.</a:documentation>
      <ref name="XMArg_attributes"/>
      <ref name="XMArg_model"/>
    </element>
  </define>
  <define name="XMArg_attributes">
    <a:documentation>Attributes for \elementref{XMArg}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
    <optional>
      <attribute name="rule">
        <a:documentation>The grammatical rule that should apply to the contained sequence</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="XMArg_model">
    <a:documentation>Content model for \elementref{XMArg}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMRef">
    <element name="XMRef">
      <a:documentation>Structure sharing element typically used in the presentation
branch of an \elementref{XMDual} to refer to the arguments present in the content branch.</a:documentation>
      <ref name="XMRef_attributes"/>
      <ref name="XMRef_model"/>
    </element>
  </define>
  <define name="XMRef_attributes">
    <a:documentation>Attributes for \elementref{XMRef}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="IDREF.attributes"/>
  </define>
  <define name="XMRef_model">
    <a:documentation>Content model for \elementref{XMRef}.</a:documentation>
    <empty/>
  </define>
  <!-- ====================================================================== -->
  <define name="XMArray">
    <!-- The attributes are a subset of those for \elementref{XMTok} or of \elementref{tabular}. -->
    <element name="XMArray">
      <a:documentation>Math Array/Alignment structure.</a:documentation>
      <ref name="XMArray_attributes"/>
      <ref name="XMArray_model"/>
    </element>
  </define>
  <define name="XMArray_attributes">
    <a:documentation>Attributes for \elementref{XMArray}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="XMath.attributes"/>
    <ref name="ID.attributes"/>
    <optional>
      <attribute name="rowsep">
        <a:documentation>the spacing between rows</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="colsep">
        <a:documentation>the spacing between columns</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
  </define>
  <define name="XMArray_model">
    <a:documentation>Content model for \elementref{XMArray}.</a:documentation>
    <zeroOrMore>
      <ref name="XMRow"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMRow">
    <element name="XMRow">
      <a:documentation>A row in a math alignment.</a:documentation>
      <ref name="XMRow_attributes"/>
      <ref name="XMRow_model"/>
    </element>
  </define>
  <define name="XMRow_attributes">
    <a:documentation>Attributes for \elementref{XMRow}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="XMRow_model">
    <a:documentation>Content model for \elementref{XMRow}.</a:documentation>
    <zeroOrMore>
      <ref name="XMCell"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="XMCell">
    <element name="XMCell">
      <a:documentation>A cell in a row of a math alignment.</a:documentation>
      <ref name="XMCell_attributes"/>
      <ref name="XMCell_model"/>
    </element>
  </define>
  <define name="XMCell_attributes">
    <a:documentation>Attributes for \elementref{XMCell}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <ref name="ID.attributes"/>
    <optional>
      <attribute name="colspan">
        <a:documentation>indicates how many columns this cell spans or covers.</a:documentation>
        <data type="nonNegativeInteger"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="rowspan">
        <a:documentation>indicates how many rows this cell spans or covers.</a:documentation>
        <data type="nonNegativeInteger"/>
      </attribute>
    </optional>
    <optional>
      <!--
        This would have been clearer, but messes up conversion to dtd
         attribute align { "left" | "right" | "center" | "justify" | text }?,
      -->
      <attribute name="align">
        <a:documentation> specifies the alignment of the content.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="width">
        <a:documentation>specifies the desired width for the column.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="border">
        <a:documentation>records a sequence of t or tt, r or rr, b or bb and l or ll
for borders or doubled borders on any side of the cell.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="thead">
        <a:documentation>whether this cell corresponds to a table row or column heading or both</a:documentation>
        <choice>
          <value>column</value>
          <value>column row</value>
          <value>row</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="XMCell_model">
    <a:documentation>Content model for \elementref{XMCell}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
</grammar>
<!-- ====================================================================== -->