summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rnc/LaTeXML/LaTeXML-math.rng
blob: c9e3babe837552b612c85fd7490e9b0ff7b7a7c6 (plain)
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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
<?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"/>
    </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"/>
    <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>
  </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">
    <optional>
      <attribute name="role">
        <a:documentation>The role that this item plays in the Grammar.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="open">
        <a:documentation>an open delimiter to enclose the object;</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="close">
        <a:documentation>an close delimiter to enclose the object;</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="argopen">
        <a:documentation>an open delimiter to enclose the argument list,
when this token is applied to arguments with \elementref{XMApp}.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="argclose">
        <a:documentation>a close delimiter to enclose the argument list,
when this token is applied to arguments with \elementref{XMApp}.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="separators">
        <a:documentation>characters to separate arguments,
when this token is applied to arguments with \elementref{XMApp}.
Can be multiple characters for different argument positions;
the last character is repeated if there aren't enough.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="punctuation">
        <a:documentation>trailing (presumably non-semantic) punctuation.</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>
  </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"/>
  </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"/>
    <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="style">
        <a:documentation>Various random styling information. NOTE This needs to be made consistent.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="font">
        <a:documentation>The font, size a used for the symbol.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="size">
        <a:documentation>The size for the symbol, not presumed to be meaningful(?)</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="color">
        <a:documentation>The color (CSS format) for the symbol, not presumed to be meaningful(?)</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="scriptpos">
        <a:documentation>An encoding of the position of this token as a sub/superscript, used
to handle aligned and nested scripts, both pre and post.
It is a concatenation of (pre|mid|post), which indicates the horizontal
positioning of the script with relation to it's base, and a counter
indicating the level. These are used to position the scripts, 
and to pair up aligned sub- and superscripts.
NOTE: Clarify where this appears: token, base, script operator, apply?</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="thickness">
        <a:documentation>NOTE: How is this used?</a:documentation>
      </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"/>
    <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="scriptpos">
        <a:documentation>An encoding of the position of this token as a sub/superscript, used
to handle aligned and nested scripts, both pre and post.
(See \elementref{XMTok} for details)</a:documentation>
      </attribute>
    </optional>
  </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 spacing items, 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"/>
    <optional>
      <attribute name="name"/>
    </optional>
    <optional>
      <attribute name="meaning"/>
    </optional>
    <optional>
      <attribute name="style"/>
    </optional>
  </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="ID.attributes"/>
    <optional>
      <attribute name="scriptpos">
        <a:documentation>An encoding of the position of this token as a sub/superscript, used
to handle aligned and nested scripts, both pre and post.
(See \elementref{XMTok} for details)</a:documentation>
      </attribute>
    </optional>
  </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="ID.attributes"/>
    <optional>
      <attribute name="name"/>
    </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="style"/>
    </optional>
    <optional>
      <attribute name="scriptpos">
        <a:documentation>An encoding of the position of this token as a sub/superscript, used
to handle aligned and nested scripts, both pre and post.
(See \elementref{XMTok} for details)</a:documentation>
      </attribute>
    </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"/>
    </optional>
    <optional>
      <attribute name="scriptpos">
        <a:documentation>An encoding of the position of this token as a sub/superscript, used
to handle aligned and nested scripts, both pre and post.
(See \elementref{XMTok} for details)</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="name"/>
    </optional>
    <optional>
      <attribute name="meaning"/>
    </optional>
    <optional>
      <attribute name="style"/>
    </optional>
    <optional>
      <attribute name="vattach">
        <choice>
          <value>top</value>
          <value>bottom</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="width"/>
    </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"/>
  </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"/>
    <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="rowpan">
        <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 head or foot.</a:documentation>
        <data type="boolean"/>
      </attribute>
    </optional>
  </define>
  <define name="XMCell_model">
    <a:documentation>Content model for \elementref{XMCell}.</a:documentation>
    <zeroOrMore>
      <ref name="XMath.class"/>
    </zeroOrMore>
  </define>
</grammar>
<!-- ====================================================================== -->