1# /=====================================================================\
2# |  LaTeXML-picture.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
13# ======================================================================
14# Picture; Experimental, possibly should evolve to SVG?
15# ======================================================================
16
17default namespace = "http://dlmf.nist.gov/LaTeXML"
18namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
19
20## This module defines a picture environment, roughly a subset of SVG.
21## NOTE: Eventually we will drop these subset elements and incorporate SVG itself.
22Misc.class |= picture
23
24#======================================================================
25
26Picture.class =
27  g | rect | line | circle | path
28 | arc | wedge | ellipse | polygon | bezier
29 | parabola | curve | dots | grid | clip
30 | svg
31
32## These attributes correspond roughly to SVG, but need documentation.
33Picture.attributes =
34  attribute x { text }?,
35  attribute y { text }?,
36  attribute r { text }?,
37  attribute rx { text }?,
38  attribute ry { text }?,
39  attribute width { text }?,
40  attribute height { text }?,
41  attribute fill { text }?,
42  attribute stroke { text }?,
43  attribute stroke-width { text }?,
44  attribute stroke-dasharray { text }?,
45  attribute transform { text }?,
46  attribute terminators { text }?,
47  attribute arrowlength { text }?,
48  attribute points { text }?,
49  attribute showpoints { text }?,
50  attribute displayedpoints { text }?,
51  attribute arc { text }?,
52  attribute angle1 { text }?,
53  attribute angle2 { text }?,
54  attribute arcsepA { text }?,
55  attribute arcsepB { text }?,
56  attribute curvature { text }?
57
58## These attributes correspond roughly to SVG, but need documentation.
59PictureGroup.attributes =
60  attribute pos { text }?,
61  attribute framed {xsd:boolean}?,
62  [ a:defaultValue = "rect" ]
63  attribute frametype { "rect" | "circle" | "oval" }?,
64  attribute fillframe {xsd:boolean }?,
65  attribute boxsep { text }?,
66  attribute shadowbox {xsd:boolean}?,
67  attribute doubleline {xsd:boolean}?
68
69#======================================================================
70
71picture =
72## A picture environment.
73element picture { picture_attributes, picture_model }
74
75## Attributes for \elementref{picture}.
76picture_attributes =
77  Common.attributes,
78  ID.attributes,
79  Picture.attributes,
80  Imageable.attributes,
81  attribute clip {xsd:boolean}?,
82  attribute baseline { text }?,
83  attribute unitlength { text }?,
84  attribute xunitlength { text }?,
85  attribute yunitlength { text }?,
86  attribute origin-x { text }?,
87  attribute origin-y { text }?,
88  attribute tex { text }?,
89  attribute content-tex { text }?
90
91## Content model for \elementref{picture}.
92picture_model = (Picture.class | Inline.class | Misc.class | Meta.class)*
93
94#======================================================================
95
96g =
97## A graphical grouping; the content is inherits by the transformations,
98## positioning and other properties.
99element g { g_attributes, g_model }
100
101## Attributes for \elementref{g}.
102g_attributes = Common.attributes, Transformable.attributes, Picture.attributes, PictureGroup.attributes
103
104## Content model for \elementref{g}.
105g_model = (Picture.class | Inline.class | Misc.class | Meta.class)*
106
107#======================================================================
108
109rect =
110## A rectangle within a \elementref{picture}.
111element rect { rect_attributes, rect_model }
112
113## Attributes for \elementref{rect}.
114rect_attributes = Common.attributes, Picture.attributes
115
116## Content model for \elementref{rect}.
117rect_model = empty
118
119#======================================================================
120
121line =
122## A line within a \elementref{picture}.
123element line { line_attributes, line_model }
124
125## Attributes for \elementref{line}.
126line_attributes = Common.attributes, Picture.attributes
127
128## Content model for \elementref{line}.
129line_model = empty
130
131#======================================================================
132
133polygon =
134## A polygon within a \elementref{picture}.
135element polygon { polygon_attributes, polygon_model }
136
137## Attributes for \elementref{polygon}.
138polygon_attributes = Common.attributes, Picture.attributes
139
140## Content model for \elementref{polygon}.
141polygon_model = empty
142
143#======================================================================
144
145wedge =
146## A wedge within a \elementref{picture}.
147element wedge { wedge_attributes, wedge_model }
148
149## Attributes for \elementref{wedge}.
150wedge_attributes = Common.attributes, Picture.attributes
151
152## Content model for \elementref{wedge}.
153wedge_model = empty
154
155#======================================================================
156
157arc =
158## An arc within a \elementref{picture}.
159element arc { arc_attributes, arc_model }
160
161## Attributes for \elementref{arc}.
162arc_attributes = Common.attributes, Picture.attributes
163
164## Content model for \elementref{arc}.
165arc_model = empty
166
167#======================================================================
168
169circle =
170## A circle within a \elementref{picture}.
171element circle { circle_attributes, circle_model }
172
173## Attributes for \elementref{circle}.
174circle_attributes = Common.attributes, Picture.attributes
175
176## Content model for \elementref{circle}.
177circle_model = empty
178
179#======================================================================
180
181ellipse =
182## An ellipse within a \elementref{picture}.
183element ellipse { ellipse_attributes, ellipse_model }
184
185## Attributes for \elementref{ellipse}.
186ellipse_attributes = Common.attributes, Picture.attributes
187
188## Content model for \elementref{ellipse}.
189ellipse_model = empty
190
191#======================================================================
192
193path =
194## A path within a \elementref{picture}.
195element path { path_attributes, path_model }
196
197## Attributes for \elementref{path}.
198path_attributes = Common.attributes, Picture.attributes
199
200## Content model for \elementref{path}.
201path_model = empty
202
203#======================================================================
204
205bezier =
206## A bezier curve within a \elementref{picture}.
207element bezier { bezier_attributes, bezier_model }
208
209## Attributes for \elementref{bezier}.
210bezier_attributes = Common.attributes, Picture.attributes
211
212## Content model for \elementref{bezier}.
213bezier_model = empty
214
215#======================================================================
216
217curve =
218## A curve within a \elementref{picture}.
219element curve { curve_attributes, curve_model }
220
221## Attributes for \elementref{curve}.
222curve_attributes = Common.attributes, Picture.attributes
223
224## Content model for \elementref{curve}.
225curve_model = empty
226
227#======================================================================
228
229parabola =
230## A parabola curve within a \elementref{picture}.
231element parabola { parabola_attributes, parabola_model }
232
233## Attributes for \elementref{parabola}.
234parabola_attributes = Common.attributes, Picture.attributes
235
236## Content model for \elementref{parabola}.
237parabola_model = empty
238
239#======================================================================
240
241dots =
242## A sequence of dots (?) within a \elementref{picture}.
243element dots { dots_attributes, dots_model }
244
245## Attributes for \elementref{dots}.
246dots_attributes = Common.attributes, Picture.attributes,
247  attribute dotstyle { text }?,
248  attribute dotsize { text }?,
249  attribute dotscale { text }?
250
251## Content model for \elementref{dots}.
252dots_model = empty
253
254#======================================================================
255
256grid =
257## A grid within a \elementref{picture}.
258element grid { grid_attributes, grid_model }
259
260## Attributes for \elementref{grid}.
261grid_attributes = Common.attributes, Picture.attributes
262
263## Content model for \elementref{grid}.
264grid_model = empty
265
266#======================================================================
267
268clip =
269## Establishes a clipping region within a \elementref{picture}.
270element clip { clip_attributes, clip_model }
271
272## Attributes for \elementref{clip}.
273clip_attributes = Common.attributes, Picture.attributes
274
275
276## Content model for \elementref{clip}.
277clip_model = clippath*
278
279#======================================================================
280
281clippath =
282## Establishes a clipping region within a \elementref{picture}.
283element clippath { clippath_attributes, clippath_model }
284
285## Attributes for \elementref{clippath}.
286clippath_attributes = Common.attributes, Picture.attributes
287
288## Content model for \elementref{clippath}.
289clippath_model = (Picture.class | Inline.class | Misc.class | Meta.class)*
290
291#======================================================================
292