<?xml version="1.0" encoding="UTF-8"?>
<!--
  /=====================================================================\ 
  |  LaTeXML-inline.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=/
-->
<grammar ns="http://dlmf.nist.gov/LaTeXML" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
  <define name="Inline.class" combine="choice">
    <a:documentation>The inline module defines basic inline elements used throughout.</a:documentation>
    <choice>
      <ref name="text"/>
      <ref name="emph"/>
      <ref name="del"/>
      <ref name="sub"/>
      <ref name="sup"/>
      <ref name="glossaryref"/>
      <ref name="rule"/>
      <ref name="anchor"/>
      <ref name="ref"/>
      <ref name="cite"/>
      <ref name="bibref"/>
    </choice>
  </define>
  <!-- ====================================================================== -->
  <define name="text">
    <element name="text">
      <a:documentation>General container for styled text.
Attributes cover a variety of styling and position shifting properties.</a:documentation>
      <ref name="text_attributes"/>
      <ref name="text_model"/>
    </element>
  </define>
  <define name="text_attributes">
    <a:documentation>Attributes for \elementref{text}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Positionable.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
  </define>
  <define name="text_model">
    <a:documentation>Content model for \elementref{text}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="emph">
    <element name="emph">
      <a:documentation>Emphasized text.</a:documentation>
      <ref name="emph_attributes"/>
      <ref name="emph_model"/>
    </element>
  </define>
  <define name="emph_attributes">
    <a:documentation>Attributes for \elementref{emph}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
  </define>
  <define name="emph_model">
    <a:documentation>Content model for \elementref{emph}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="del">
    <element name="del">
      <a:documentation>Deleted text.</a:documentation>
      <ref name="del_attributes"/>
      <ref name="del_model"/>
    </element>
  </define>
  <define name="del_attributes">
    <a:documentation>Attributes for \elementref{del}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
  </define>
  <define name="del_model">
    <a:documentation>Content model for \elementref{del}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="sub">
    <element name="sub">
      <a:documentation>Textual subscript text.</a:documentation>
      <ref name="sub_attributes"/>
      <ref name="sub_model"/>
    </element>
  </define>
  <define name="sub_attributes">
    <a:documentation>Attributes for \elementref{sub}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="sub_model">
    <a:documentation>Content model for \elementref{sub}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="sup">
    <element name="sup">
      <a:documentation>Textual superscript text.</a:documentation>
      <ref name="sup_attributes"/>
      <ref name="sup_model"/>
    </element>
  </define>
  <define name="sup_attributes">
    <a:documentation>Attributes for \elementref{sup}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="sup_model">
    <a:documentation>Content model for \elementref{sup}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="glossaryref">
    <element name="glossaryref">
      <a:documentation>Represents the usage of a term from a glossary.</a:documentation>
      <ref name="glossaryref_attributes"/>
      <ref name="glossaryref_model"/>
    </element>
  </define>
  <define name="glossaryref_attributes">
    <a:documentation>Attributes for \elementref{glossaryref}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Refable.attributes"/>
    <ref name="Listable.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <optional>
      <attribute name="key">
        <a:documentation>should be used to identifier used for the glossaryref.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="title">
        <a:documentation>gives a expanded form of the glossaryref (unused?),</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="show">
        <a:documentation>a pattern encoding how the text content should be filled in during
postprocessing, if it is empty.
It consists of the words
  \texttt{type} (standing for the object type, eg. Ch.),
  \texttt{refnum}, \texttt{typerefnum} and \texttt{title}
or \texttt{toctitle} (for the shortform of the title)
mixed with arbitrary characters.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="glossaryref_model">
    <a:documentation>Content model for \elementref{glossaryref}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="rule">
    <element name="rule">
      <a:documentation>A Rule.</a:documentation>
      <ref name="rule_attributes"/>
      <ref name="rule_model"/>
    </element>
  </define>
  <define name="rule_attributes">
    <a:documentation>Attributes for \elementref{rule}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Positionable.attributes"/>
    <ref name="Colorable.attributes"/>
  </define>
  <define name="rule_model">
    <a:documentation>Content model for \elementref{rule}.</a:documentation>
    <empty/>
  </define>
  <!-- ====================================================================== -->
  <define name="ref">
    <element name="ref">
      <a:documentation>A hyperlink reference to some other object. 
When converted to HTML, the content would be the content of the anchor.
The destination can be specified by one of the 
attributes \attr{labelref}, \attr{idref} or \attr{href};
Missing fields will usually be filled in during postprocessing,
based on data extracted from the document(s).</a:documentation>
      <ref name="ref_attributes"/>
      <ref name="ref_model"/>
    </element>
  </define>
  <define name="ref_attributes">
    <a:documentation>Attributes for \elementref{ref}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Refable.attributes"/>
    <ref name="Fontable.attributes"/>
    <ref name="Colorable.attributes"/>
    <ref name="Backgroundable.attributes"/>
    <optional>
      <attribute name="show">
        <a:documentation>a pattern encoding how the text content should be filled in during
postprocessing, if it is empty.
It consists of the words
  \texttt{type} (standing for the object type, eg. Ch.),
  \texttt{refnum} and \texttt{title} (including type and refnum)
or \texttt{toctitle} (for the shortform of the title)
mixed with arbitrary characters.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="title">
        <a:documentation>gives a longer form description of the target,
this would typically appear as a tooltip in HTML.
Typically filled in by postprocessor.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="ref_model">
    <a:documentation>Content model for \elementref{ref}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="anchor">
    <element name="anchor">
      <a:documentation>Inline anchor.</a:documentation>
      <ref name="anchor_attributes"/>
      <ref name="anchor_model"/>
    </element>
  </define>
  <define name="anchor_attributes">
    <a:documentation>Attributes for \elementref{anchor}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="ID.attributes"/>
  </define>
  <define name="anchor_model">
    <a:documentation>Content model for \elementref{anchor}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="cite">
    <element name="cite">
      <a:documentation>A container for a bibliographic citation. The model is inline to
allow arbitrary comments before and after the expected \elementref{bibref}(s)
which are the specific citation.</a:documentation>
      <ref name="cite_attributes"/>
      <ref name="cite_model"/>
    </element>
  </define>
  <define name="cite_attributes">
    <a:documentation>Attributes for \elementref{cite}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="Listable.attributes"/>
  </define>
  <define name="cite_model">
    <a:documentation>Content model for \elementref{cite}.</a:documentation>
    <ref name="Inline.model"/>
  </define>
  <!-- ====================================================================== -->
  <define name="bibref">
    <element name="bibref">
      <a:documentation>A bibliographic citation refering to a specific bibliographic item.
Postprocessing will turn this into an \elementref{ref} for the actual link.</a:documentation>
      <ref name="bibref_attributes"/>
      <ref name="bibref_model"/>
    </element>
  </define>
  <define name="bibref_attributes">
    <a:documentation>Attributes for \elementref{bibref}.</a:documentation>
    <ref name="Common.attributes"/>
    <ref name="IDREF.attributes"/>
    <ref name="Listable.attributes"/>
    <optional>
      <attribute name="bibrefs">
        <a:documentation>a comma separated list of bibliographic keys.
(See the \attr{key} attribute of \elementref{bibitem} and \elementref{bibentry})</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="show">
        <a:documentation>a pattern encoding how the text content (of an empty bibref) will be filled in.
Consists of strings \texttt{author}, \texttt{fullauthor}, \texttt{year},
\texttt{number} and \texttt{title}
(to be replaced by data from the bibliographic item)
mixed with arbitrary characters.</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="separator">
        <a:documentation>separator between formatted references</a:documentation>
      </attribute>
    </optional>
    <optional>
      <attribute name="yyseparator">
        <a:documentation>separator between formatted years when duplicate authors are combined.</a:documentation>
      </attribute>
    </optional>
  </define>
  <define name="bibref_model">
    <a:documentation>Content model for \elementref{bibref}.</a:documentation>
    <zeroOrMore>
      <ref name="bibrefphrase"/>
    </zeroOrMore>
  </define>
  <!-- ====================================================================== -->
  <define name="bibrefphrase">
    <element name="bibrefphrase">
      <a:documentation>A preceding or following phrase used in composing a bibliographic reference,
such as listing pages or chapter.</a:documentation>
      <ref name="bibrefphrase_attributes"/>
      <ref name="bibrefphrase_model"/>
    </element>
  </define>
  <define name="bibrefphrase_attributes">
    <a:documentation>Attributes for \elementref{bibrefphrase}</a:documentation>
    <ref name="Common.attributes"/>
  </define>
  <define name="bibrefphrase_model">
    <a:documentation>Content model for \elementref{bibrefphrase}</a:documentation>
    <ref name="Inline.model"/>
  </define>
</grammar>
<!-- ====================================================================== -->
