1# /=====================================================================\
2# |  LaTeXML-block.rnc                                                  |
3# | RelaxNG model for LaTeXML generated documents                       |
4# |=====================================================================|
5# | Part of LaTeXML:                                                    |
6# |  Public domain software, produced as part of work done by the       |
7# |  United States Government & not subject to copyright in the US.     |
8# |=====================================================================|
9# | Bruce Miller <bruce.miller@nist.gov>                        #_#     |
10# | http://dlmf.nist.gov/LaTeXML/                              (o o)    |
11# \=========================================================ooo==U==ooo=/
12
13default namespace = "http://dlmf.nist.gov/LaTeXML"
14
15## The block module defines the following `physical' block elements.
16Block.class |=
17   p | equation | equationgroup | quote | block | listing
18 | itemize | enumerate | description | pagination
19
20## These are inline forms of logical lists
21## (they are included in Misc since that has been the general strategy)
22Misc.class |=  inline-itemize | inline-enumerate | inline-description
23
24## Additional Metadata that can be present in equations.
25EquationMeta.class = constraint
26
27#======================================================================
28
29p =
30## A physical paragraph.
31element p { p_attributes, p_model }
32
33## Attributes for \elementref{p}.
34p_attributes =
35  Common.attributes,
36  ID.attributes,
37  Positionable.attributes,
38  Backgroundable.attributes
39
40## Content model for \elementref{p}.
41p_model = Inline.model
42
43#======================================================================
44
45constraint =
46## A constraint upon an equation.
47element constraint { constraint_attributes, constraint_model }
48
49## Attributes for \elementref{constraint}.
50constraint_attributes =
51  attribute hidden { xsd:boolean }?,
52  Backgroundable.attributes
53
54## Content model for \elementref{constraint}.
55constraint_model = Inline.model
56
57#======================================================================
58
59equation =
60## An Equation.  The model is just Inline which includes \elementref{Math},
61## the main expected ingredient.
62## However, other things can end up in display math, too, so we use Inline.
63## Note that tabular is here only because it's a common, if misguided, idiom;
64## the processor will lift such elements out of math, when possible
65element equation { equation_attributes, equation_model }
66
67## Attributes for \elementref{equation}.
68equation_attributes =
69  Common.attributes,
70  Labelled.attributes,
71  Backgroundable.attributes
72
73## Content model for \elementref{equation}.
74equation_model =
75  (tags | Math | MathFork  | \text | Misc.class | Meta.class | EquationMeta.class)*
76
77#======================================================================
78
79equationgroup =
80## A group of equations, perhaps aligned (Though this is nowhere recorded).
81element equationgroup { equationgroup_attributes, equationgroup_model }
82
83## Attributes for \elementref{equationgroup}.
84equationgroup_attributes =
85  Common.attributes,
86  Labelled.attributes,
87  Backgroundable.attributes,
88  ## the spacing between rows (equations, intertext,...)
89  attribute rowsep { Length.type}?
90
91## Content model for \elementref{equationgroup}.
92equationgroup_model = (tags | equationgroup | equation | p | Meta.class | EquationMeta.class)*
93
94#======================================================================
95
96MathFork =
97## A wrapper for Math that provides alternative,
98## but typically less semantically meaningful,
99## formatted representations.
100## The first child is the meaningful form,
101## the extra children provide formatted forms,
102## for example being table rows or cells arising from an eqnarray.
103element MathFork { MathFork_attributes, MathFork_model }
104
105## Attributes for \elementref{MathFork}.
106MathFork_attributes = Common.attributes
107
108## Content model for \elementref{MathFork}.
109MathFork_model = (Math|\text), MathBranch*
110
111#======================================================================
112
113MathBranch =
114## A container for an alternatively formatted math representation.
115element MathBranch { MathBranch_attributes, MathBranch_model }
116
117## Attributes for \elementref{MathBranch}.
118MathBranch_attributes =
119  Common.attributes,
120  attribute format { text }?
121
122## Content model for \elementref{MathBranch}.
123MathBranch_model =  (Math|tr|td)*
124
125#======================================================================
126
127quote =
128## A quotation.
129element quote { quote_attributes, quote_model }
130
131## Attributes for \elementref{quote}.
132quote_attributes =
133  Common.attributes,
134  ID.attributes,
135  Backgroundable.attributes,
136
137  ## The kind of quotation; could be something like verse, or translation
138  attribute role { text }?
139
140## Content model for \elementref{quote}.
141quote_model = Block.model
142# This was Inline.model, but since quotes can be arbitrarily complex
143# including equations, etc, not just verse, should be Block.model, perhaps even Para.model?
144
145#======================================================================
146
147block =
148## A generic block (fallback).
149element block { block_attributes, block_model }
150
151## Attributes for \elementref{block}.
152block_attributes =
153  Common.attributes,
154  ID.attributes,
155  Positionable.attributes,
156  Backgroundable.attributes
157
158## Content model for \elementref{block}.
159block_model = Block.model
160
161#======================================================================
162
163listing =
164## An Listing, (without caption: see \elementref{float})
165element listing { listing_attributes, listing_model }
166
167## Attributes for \elementref{listing}.
168listing_attributes =
169  Common.attributes,
170  Labelled.attributes,
171  Positionable.attributes,
172  Backgroundable.attributes,
173  Data.attributes
174
175## Content model for \elementref{listing}.
176listing_model = listingline*
177
178#======================================================================
179listingline =
180## a line in a listing
181element listingline { listingline_attributes, listingline_model }
182
183## Attributes for \elementref{listingline}
184listingline_attributes =
185  Common.attributes,
186  Labelled.attributes
187
188## Content model for \elementref{listingline}; Inline.model plus equations
189listingline_model = tags?, (text | Inline.class | Misc.class | Meta.class | equation | equationgroup  )*
190
191#======================================================================
192
193itemize =
194## An itemized list.
195element itemize { itemize_attributes, itemize_model }
196
197## Attributes for \elementref{itemize}.
198itemize_attributes =
199  Common.attributes,
200  ID.attributes,
201  Backgroundable.attributes
202
203## Content model for \elementref{itemize}.
204itemize_model = item*
205
206#======================================================================
207
208enumerate =
209## An enumerated list.
210element enumerate { enumerate_attributes, enumerate_model }
211
212## Attributes for \elementref{enumerate}.
213enumerate_attributes =
214  Common.attributes,
215  ID.attributes,
216  Backgroundable.attributes
217
218## Content model for \elementref{enumerate}.
219enumerate_model = item*
220
221#======================================================================
222
223description =
224## A description list. The \elementref{item}s within are expected to have a \elementref{tag}
225## which represents the term being described in each \elementref{item}.
226element description { description_attributes, description_model }
227
228## Attributes for \elementref{description}.
229description_attributes =
230  Common.attributes,
231  ID.attributes,
232  Backgroundable.attributes
233
234## Content model for \elementref{description}.
235description_model = item*
236
237#======================================================================
238
239item =
240## An item within a list (\elementref{itemize},\elementref{enumerate} or \elementref{description}).
241element item { item_attributes, item_model }
242
243## Attributes for \elementref{item}.
244item_attributes =
245  Common.attributes,
246  Labelled.attributes,
247  Backgroundable.attributes,
248
249  ## the vertical spacing between items
250  attribute itemsep { Length.type}?
251
252## Content model for \elementref{item}.
253item_model =   tags?, Para.model
254
255#======================================================================
256
257inline-itemize =
258## An inline form of itemized list.
259element inline-itemize { inline-itemize_attributes, inline-itemize_model }
260
261## Attributes for \elementref{inline-itemize}.
262inline-itemize_attributes =
263  Common.attributes,
264  ID.attributes,
265  Backgroundable.attributes
266
267## Content model for \elementref{inline-itemize}.
268inline-itemize_model = inline-item*
269
270#======================================================================
271
272inline-enumerate =
273## An inline form of enumerated list.
274element inline-enumerate { inline-enumerate_attributes, inline-enumerate_model }
275
276## Attributes for \elementref{inline-enumerate}.
277inline-enumerate_attributes =
278  Common.attributes,
279  ID.attributes,
280  Backgroundable.attributes
281
282## Content model for \elementref{inline-enumerate}.
283inline-enumerate_model = inline-item*
284
285#======================================================================
286
287inline-description =
288## An inline form of description list.
289## The \elementref{inline-item}s within are expected to have a \elementref{tags}
290## which represents the term being described in each \elementref{inline-item}.
291element inline-description { inline-description_attributes, inline-description_model }
292
293## Attributes for \elementref{inline-description}.
294inline-description_attributes =
295  Common.attributes,
296  ID.attributes,
297  Backgroundable.attributes
298
299## Content model for \elementref{inline-description}.
300inline-description_model = inline-item*
301
302#======================================================================
303
304inline-item =
305## An item within an inline list (\elementref{inline-itemize},\elementref{inline-enumerate}
306## or \elementref{inline-description}).
307element inline-item { inline-item_attributes, inline-item_model }
308
309## Attributes for \elementref{item}.
310inline-item_attributes =
311  Common.attributes,
312  Labelled.attributes,
313  Backgroundable.attributes
314
315## Content model for \elementref{inline-item}.
316inline-item_model =   tags?, (Inline.class | Misc.class | Meta.class)*
317
318#======================================================================
319
320tags =
321## A container for one or more \elementref{tag}s.
322## At most one will have no \attr{role}, which would be the default display.
323## Other \elementref{tag} will have the role attribute for use in
324## special forms of referencing.
325element tags { tags_model }
326
327tags_model = tag+
328
329tag =
330## A tag within an item indicating the term or bullet for a given item.
331element tag { tag_attributes, tag_model }
332
333## Attributes for \elementref{tag}.
334tag_attributes =
335  Common.attributes,
336  Backgroundable.attributes,
337
338  ## specifies the purpose this tag is used for: no value is default display
339  attribute role { text}?,
340
341  ## specifies an open delimiters used to display the tag.
342  attribute open { text }?,
343
344  ## specifies an close delimiters used to display the tag.
345  attribute close { text }?
346
347## Content model for \elementref{tag}.
348tag_model = Inline.model
349
350#======================================================================
351
352pagination =
353## A page break or related pagination information.
354element pagination {  pagination_attributes, pagination_model }
355
356## Attributes for \elementref{pagination}.
357pagination_attributes =
358  Common.attributes,
359  ## what kind of pagination
360  attribute role { text }?
361
362## Content model for \elementref{pagination}.
363pagination_model = empty
364
365#======================================================================