math.rng 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of DocBook V5.0
  4. Copyright 1992-2008 HaL Computer Systems, Inc.,
  5. O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
  6. Corporation, Norman Walsh, Sun Microsystems, Inc., and the
  7. Organization for the Advancement of Structured Information
  8. Standards (OASIS).
  9. Release: $Id: math.rnc 8931 2010-10-20 13:29:20Z nwalsh $
  10. Permission to use, copy, modify and distribute the DocBook schema
  11. and its accompanying documentation for any purpose and without fee
  12. is hereby granted in perpetuity, provided that the above copyright
  13. notice and this paragraph appear in all copies. The copyright
  14. holders make no representation about the suitability of the schema
  15. for any purpose. It is provided "as is" without expressed or implied
  16. warranty.
  17. If you modify the DocBook schema in any way, label your schema as a
  18. variant of DocBook. See the reference documentation
  19. (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
  20. for more information.
  21. Please direct all questions, bug reports, or suggestions for changes
  22. to the docbook@lists.oasis-open.org mailing list. For more
  23. information, see http://www.oasis-open.org/docbook/.
  24. ======================================================================
  25. -->
  26. <grammar ns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:ctrl="http://nwalsh.com/xmlns/schema-control/" xmlns="http://relaxng.org/ns/structure/1.0">
  27. <start combine="choice">
  28. <choice>
  29. <ref name="db.equation"/>
  30. <ref name="db.informalequation"/>
  31. </choice>
  32. </start>
  33. <define name="db.formal.blocks" combine="choice">
  34. <ref name="db.equation"/>
  35. </define>
  36. <define name="db.informal.blocks" combine="choice">
  37. <ref name="db.informalequation"/>
  38. </define>
  39. <define name="db.math.inlines">
  40. <ref name="db.inlineequation"/>
  41. </define>
  42. <define name="db.domain.inlines" combine="choice">
  43. <ref name="db.math.inlines"/>
  44. </define>
  45. <define name="db.initializer.inlines" combine="choice">
  46. <ref name="db.mathphrase"/>
  47. </define>
  48. <!-- ====================================================================== -->
  49. <define name="db.equation.content">
  50. <choice>
  51. <oneOrMore>
  52. <ref name="db.mediaobject"/>
  53. </oneOrMore>
  54. <oneOrMore>
  55. <ref name="db.mathphrase"/>
  56. </oneOrMore>
  57. </choice>
  58. </define>
  59. <define name="db.inlineequation.content">
  60. <choice>
  61. <oneOrMore>
  62. <ref name="db.inlinemediaobject"/>
  63. </oneOrMore>
  64. <oneOrMore>
  65. <ref name="db.mathphrase"/>
  66. </oneOrMore>
  67. </choice>
  68. </define>
  69. <!-- ====================================================================== -->
  70. <div>
  71. <db:refname>equation</db:refname>
  72. <db:refpurpose>A displayed mathematical equation</db:refpurpose>
  73. <define name="db.equation.role.attribute">
  74. <attribute name="role"/>
  75. </define>
  76. <define name="db.equation.label.attribute">
  77. <ref name="db.label.attribute"/>
  78. </define>
  79. <define name="db.equation.attlist">
  80. <interleave>
  81. <optional>
  82. <ref name="db.equation.role.attribute"/>
  83. </optional>
  84. <ref name="db.common.attributes"/>
  85. <ref name="db.common.linking.attributes"/>
  86. <optional>
  87. <ref name="db.equation.label.attribute"/>
  88. </optional>
  89. <optional>
  90. <ref name="db.pgwide.attribute"/>
  91. </optional>
  92. <optional>
  93. <ref name="db.floatstyle.attribute"/>
  94. </optional>
  95. </interleave>
  96. </define>
  97. <define name="db.equation.info">
  98. <ref name="db._info.title.only"/>
  99. </define>
  100. <define name="db.equation">
  101. <element name="equation">
  102. <ref name="db.equation.attlist"/>
  103. <ref name="db.equation.info"/>
  104. <optional>
  105. <ref name="db.alt"/>
  106. </optional>
  107. <ref name="db.equation.content"/>
  108. <optional>
  109. <ref name="db.caption"/>
  110. </optional>
  111. </element>
  112. </define>
  113. </div>
  114. <!-- ====================================================================== -->
  115. <div>
  116. <db:refname>informalequation</db:refname>
  117. <db:refpurpose>A displayed mathematical equation without a title</db:refpurpose>
  118. <define name="db.informalequation.role.attribute">
  119. <attribute name="role"/>
  120. </define>
  121. <define name="db.informalequation.attlist">
  122. <interleave>
  123. <optional>
  124. <ref name="db.informalequation.role.attribute"/>
  125. </optional>
  126. <ref name="db.common.attributes"/>
  127. <ref name="db.common.linking.attributes"/>
  128. </interleave>
  129. </define>
  130. <define name="db.informalequation.info">
  131. <ref name="db._info.title.forbidden"/>
  132. </define>
  133. <define name="db.informalequation">
  134. <element name="informalequation">
  135. <ref name="db.informalequation.attlist"/>
  136. <ref name="db.informalequation.info"/>
  137. <optional>
  138. <ref name="db.alt"/>
  139. </optional>
  140. <ref name="db.equation.content"/>
  141. <optional>
  142. <ref name="db.caption"/>
  143. </optional>
  144. </element>
  145. </define>
  146. </div>
  147. <!-- ====================================================================== -->
  148. <div>
  149. <db:refname>inlineequation</db:refname>
  150. <db:refpurpose>A mathematical equation or expression occurring inline</db:refpurpose>
  151. <define name="db.inlineequation.role.attribute">
  152. <attribute name="role"/>
  153. </define>
  154. <define name="db.inlineequation.attlist">
  155. <interleave>
  156. <optional>
  157. <ref name="db.inlineequation.role.attribute"/>
  158. </optional>
  159. <ref name="db.common.attributes"/>
  160. <ref name="db.common.linking.attributes"/>
  161. </interleave>
  162. </define>
  163. <define name="db.inlineequation">
  164. <element name="inlineequation">
  165. <ref name="db.inlineequation.attlist"/>
  166. <optional>
  167. <ref name="db.alt"/>
  168. </optional>
  169. <ref name="db.inlineequation.content"/>
  170. </element>
  171. </define>
  172. </div>
  173. <!-- ====================================================================== -->
  174. <div>
  175. <db:refname>mathphrase</db:refname>
  176. <db:refpurpose>A mathematical phrase that can be represented with ordinary text and a small amount of markup</db:refpurpose>
  177. <define name="db.mathphrase.role.attribute">
  178. <attribute name="role"/>
  179. </define>
  180. <define name="db.mathphrase.attlist">
  181. <interleave>
  182. <optional>
  183. <ref name="db.mathphrase.role.attribute"/>
  184. </optional>
  185. <ref name="db.common.attributes"/>
  186. <ref name="db.common.linking.attributes"/>
  187. </interleave>
  188. </define>
  189. <define name="db.mathphrase">
  190. <element name="mathphrase">
  191. <ref name="db.mathphrase.attlist"/>
  192. <zeroOrMore>
  193. <choice>
  194. <ref name="db._text"/>
  195. <ref name="db.ubiq.inlines"/>
  196. <ref name="db._emphasis"/>
  197. </choice>
  198. </zeroOrMore>
  199. </element>
  200. </define>
  201. </div>
  202. </grammar>