# /=====================================================================\ 
# |  LaTeXML-para.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"

## This module defines the following `logical' block elements.
Para.class |=
     para | logical-block
   | theorem | proof
   | figure | table | float | pagination
# allow pagination here, to avoid unnecessary extra para!

## Additionally, it defines these miscellaneous elements that can appear
## in both inline and block contexts.
Misc.class  |= inline-logical-block

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

para =
## A Logical paragraph. It has an \attr{id}, but not a \attr{label}.
element para { para_attributes, para_model }

## Attributes for \elementref{para}.
para_attributes =
  Common.attributes,
  ID.attributes,
  Positionable.attributes,
  Backgroundable.attributes

## Content model for \elementref{para}.
para_model = Block.model

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

logical-block =
## A logical-block. Actually, like block can appear in inline or block mode, but
## typesets its contents as para.
element logical-block { logical-block_attributes, logical-block_model }

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

## Content model for \elementref{logical-block}.
logical-block_model = Para.model

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

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

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

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

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

theorem =
## A theorem or similar object. The \attr{class} attribute can be used to distinguish
## different kinds of theorem.
element theorem { theorem_attributes, theorem_model }

## Attributes for \elementref{theorem}.
theorem_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes

## Content model for \elementref{theorem}.
theorem_model = tags?, title?, Para.model

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

proof =
## A proof or similar object. The \attr{class} attribute can be used to distinguish
## different kinds of proof.
element proof { proof_attributes, proof_model }

## Attributes for \elementref{proof}.
proof_attributes =
  Common.attributes,
  Labelled.attributes,
  Backgroundable.attributes,
  Data.attributes

## Content model for \elementref{proof}.
proof_model = tags?, title?, Para.model

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

## These are the additional elements representing figure and
## table captions.
## NOTE: Could title sensibly be reused here, instead?
## Or, should caption be used for theorem and proof?
Caption.class = caption | toccaption

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

figure =
## A  figure, possibly captioned.
element figure { figure_attributes, figure_model }

## Attributes for \elementref{figure}.
figure_attributes = 
  Common.attributes,
  Labelled.attributes,
  Positionable.attributes,
  Transformable.attributes,
  Backgroundable.attributes,
  Data.attributes,
  
  ## the vertical floating placement parameter that determines where the object is displayed.
  attribute placement { text }?

## Content model for \elementref{figure}; allow nested figures, etc for "sub" floats.
figure_model = (tags? | figure | table | float | Block.model | Caption.class)*

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

table =
## A  Table, possibly captioned. This is not necessarily a \elementref{tabular}.
element table { table_attributes, table_model }

## Attributes for \elementref{table}.
table_attributes = 
  Common.attributes,
  Labelled.attributes,
  Positionable.attributes,
  Transformable.attributes,
  Backgroundable.attributes,
  Data.attributes,
  
  ## the vertical floating placement parameter that determines where the object is displayed.
  attribute placement { text }?

## Content model for \elementref{table}.
table_model = (tags? | table | figure | float | Block.model | Caption.class)*

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

float =
## A generic float, possibly captioned, something other than a table or figure
element float { float_attributes, float_model }

## Attributes for \elementref{float}.
float_attributes = 
  Common.attributes,
  Labelled.attributes,
  Positionable.attributes,
  Transformable.attributes,
  Backgroundable.attributes,
  Data.attributes,

  ## The kind of float; could be something like a listing, or some other thing
  attribute role { text }?,
  ## the vertical floating placement parameter that determines where the object is displayed.
  attribute placement { text }?

## Content model for \elementref{float}.
float_model = (tags? | float | figure | table | Block.model | Caption.class)*

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

caption =
## A caption for a \elementref{table} or \elementref{figure}.
element caption { caption_attributes, caption_model }

## Attributes for \elementref{caption}.
caption_attributes = 
  Common.attributes,
  Fontable.attributes,
  Colorable.attributes,
  Backgroundable.attributes

## Content model for \elementref{caption},
## basically Inline.model with tag included (normally, but not necessarily, tag would come first).
caption_model = (tag | text | Inline.class | Misc.class | Meta.class)*

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

toccaption =
## A short form of \elementref{table} or \elementref{figure} caption,
## used for lists of figures or similar.
element toccaption { toccaption_attributes, toccaption_model }

## Attributes for \elementref{toccaption}.
toccaption_attributes = Common.attributes

## Content model for \elementref{toccaption}.
toccaption_model = (tag | text | Inline.class | Misc.class | Meta.class)*
#======================================================================
