File: LaTeXML-block.rnc

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 (365 lines) | stat: -rw-r--r-- 11,589 bytes parent folder | download | duplicates (5)
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
# /=====================================================================\ 
# |  LaTeXML-block.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=/

default namespace = "http://dlmf.nist.gov/LaTeXML"

## The block module defines the following `physical' block elements.
Block.class |= 
   p | equation | equationgroup | quote | block | listing
 | itemize | enumerate | description | pagination

## These are inline forms of logical lists
## (they are included in Misc since that has been the general strategy)
Misc.class |=  inline-itemize | inline-enumerate | inline-description

## Additional Metadata that can be present in equations.
EquationMeta.class = constraint

#======================================================================

p =
## A physical paragraph.
element p { p_attributes, p_model }

## Attributes for \elementref{p}.
p_attributes =
  Common.attributes,
  ID.attributes,
  Positionable.attributes,
  Backgroundable.attributes

## Content model for \elementref{p}.
p_model = Inline.model

#======================================================================

constraint = 
## A constraint upon an equation.
element constraint { constraint_attributes, constraint_model }

## Attributes for \elementref{constraint}.
constraint_attributes =
  attribute hidden { xsd:boolean }?,
  Backgroundable.attributes

## Content model for \elementref{constraint}.
constraint_model = Inline.model

#======================================================================

equation =
## An Equation.  The model is just Inline which includes \elementref{Math},
## the main expected ingredient.
## However, other things can end up in display math, too, so we use Inline.
## Note that tabular is here only because it's a common, if misguided, idiom;
## the processor will lift such elements out of math, when possible
element equation { equation_attributes, equation_model }

## Attributes for \elementref{equation}.
equation_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes

## Content model for \elementref{equation}.
equation_model =
  (tags | Math | MathFork  | \text | Misc.class | Meta.class | EquationMeta.class)* 

#======================================================================

equationgroup =
## A group of equations, perhaps aligned (Though this is nowhere recorded).
element equationgroup { equationgroup_attributes, equationgroup_model }

## Attributes for \elementref{equationgroup}.
equationgroup_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes,
  ## the spacing between rows (equations, intertext,...)
  attribute rowsep { Length.type}?

## Content model for \elementref{equationgroup}.
equationgroup_model = (tags | equationgroup | equation | p | Meta.class | EquationMeta.class)*

#======================================================================

MathFork =
## A wrapper for Math that provides alternative,
## but typically less semantically meaningful,
## formatted representations.
## The first child is the meaningful form,
## the extra children provide formatted forms,
## for example being table rows or cells arising from an eqnarray.
element MathFork { MathFork_attributes, MathFork_model }

## Attributes for \elementref{MathFork}.
MathFork_attributes = Common.attributes

## Content model for \elementref{MathFork}.
MathFork_model = (Math|\text), MathBranch*

#======================================================================

MathBranch =
## A container for an alternatively formatted math representation.
element MathBranch { MathBranch_attributes, MathBranch_model }

## Attributes for \elementref{MathBranch}.
MathBranch_attributes =
  Common.attributes,
  attribute format { text }?

## Content model for \elementref{MathBranch}.
MathBranch_model =  (Math|tr|td)*

#======================================================================

quote =
## A quotation.
element quote { quote_attributes, quote_model }

## Attributes for \elementref{quote}.
quote_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes,

  ## The kind of quotation; could be something like verse, or translation
  attribute role { text }?

## Content model for \elementref{quote}.
quote_model = Block.model
# This was Inline.model, but since quotes can be arbitrarily complex
# including equations, etc, not just verse, should be Block.model, perhaps even Para.model?

#======================================================================

block =
## A generic block (fallback).
element block { block_attributes, block_model }

## Attributes for \elementref{block}.
block_attributes =
  Common.attributes,
  ID.attributes,
  Positionable.attributes,
  Backgroundable.attributes

## Content model for \elementref{block}.
block_model = Block.model

#======================================================================

listing =
## An Listing, (without caption: see \elementref{float})
element listing { listing_attributes, listing_model }

## Attributes for \elementref{listing}.
listing_attributes =
  Common.attributes,
  Labelled.attributes,
  Positionable.attributes,
  Backgroundable.attributes,
  Data.attributes

## Content model for \elementref{listing}.
listing_model = listingline*

#======================================================================
listingline =
## a line in a listing
element listingline { listingline_attributes, listingline_model }

## Attributes for \elementref{listingline}
listingline_attributes =
  Common.attributes,
  Labelled.attributes

## Content model for \elementref{listingline}; Inline.model plus equations
listingline_model = tags?, (text | Inline.class | Misc.class | Meta.class | equation | equationgroup  )*

#======================================================================

itemize =
## An itemized list.
element itemize { itemize_attributes, itemize_model }

## Attributes for \elementref{itemize}.
itemize_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{itemize}.
itemize_model = item*

#======================================================================

enumerate =
## An enumerated list.
element enumerate { enumerate_attributes, enumerate_model }

## Attributes for \elementref{enumerate}.
enumerate_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{enumerate}.
enumerate_model = item*

#======================================================================

description =
## A description list. The \elementref{item}s within are expected to have a \elementref{tag}
## which represents the term being described in each \elementref{item}.
element description { description_attributes, description_model }

## Attributes for \elementref{description}.
description_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{description}.
description_model = item*

#======================================================================

item =
## An item within a list (\elementref{itemize},\elementref{enumerate} or \elementref{description}).
element item { item_attributes, item_model }

## Attributes for \elementref{item}.
item_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes,

  ## the vertical spacing between items
  attribute itemsep { Length.type}?

## Content model for \elementref{item}.
item_model =   tags?, Para.model

#======================================================================

inline-itemize =
## An inline form of itemized list.
element inline-itemize { inline-itemize_attributes, inline-itemize_model }

## Attributes for \elementref{inline-itemize}.
inline-itemize_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{inline-itemize}.
inline-itemize_model = inline-item*

#======================================================================

inline-enumerate =
## An inline form of enumerated list.
element inline-enumerate { inline-enumerate_attributes, inline-enumerate_model }

## Attributes for \elementref{inline-enumerate}.
inline-enumerate_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{inline-enumerate}.
inline-enumerate_model = inline-item*

#======================================================================

inline-description =
## An inline form of description list.
## The \elementref{inline-item}s within are expected to have a \elementref{tags}
## which represents the term being described in each \elementref{inline-item}.
element inline-description { inline-description_attributes, inline-description_model }

## Attributes for \elementref{inline-description}.
inline-description_attributes =
  Common.attributes,
  ID.attributes,
  Backgroundable.attributes

## Content model for \elementref{inline-description}.
inline-description_model = inline-item*

#======================================================================

inline-item =
## An item within an inline list (\elementref{inline-itemize},\elementref{inline-enumerate}
## or \elementref{inline-description}).
element inline-item { inline-item_attributes, inline-item_model }

## Attributes for \elementref{item}.
inline-item_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes

## Content model for \elementref{inline-item}.
inline-item_model =   tags?, (Inline.class | Misc.class | Meta.class)*

#======================================================================

tags =
## A container for one or more \elementref{tag}s.
## At most one will have no \attr{role}, which would be the default display.
## Other \elementref{tag} will have the role attribute for use in
## special forms of referencing.
element tags { tags_model }

tags_model = tag+

tag =
## A tag within an item indicating the term or bullet for a given item.
element tag { tag_attributes, tag_model }

## Attributes for \elementref{tag}.
tag_attributes =
  Common.attributes,
  Backgroundable.attributes,

  ## specifies the purpose this tag is used for: no value is default display
  attribute role { text}?,
  
  ## specifies an open delimiters used to display the tag.
  attribute open { text }?,

  ## specifies an close delimiters used to display the tag.
  attribute close { text }?

## Content model for \elementref{tag}.
tag_model = Inline.model

#======================================================================

pagination =
## A page break or related pagination information.
element pagination {  pagination_attributes, pagination_model }

## Attributes for \elementref{pagination}.
pagination_attributes =
  Common.attributes,
  ## what kind of pagination
  attribute role { text }?

## Content model for \elementref{pagination}.
pagination_model = empty

#======================================================================