summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rnc/LaTeXML/LaTeXML-block.rnc
blob: a8ccd452b7b03ed6962612de8e46885dcdeb8901 (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
# /=====================================================================\ 
# |  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* & listingblock*
         & itemize* & enumerate* & description*


## Additionally, it defines these miscellaneous elements that can appear
## in both inline and block contexts.
Misc.class  &= inline-block* & verbatim* & break* & graphics* & svg*

## 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

## 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 }?

## 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

## Content model for \elementref{equation}.
equation_model = Math* & MathFork* & \text* & tabular* & 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

## Content model for \elementref{equationgroup}.
equationgroup_model = 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, 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

## 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

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

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

listingblock =
## An in-block Listing, without caption
element listingblock { listingblock_attributes &  listingblock_model }

## Attributes for \elementref{listingblock}.
listingblock_attributes = Common.attributes &  Labelled.attributes

## Content model for \elementref{listingblock}.
listingblock_model = Block.model*

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

break =
## A forced line break.
element break {  break_attributes &  break_model }

## Attributes for \elementref{break}.
break_attributes = Common.attributes

## Content model for \elementref{break}.
break_model = empty

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

inline-block =
## An inline block. Actually, can appear in inline or block mode, but
## typesets its contents as a block.
element inline-block { inline-block_attributes &  inline-block_model }

## Attributes for \elementref{inline-block}.
inline-block_attributes = Common.attributes &  ID.attributes &  Positionable.attributes

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

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

verbatim =
## Verbatim content
element verbatim { verbatim_attributes &  verbatim_model }

## Attributes for \elementref{verbatim}.
verbatim_attributes =
  Common.attributes & 
  ID.attributes & 
  ## the font to use; generally typewriter.
  attribute font { text }? &

  ## Indicates the text size to use. (See \elementref{text})
  attribute size { "Huge" | "huge" | "LARGE" | "Large" | "large" | "normal"
                 | "small" | "footnote" | "tiny" | text }? &

  ## the color to use; any CSS compatible color specification.
  attribute color { text }?

## Content model for \elementref{verbatim}.
verbatim_model = Inline.model

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

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

## Attributes for \elementref{itemize}.
itemize_attributes = Common.attributes &  ID.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

## 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

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

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

item =
## An item within a list.
element item { item_attributes &  item_model }

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

## Content model for \elementref{item}.
item_model =   tag? &  Para.model

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

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 & 

  ## 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

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

graphics =
## A graphical insertion of an external file. 
element graphics { graphics_attributes &  graphics_model }

## Attributes for \elementref{graphics}.
graphics_attributes =
  Common.attributes & 
  ID.attributes & 
  Imageable.attributes & 

  ## the path to the graphics file. This is the (often minimally specified) path
  ## to a graphics file omitting the type extension.  Once resolved to a specific
  ## image file, the \attr{imagesrc} (from Imageable.attributes) is used.
  attribute graphic { text }? &

  ## a comma separated list of candidate graphics files that could be used to
  ## for \attr{graphic}.  A post-processor or application may choose from these,
  ## or may make its own selection or synthesis to implement the graphic for a given target.
  attribute candidates { text }? &

  ## an encoding of the scaling and positioning options
  ## to be used in processing the graphic.
  attribute options { text }?


## Content model for \elementref{graphics}.
graphics_model = empty

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

svg =
## An SVG (Scalable Vector Graphics) object
## [eventually must adapt to put LaTeXML objects in foreignObject]
grammar {
  include "svg11.rnc"
  { SVG.foreignObject.content = parent Flow.model }
}
#======================================================================