File: LaTeXML-common.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 (514 lines) | stat: -rw-r--r-- 21,608 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  /=====================================================================\ 
  |  LaTeXML-classes.rnc                                                |
  | Document Type 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 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">
  <!-- Basic element classes: -->
  <define name="Inline.class">
    <a:documentation>All strictly inline elements.</a:documentation>
    <notAllowed/>
  </define>
  <define name="Block.class">
    <a:documentation>All `physical' block elements. 
A physical block is typically displayed as a block, but
may not constitute a complete logical unit.</a:documentation>
    <notAllowed/>
  </define>
  <define name="Misc.class">
    <a:documentation>Additional miscellaneous elements that can appear in
both inline and block contexts.</a:documentation>
    <notAllowed/>
  </define>
  <define name="Para.class">
    <a:documentation>All logical block level elements.
A logical block typically contains one or more physical block elements.
For example, a common situation might be \elementref{p},\elementref{equation},\elementref{p},
where the entire sequence comprises a single sentence.</a:documentation>
    <notAllowed/>
  </define>
  <define name="Meta.class">
    <a:documentation>All metadata elements, typically representing hidden data.</a:documentation>
    <notAllowed/>
  </define>
  <!--
    ======================================================================
    Attribute types
  -->
  <define name="Length.type">
    <a:documentation>The type for attributes specifying a length.
Should be a number followed by a length, typically px.
NOTE: To be narrowed later.</a:documentation>
    <text/>
  </define>
  <define name="Color.type">
    <a:documentation>The type for attributes specifying a color.
NOTE: To be narrowed later.</a:documentation>
    <text/>
  </define>
  <!-- ====================================================================== -->
  <define name="Common.attributes">
    <a:documentation>Attributes shared by ALL elements.</a:documentation>
    <optional>
      <!--
         ## provides for namespace declaration.
         attribute xmlns { text }?,
      -->
      <attribute name="class">
        <a:documentation>a space separated list of tokens, as in CSS.
The \attr{class} can be used to add differentiate different instances of elements
without introducing new element declarations.
However, this generally shouldn't be used for deep semantic distinctions.
This attribute is carried over to HTML and can be used for CSS selection.
[Note that the default XSLT stylesheets for html and xhtml
add the latexml element names to the class of html elements
for more convenience in using CSS.]</a:documentation>
        <data type="NMTOKENS"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="cssstyle">
        <a:documentation>CSS styling rules.
These will only be effective when the target system supports CSS.</a:documentation>
      </attribute>
    </optional>
    <ref name="RDF.attributes"/>
    <optional>
      <attribute name="xml:lang">
        <a:documentation>Language attribute</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="ID.attributes">
    <a:documentation>Attributes for elements that can be cross-referenced
from inside or outside the document.</a:documentation>
    <optional>
      <attribute name="xml:id">
        <a:documentation>the unique identifier of the element, 
usually generated automatically by the latexml.</a:documentation>
        <data type="ID"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="fragid">
        <a:documentation>a "fragment identifier" derived from the \attr{xml:id} 
relative to a page split from the complete document.
This is used internally and may go away some day.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="IDREF.attributes">
    <a:documentation>Attributes for elements that can cross-reference other elements.</a:documentation>
    <optional>
      <attribute name="idref">
        <a:documentation>the identifier of the referred-to element.</a:documentation>
        <data type="IDREF"/>
      </attribute>
    </optional>
  </define>
  <define name="Listable.attributes">
    <a:documentation>Attributes for items that can be put into lists, like index, table of contents.</a:documentation>
    <optional>
      <attribute name="inlist">
        <a:documentation>Records which lists, such as toc=table of contents,..., this object could be listed in.
Space separated set of toc, lof, lot, etc.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Listing.attributes">
    <a:documentation>Attributes for items that create lists, like index, table of contents.</a:documentation>
    <optional>
      <attribute name="lists">
        <a:documentation>Records which lists, such as toc(=table of contents), this object should create a list of.
Space separated set of toc, lof, lot, etc.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Labelled.attributes">
    <a:documentation>Attributes for elements that can be labelled from within LaTeX.
These attributes deal with assigning a label  and generating cross references.
The label migrates to an \attr{xml:id} and \attr{href} and the element
can serve as a hypertext target.</a:documentation>
    <ref name="ID.attributes"/>
    <ref name="Listable.attributes"/>
    <optional>
      <attribute name="labels">
        <a:documentation>Records the various labels that LaTeX uses for crossreferencing.
(note that \cs{label} can associate more than one label with an object!)
It consists of space separated labels for the element.
The \cs{label} macro provides the label prefixed by \texttt{LABEL:};
Spaces in a label are replaced by underscore.
Other mechanisms (like acro?) might use other prefixes (but \texttt{ID:} is reserved!)</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Refable.attributes">
    <a:documentation>Attributes for elements that can be referred to from within LaTeX.
Such elements may serve as the starting point of a hypertext link.
The reference can be made using \attr{label}, \attr{xml:id} or \attr{href};
these attributes will be converted, as needed, from the former to the latter.</a:documentation>
    <ref name="IDREF.attributes"/>
    <optional>
      <attribute name="labelref">
        <a:documentation>reference to a LaTeX labelled object;
See the \attr{labels} attribute of \patternref{Labelled.attributes}.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="href">
        <a:documentation>reference to an arbitrary url.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Fontable.attributes">
    <a:documentation>Attributes for elements that contain (indirectly) text whose font can be specified.</a:documentation>
    <optional>
      <attribute name="font">
        <a:documentation>Indicates the font to use. It consists of a space separated sequence
of values representing the
family (\texttt{serif}, \texttt{sansserif}, \texttt{math}, \texttt{typewriter},
    \texttt{caligraphic}, \texttt{fraktur}, \texttt{script}, \ldots),
series (\texttt{medium}, \texttt{bold}, \ldots),
and shape (\texttt{upright}, \texttt{italic}, \texttt{slanted}, \texttt{smallcaps}, \ldots).
Only the values differing from the current context are given.
Each component is open-ended, for extensibility; it is thus unclear
whether unknown values specify family, series or shape.
In postprocessing, these values are carried to the \attr{class} attribute,
and can thus be effected by CSS.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="fontsize">
        <a:documentation>Indicates the text size to use, as a length, as in CSS.
Normally, this should be a percentage value relative to the containing element.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
  </define>
  <define name="Colorable.attributes">
    <a:documentation>Attributes for elements that draw something, text or otherwise, that can be colored.</a:documentation>
    <optional>
      <attribute name="color">
        <a:documentation>the color to use (for foreground material); any CSS compatible color specification.
In postprocessing, these values are carried to the \attr{class} attribute,
and can thus be effected by CSS.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="opacity">
        <a:documentation>the opacity of foreground material; a number between 0 and 1.</a:documentation>
        <data type="float"/>
      </attribute>
    </optional>
  </define>
  <define name="Backgroundable.attributes">
    <a:documentation>Attributes for elements that take up space and make sense to have a background color.
This is independent of the colors of any things that it may draw.</a:documentation>
    <optional>
      <attribute name="backgroundcolor">
        <a:documentation>the color to use for the background of the element; any CSS compatible color specification.
In postprocessing, these values are carried to the \attr{class} attribute,
and can thus be effected by CSS; the background will presumably
correspond to a bounding rectangle, but is determined by the CSS rendering engine.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Positionable.attributes">
    <a:documentation>Attributes shared by low-level, generic inline and block elements
that can be sized or shifted.</a:documentation>
    <optional>
      <attribute name="width">
        <a:documentation>the desired width of the box</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="height">
        <a:documentation>the desired height of the box</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="depth">
        <a:documentation>the desired depth of the box</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="xoffset">
        <a:documentation>horizontal shift the position of the box.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="yoffset">
        <a:documentation>vertical shift the position of the box.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="align">
        <a:documentation>alignment of material within the box.</a:documentation>
        <choice>
          <value>left</value>
          <value>center</value>
          <value>right</value>
          <value>justified</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="vattach">
        <a:documentation>specifies which line of the box is aligned to the baseline of the containing object.
The default is baseline. </a:documentation>
        <choice>
          <value>top</value>
          <value>middle</value>
          <value>bottom</value>
          <value>baseline</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="float">
        <a:documentation>the horizontal floating placement parameter that determines where the object is displayed.</a:documentation>
        <choice>
          <value>right</value>
          <value>left</value>
          <text/>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="framed">
        <a:documentation>the kind of frame or outline for the box.</a:documentation>
        <choice>
          <value>rectangle</value>
          <value>underline</value>
          <text/>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="framecolor">
        <a:documentation>the color of the frame or outlie for the box.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Transformable.attributes">
    <a:documentation>Attributes shared by (hopefully few) elements that can be transformed.
Such elements should also have Positionable.attributes.
Transformation order of an individual element is assumed to be
translate, scale, rotate; wrap elements to achieve different orders.
Attributes \attr{innerwidth}, \attr{innerheight} and \attr{innerdepth} describe
the size of the contents of the element before transformation;
The result size would be encoded in Positional.attributes.</a:documentation>
    <optional>
      <attribute name="xtranslate">
        <a:documentation>horizontal shift the position of the inner element.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="ytranslate">
        <a:documentation>vertical shift the position of the inner element.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="xscale">
        <a:documentation>horizontal scaling of the inner element.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="yscale">
        <a:documentation>vertical scalign of the inner element.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="angle">
        <a:documentation>the rotation angle, counter-clockwise, in degrees.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="innerwidth">
        <a:documentation>the expected width of the contents of the inner element</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="innerheight">
        <a:documentation>the expected height of the contents of the inner element</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="innerdepth">
        <a:documentation>the expected depth of the contents of the inner element</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
  </define>
  <define name="Imageable.attributes">
    <a:documentation>Attributes for elements that may be converted to image form
during postprocessing, such as math, graphics, pictures, etc.
Note that these attributes are generally not filled in until postprocessing,
but that they could be init</a:documentation>
    <optional>
      <attribute name="imagesrc">
        <a:documentation>the file, possibly generated from other data.</a:documentation>
        <data type="anyURI"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="imagewidth">
        <a:documentation>the width in pixels of \attr{imagesrc}.</a:documentation>
        <data type="nonNegativeInteger"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="imageheight">
        <a:documentation>the height in pixels of \attr{imagesrc}.
Note that, unlike \TeX, this is the total height, including the depth (if any).</a:documentation>
        <data type="nonNegativeInteger"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="imagedepth">
        <a:documentation>the depth in pixels of \attr{imagesrc}, being the location of the
baseline of the content shown in the image.
When displayed inilne, an image with a positive \attr{depth}
should be shifted down relative to the baseline of neighboring material.</a:documentation>
        <data type="integer"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="description">
        <a:documentation>a description of the image</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="RDF.attributes">
    <a:documentation>Attributes for RDFa (Resource Description Framework),
following RDFa Core 1.1 \url{http://www.w3.org/TR/rdfa-syntax/}.
The following descriptions give a short overview of the usage of the attributes,
but see the specification for the complete details, which are sometimes complex.</a:documentation>
    <optional>
      <attribute name="vocab">
        <a:documentation>indicates the default vocabulary
(generally should be managed by LaTeXML and only appear on root node)</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="prefix">
        <a:documentation>specifies a mapping between CURIE prefixes and IRI (URI).
(generally should be managed by LaTeXML and only appear on root node)</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="about">
        <a:documentation>indicates the subject for predicates appearing on the same or descendant nodes.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="aboutlabelref">
        <a:documentation>gives the label for the document element that serves as the subject;
it will be converted to \attr{aboutidref} and \attr{about} during post-processing.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="aboutidref">
        <a:documentation>gives the id for the document element that serves as the subject;
it will be converted to \attr{about} during post-processing.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="resource">
        <a:documentation>indicates the subject for predicates appearing on descendant nodes,
and also indicates the object for predicates
when \attr{property} appears on the same node,
or when \attr{rel} or \attr{rev} appears on an ancestor.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="resourcelabelref">
        <a:documentation>gives the label for the document element that serves as the resource object;
it will be converted to \attr{resourceidref} and \attr{resource} during post-processing.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="resourceidref">
        <a:documentation>gives the id for the document element that serves as the resource object;
it will be converted to \attr{resource} during post-processing.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="property">
        <a:documentation>indicates the predicate and
asserts that the subject is related by that predicate to the object.
The subject is determined by one of \attr{about} on same node,
\attr{resource} or \attr{typeof} on an ancestor node, or by the document root.
The object is determined by one of \attr{resource}, \attr{href}, \attr{content}
or \attr{typeof} on the same node, or by the text content of the node.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="rel">
        <a:documentation>indicates the predicate exactly as \attr{property} except that it can
assert multiple RDF triples where the objects are the nearest descendent \attr{resource}s.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="rev">
        <a:documentation>indicates the predicate exactly as \attr{rel} except that it indicates
the reverse relationship (with subject and object swapped).</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="typeof">
        <a:documentation>indicates the type of the \attr{resource} and thus implicitly asserts a relation
that the object has the given type.
Additionally, if no \attr{resource} was given on the same node,
indicates an anonymous subject and or object exactly as \attr{resource}</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="datatype">
        <a:documentation>indicates the datatype of the target resource;</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="content">
        <a:documentation>indicates the content of the property to be used as the object,
to be used instead of the content of the element itself;</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="Data.attributes">
    <a:documentation>Attributes for raw data storage</a:documentation>
    <optional>
      <attribute name="data">
        <a:documentation>the data itself</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="datamimetype">
        <a:documentation>the MIME type of the data</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="dataencoding">
        <a:documentation>the encoding of the data (either empty, base64, or )</a:documentation>
      </attribute>
    </optional>
  </define>
</grammar>