<?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>
  </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>
  </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="Labelled.attributes">
    <a:documentation>Attributes for elements that can be labelled from within LaTeX.</a:documentation>
    <ref name="ID.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>
    <optional>
      <attribute name="refnum">
        <a:documentation>the reference number (ie. section number, equation number, etc) of the object.</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="pad-width">
        <a:documentation>extra width beyond the boxes natural size.</a:documentation>
        <ref name="Length.type"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="pad-height">
        <a:documentation>extra height beyond the boxes natural size.</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.</a:documentation>
        <choice>
          <value>top</value>
          <value>middle</value>
          <value>bottom</value>
        </choice>
      </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.</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}.</a:documentation>
        <data type="nonNegativeInteger"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="description">
        <a:documentation>a description of the image</a:documentation>
      </attribute>
    </optional>
  </define>
</grammar>
