home *** CD-ROM | disk | FTP | other *** search
/ XML Bible (2nd Edition) / XML_Bible_Second_Edition_Hungry_Minds_2001.iso / mac / specs / XML-MathML-20010221 / xml / presentation-markup.xml < prev    next >
Text File  |  2001-02-15  |  276KB  |  6,868 lines

  1. <div1 id="presm" role="chapter3"><head>Presentation Markup</head>
  2. <!-- $Id: presentation-markup.xml,v 1.79 2001/02/15 19:36:14 rminer Exp $ -->
  3.  
  4. <!-- 
  5. Principal Authors
  6. Neil Soiffer: overall design; organization and original text of documentation.
  7. Bruce Smith: most precise details of design and documentation;
  8. much additional text of documentation.
  9.  
  10. Contributors
  11. Robert Miner: original <mfenced> and <maction> designs.
  12. Paul Topping: original alignment element design.
  13. Various members of the W3C Math WG: various design details.
  14.  
  15. Editors
  16. Patrick Ion & Robert Miner.
  17. -->
  18.  
  19. <div2 id="presm_intro"><head>Introduction</head>
  20.  
  21. <p>This chapter specifies the <quote>presentation</quote> elements of
  22. MathML, which can be used to describe the layout structure of mathematical
  23. notation.</p>
  24.  
  25. <div3><head>What Presentation Elements Represent</head>
  26.  
  27. <p>Presentation elements correspond to the <quote>constructors</quote>
  28. of traditional mathematical notation – that is, to the basic
  29. kinds of symbols and expression-building structures out of which any
  30. particular piece of traditional mathematical notation is built.
  31. Because of the importance of traditional visual notation, the
  32. descriptions of the notational constructs the elements represent are
  33. usually given here in visual terms.  However, the elements are
  34. medium-independent in the sense that they have been designed to
  35. contain enough information for good spoken renderings as well.  Some
  36. attributes of these elements may make sense only for visual media, but
  37. most attributes can be treated in an analogous way in audio as well
  38. (for example, by a correspondence between time duration and horizontal
  39. extent).</p>
  40.  
  41. <p>MathML presentation elements only suggest (i.e. do not require)
  42. specific ways of rendering in order to allow for medium-dependent
  43. rendering and for individual preferences of style.  This specification
  44. describes suggested visual rendering rules in some detail, but a
  45. particular MathML renderer is free to use its own rules as long as its
  46. renderings are intelligible.</p>
  47.  
  48. <p>The presentation elements are meant to express the syntactic
  49. structure of mathematical notation in much the same way as titles, sections,
  50. and paragraphs capture the higher-level syntactic structure of a
  51. textual document. Because of this, for example, a single row of
  52. identifiers and operators, such as <quote><mi>x</mi> + <mi>a</mi> /
  53. <mi>b</mi></quote>, will often be represented not just by one
  54. <kw role="element">mrow</kw> element (which renders as a horizontal row
  55. of its arguments), but by multiple nested <kw role="element">mrow</kw>
  56. elements corresponding to the nested sub-expressions of which one
  57. mathematical expression is composed – in this case,
  58. <eg role="mathml"><![CDATA[
  59. <mrow>
  60.   <mi> x </mi>
  61.   <mo> + </mo>
  62.   <mrow>
  63.     <mi> a </mi>
  64.     <mo> / </mo>
  65.     <mi> b </mi>
  66.   </mrow>
  67. </mrow>
  68. ]]></eg>
  69. </p>
  70.  
  71. <p>Similarly, superscripts are attached not just to the preceding
  72. character, but to the full expression constituting their base. This
  73. structure allows for better-quality rendering of mathematics, especially when
  74. details of the rendering environment such as display widths are not
  75. known to the document author; it also greatly eases automatic
  76. interpretation of the mathematical structures being represented.</p>
  77.  
  78. <p>Certain MathML characters are used
  79. to name operators or identifiers that in traditional notation render the
  80. same as other symbols, such as <kw role="entity">DifferentialD</kw>, <kw
  81. role="entity">ExponentialE</kw>, or <kw role="entity">ImaginaryI</kw>, or
  82. operators that usually render invisibly, such as <kw
  83. role="entity">InvisibleTimes</kw>, <kw role="entity">ApplyFunction</kw>, or
  84. <kw role="entity">InvisibleComma</kw>.  These are distinct notational
  85. symbols or objects, as evidenced by their distinct spoken renderings and in
  86. some cases by their effects on linebreaking and spacing in visual
  87. rendering, and as such should be represented by the appropriate specific
  88. entity references.  For example, the expression represented visually as
  89. <quote><mi>f</mi>(<mi>x</mi>)</quote> would usually be spoken in English as
  90. <quote><mi>f</mi> of <mi>x</mi></quote> rather than just
  91. <quote><mi>f</mi> <mi>x</mi></quote>; this is expressible in MathML by
  92. the use of the <kw role="entity">ApplyFunction</kw> operator after the
  93. <quote><mi>f</mi></quote>, which (in this case) can be aurally rendered as
  94. <quote>of</quote>.</p>
  95.  
  96. <p>The complete list of MathML entities is described in <specref ref="chars"/>.</p>
  97. </div3>
  98.  
  99. <div3><head>Terminology Used In This Chapter</head>
  100.  
  101.  
  102. <p>It is strongly recommended that, before reading the present
  103. chapter, one read <specref ref="fund_syntax"/> on MathML syntax and
  104. grammar, which contains important information on MathML notations and
  105. conventions.  In particular, in this chapter it is assumed that the
  106. reader has an understanding of basic XML terminology described in
  107. <specref ref="fund_xmlsyntax"/>, and the attribute value notations and
  108. conventions described in <specref ref="fund_attval"/>.</p>
  109.  
  110. <p>The remainder of this section introduces MathML-specific
  111. terminology and conventions used in this chapter.</p>
  112.  
  113. <div4><head>Types of presentation elements</head>
  114.  
  115. <p>The presentation elements are divided into two classes.
  116. <emph>Token elements</emph> represent individual symbols, names,
  117. numbers, labels, etc.  In general, tokens can have only
  118. characters as content.  The
  119. only exceptions are the vertical alignment element <kw
  120. role="element">malignmark</kw>, <kw role="element">mglyph</kw>,
  121. and entity references.
  122. <emph>Layout schemata</emph> build expressions out of parts, and can have
  123. only elements as content (except for whitespace, which they ignore). There
  124. are also a few empty elements used only in conjunction with certain layout
  125. schemata.</p>
  126.  
  127. <p>All individual <quote>symbols</quote> in a mathematical expression should be
  128. represented by MathML token elements. The primary MathML token element
  129. types are identifiers (e.g. variables or function names), numbers, and
  130. operators (including fences, such as parentheses, and separators, such
  131. as commas). There are also token elements for representing text or
  132. whitespace that has more aesthetic than mathematical significance,
  133. and for representing <quote>string literals</quote> for compatibility with
  134. computer algebra systems. Note that although a token element
  135. represents a single meaningful <quote>symbol</quote> (name, number, label,
  136. mathematical symbol, etc.), such symbols may be comprised of more than
  137. one character.  For example <code>sin</code> and <code>24</code> are
  138. represented by the single tokens <code><mi>sin</mi></code>
  139. and <code><mn>24</mn></code> respectively.</p>
  140.  
  141. <p>In traditional mathematical notation, expressions are recursively
  142. constructed out of smaller expressions, and ultimately out of single
  143. symbols, with the parts grouped and positioned using one of a small
  144. set of notational structures, which can be thought of as <quote>expression
  145. constructors</quote>. In MathML, expressions are constructed in the same way,
  146. with the layout schemata playing the role of the expression
  147. constructors. The layout schemata specify the way in which
  148. sub-expressions are built into larger expressions. The terminology
  149. derives from the fact that each layout schema corresponds to a
  150. different way of <quote>laying out</quote> its sub-expressions to form a larger
  151. expression in traditional mathematical typesetting.</p>
  152. </div4>
  153.  
  154. <div4><head>Terminology for other classes of elements and their relationships</head>
  155.  
  156. <p>The terminology used in this chapter for special classes of
  157. elements, and for relationships between elements, is as follows: The
  158. <emph>presentation elements</emph> are the MathML elements defined in
  159. this chapter. These elements are listed in <specref
  160. ref="presm_summary"/>. The <emph>content elements</emph> are the
  161. MathML elements defined in <specref ref="contm"/>. The content elements are listed
  162. in <specref ref="contm_elem"/>.</p>
  163.  
  164. <p>A MathML <emph>expression</emph> is a single instance of any of the
  165. presentation elements with the exception of the empty elements <kw
  166. role="element">none</kw> or <kw role="element">mprescripts</kw>, or is
  167. a single instance of any of the content elements which are allowed as
  168. content of presentation elements (described in <specref
  169. ref="mixing_cminpm"/>). A <emph>sub-expression</emph> of an expression
  170. <mi>E</mi> is any MathML expression that is part of the content of
  171. <mi>E</mi>, whether <emph>directly</emph> or <emph>indirectly</emph>,
  172. i.e. whether it is a <quote>child</quote> of <mi>E</mi> or not.</p>
  173.  
  174. <p>Since layout schemata attach special meaning to the number and/or
  175. positions of their children, a child of a layout schema is also called
  176. an <emph>argument</emph> of that element.  As a consequence of the
  177. above definitions, the content of a layout schema consists exactly of
  178. a sequence of zero or more elements that are its
  179. arguments. </p> 
  180. </div4> 
  181. </div3>
  182.  
  183. <div3 id="presm_reqarg"><head>Required Arguments</head>
  184.  
  185. <p>Many of the elements described herein require a specific number of
  186. arguments (always 1, 2, or 3).  In the detailed descriptions of
  187. element syntax given below, the number of required arguments is
  188. implicitly indicated by giving names for the arguments at various
  189. positions.  A few elements have additional requirements on the number
  190. or type of arguments, which are described with the individual
  191. element. For example, some elements accept sequences of zero or more
  192. arguments – that is, they are allowed to occur with no arguments
  193. at all.</p>
  194.  
  195. <p>Note that MathML elements encoding rendered space <emph>do</emph>
  196. count as arguments of the elements in which they appear. See <specref
  197. ref="presm_mspace"/> for a discussion of the proper use of such
  198. space-like elements.</p>
  199.  
  200. <div4><head>Inferred <kw role="element">mrow</kw>s</head>
  201.  
  202. <p>The elements listed in the following table as requiring 1*
  203. argument (<kw role="element">msqrt</kw>, <kw role="element">mstyle</kw>,
  204. <kw role="element">merror</kw>, <kw role="element">menclose</kw>, <kw
  205. role="element">mpadded</kw>, 
  206. <kw role="element">mphantom</kw>, <kw role="element">mtd</kw>,
  207. and <kw role="element">math</kw>) actually
  208. accept any number of arguments.  However, if the number of arguments is 0,
  209. or is more than 1, they treat their contents as a single
  210. <emph>inferred</emph> <kw role="element">mrow</kw> formed from all
  211. their arguments.  Although the <kw role="element">math</kw> element is
  212. not a presentation element, it is listed below for completeness.</p>
  213.  
  214. <p>For example,
  215. <eg role='mathml-fragment'><![CDATA[
  216. <mtd>
  217. </mtd>
  218. ]]></eg>
  219. is treated as if it were
  220. <eg role='mathml-fragment'><![CDATA[
  221. <mtd>
  222.   <mrow>
  223.   </mrow>
  224. </mtd>
  225. ]]></eg>
  226. and
  227. <eg role='mathml'><![CDATA[
  228. <msqrt>
  229.   <mo> - </mo>
  230.   <mn> 1 </mn>
  231. </msqrt>
  232. ]]></eg>
  233. is treated as if it were
  234. <eg role='mathml'><![CDATA[
  235. <msqrt>
  236.   <mrow>
  237.     <mo> - </mo>
  238.     <mn> 1 </mn>
  239.   </mrow>
  240. </msqrt>
  241. ]]></eg>
  242. </p>
  243.  
  244. <p>This feature allows MathML data not to contain (and its authors to
  245. leave out)  many <kw role="element">mrow</kw> elements that would otherwise be
  246. necessary.</p>
  247.  
  248. <p>In the descriptions in this chapter of the above-listed elements'
  249. rendering behaviors, their content can be assumed to consist of
  250. exactly one expression, which may be an <kw role="element">mrow</kw>
  251. element formed from their arguments in this manner. However, their
  252. argument counts are shown in the following table as 1*, since
  253. they are most naturally understood as acting on a single
  254. expression.</p>
  255. </div4>
  256.  
  257. <div4><head>Table of argument requirements</head>
  258.  
  259. <p>For convenience, here is a table of each element's argument count
  260. requirements, and the roles of individual arguments when these are
  261. distinguished.  An argument count of 1* indicates an inferred <kw
  262. role="element">mrow</kw> as described above. 
  263. <table border="1">
  264. <thead>
  265. <tr>
  266. <td>Element</td>
  267. <td>Required argument count</td>
  268. <td>Argument roles (when these differ by position)</td>
  269. </tr>
  270. </thead>
  271. <tbody>
  272. <tr>
  273. <td><intref ref="presm_mrow"><kw role="element">mrow</kw></intref></td> 
  274. <td>0 or more</td>
  275. <td></td>
  276. </tr>
  277. <tr>
  278. <td><intref ref="presm_mfrac"><kw role="element">mfrac</kw></intref></td> 
  279. <td>2</td>
  280. <td><emph>numerator</emph> <emph>denominator</emph></td>
  281. </tr>
  282. <tr>
  283. <td><intref ref="presm_mroot"><kw role="element">msqrt</kw></intref></td> 
  284. <td>1*</td>
  285. <td></td>
  286. </tr>
  287. <tr>
  288. <td><intref ref="presm_mroot"><kw role="element">mroot</kw></intref></td> 
  289. <td>2</td>
  290. <td><emph>base</emph> <emph>index</emph></td>
  291. </tr>
  292. <tr>
  293. <td><intref ref="presm_mstyle"><kw role="element">mstyle</kw></intref></td> 
  294. <td>1*</td>
  295. <td></td>
  296. </tr>
  297. <tr>
  298. <td><intref ref="presm_merror"><kw role="element">merror</kw></intref></td> 
  299. <td>1*</td>
  300. <td></td>
  301. </tr>
  302. <tr>
  303. <td><intref ref="presm_mpadded"><kw role="element">mpadded</kw></intref></td> 
  304. <td>1*</td>
  305. <td></td>
  306. </tr>
  307. <tr>
  308. <td><intref ref="presm_mphantom"><kw role="element">mphantom</kw></intref></td> 
  309. <td>1*</td>
  310. <td></td>
  311. </tr>
  312. <tr>
  313. <td><intref ref="presm_mfenced"><kw role="element">mfenced</kw></intref></td> 
  314. <td>0 or more</td>
  315. <td></td>
  316. </tr>
  317. <tr>
  318. <td><intref ref="presm_menclose"><kw role="element">menclose</kw></intref></td> 
  319. <td>1*</td>
  320. <td></td>
  321. </tr>
  322. <tr>
  323. <td><intref ref="presm_msub"><kw role="element">msub</kw></intref></td> 
  324. <td>2</td>
  325. <td><emph>base</emph> <emph>subscript</emph></td>
  326. </tr>
  327. <tr>
  328. <td><intref ref="presm_msup"><kw role="element">msup</kw></intref></td> 
  329. <td>2</td>
  330. <td><emph>base</emph> <emph>superscript</emph></td>
  331. </tr>
  332. <tr>
  333. <td><intref ref="presm_msubsup"><kw role="element">msubsup</kw></intref></td> 
  334. <td>3</td>
  335. <td><emph>base</emph> <emph>subscript</emph> <emph>superscript</emph></td>
  336. </tr>
  337. <tr>
  338. <td><intref ref="presm_munder"><kw role="element">munder</kw></intref></td> 
  339. <td>2</td>
  340. <td><emph>base</emph> <emph>underscript</emph></td>
  341. </tr>
  342. <tr>
  343. <td><intref ref="presm_mover"><kw role="element">mover</kw></intref></td> 
  344. <td>2</td>
  345. <td><emph>base</emph> <emph>overscript</emph></td>
  346. </tr>
  347. <tr>
  348. <td><intref ref="presm_munderover"><kw role="element">munderover</kw></intref></td> 
  349. <td>3</td>
  350. <td><emph>base</emph> <emph>underscript</emph> <emph>overscript</emph></td>
  351. </tr>
  352. <tr>
  353. <td><intref ref="presm_mmultiscripts"><kw role="element">mmultiscripts</kw></intref></td> 
  354. <td>1 or more</td>
  355. <td><emph>base</emph>
  356.     (<emph>subscript</emph> <emph>superscript</emph>)*
  357.     [<kw role="emptytag">mprescripts</kw>
  358.      (<emph>presubscript</emph> <emph>presuperscript</emph>)*]</td>
  359. </tr>
  360. <tr>
  361. <td><intref ref="presm_mtable"><kw role="element">mtable</kw></intref></td> 
  362. <td>0 or more rows</td>
  363. <td>0 or more <kw role="element">mtr</kw> or <kw
  364. role="element">mlabeledtr</kw> elements</td> 
  365. </tr>
  366. <tr>
  367. <td><intref ref="presm_mlabeledtr"><kw role="element">mlabeledtr</kw></intref></td> 
  368. <td>1 or more</td>
  369. <td>a label and 0 or more <kw role="element">mtd</kw> elements</td>
  370. </tr>
  371. <tr>
  372. <td><intref ref="presm_mtr"><kw role="element">mtr</kw></intref></td> 
  373. <td>0 or more</td>
  374. <td>0 or more <kw role="element">mtd</kw> elements</td>
  375. </tr>
  376. <tr>
  377. <td><intref ref="presm_mtd"><kw role="element">mtd</kw></intref></td> 
  378. <td>1*</td>
  379. <td></td>
  380. </tr>
  381. <tr>
  382. <td><intref ref="presm_maction"><kw role="element">maction</kw></intref></td> 
  383. <td>1 or more</td>
  384. <td>depend on <kw role="attrib">actiontype</kw> attribute</td>
  385. </tr>
  386. <tr>
  387. <td><intref ref="interf_toplevel"><kw role="element">math</kw></intref></td> 
  388. <td>1*</td>
  389. <td></td>
  390. </tr>
  391. </tbody>
  392. </table>
  393. </p>
  394. </div4>
  395. </div3>
  396.  
  397. <div3><head>Elements with Special Behaviors</head>
  398.  
  399. <p>Certain MathML presentation elements exhibit special behaviors in
  400. certain contexts. Such special behaviors are discussed in the
  401. detailed element descriptions below. However, for convenience, some
  402. of the most important classes of special behavior are listed here.</p>
  403.  
  404. <p>Certain elements are considered space-like; these are defined in
  405. <specref ref="presm_mspace"/>. This definition affects some of the suggested rendering
  406. rules for <kw role="element">mo</kw> elements (<specref ref="presm_mo"/>).</p>
  407.  
  408. <p>Certain elements, e.g. <kw role="element">msup</kw>, are able to
  409. embellish operators that are their first argument. These elements are
  410. listed in <specref ref="presm_mo"/>, which precisely defines an <quote>embellished
  411. operator</quote> and explains how this affects the suggested rendering rules
  412. for stretchy operators.</p>
  413.  
  414. <p>Certain elements treat their arguments as the arguments of an
  415. <quote>inferred <kw role="element">mrow</kw></quote> if they are not given
  416. exactly one argument, as explained in <specref ref="presm_reqarg"/>.</p>
  417.  
  418. <p>In MathML 1.x, the <kw role="element">mtable</kw> element could infer 
  419. <kw role="element">mtr</kw> elements around its arguments, and the 
  420. <kw role="element">mtr</kw> element could infer 
  421. <kw role="element">mtd</kw> elements.  In MathML 2.0, <kw
  422. role="element">mtr</kw> and <kw role="element">mtd</kw> elements must
  423. be explicit.  However, for backward compatibility renderers may wish
  424. to continue supporting inferred <kw role="element">mtr</kw> and <kw
  425. role="element">mtd</kw> elements. 
  426. </p>
  427. </div3>
  428.  
  429. <div3 id="presm_bidi"><head>Bidirectional Layout</head>
  430.  
  431. <p>The term 'bidirectional layout' refers to the fact that
  432. letters from certain scripts, in particular Arabic and
  433. Hebrew, are written from right to left, and that mixing
  434. these with numbers or letters from scripts written left-
  435. to-right results in text runs of two differing directions
  436. within the same line or paragraph.</p>
  437.  
  438. <p>For ordinary text, Unicode defines a bidirectional algorithm
  439. <bibref ref="Bidi"/>. This algorithm assumes that the order of
  440. characters in a 'backing store' is in logical order (i.e. in the order
  441. it would be pronounced or typed in), and defines how the characters
  442. get reordered for display based on character properties and other
  443. directives.  HTML, CSS, XSL, and SVG adopt this algorithm and
  444. provide ways to control it via markup or styling.</p>
  445.  
  446. <p>In mathematical expressions, bidirectional layout is more difficult
  447. than it is in text.  In part, this is due to the 2-dimensional nature
  448. of mathematical layout, and the fact that spatial relationships are
  449. often used to convey meaning in mathematics notation.  Another factor is the
  450. lack of established conventions for bidirectional mathematics layout, since
  451. this is relatively uncommon, even in right-to-left contexts.</p>
  452.  
  453. <p>For these reasons, MathML 2.0 only adopts a restricted version of
  454. the Unicode Bidirectional algorithm, as described in the remainder of
  455. this section.</p>
  456.  
  457. <div4><head>Bidirectional Layout in Token Elements</head>
  458.  
  459. <p>For MathML token elements that can contain text (<kw
  460. role="element">mtext</kw>, <kw role="element">mo</kw>, <kw
  461. role="element">mi</kw>, <kw role="element">mn</kw> and <kw
  462. role="element">ms</kw>), the <emph>implicit part</emph> of the Unicode
  463. bidirectional algorithm <bibref ref="Bidi"/> is applied when its
  464. content is rendered visually (i.e. characters are reordered based on
  465. character properties).  The base directionality is left-to-right.</p>
  466.  
  467. <p>The implicit part of the Unicode bidirectional algorithm
  468. is identical to straightforward left-to-right layout if
  469. there is only one character, or if there are no strong
  470. right-to-left characters (i.e. no characters from the
  471. Arabic, Hebrew, or similar scripts).</p>
  472.  
  473. <p>Applications are not required to apply the Unicode bidirectional
  474. algorithm if they do not render strong right-to-left characters.
  475. </p>
  476.  
  477. <p>Please note that for the transfinite cardinals represented
  478. by Hebrew characters, the codepoints U+2135-U+2138 (ALEF SYMBOL,
  479. BET SYMBOL, GIMEL SYMBOL, DALET SYMBOL) should be used.
  480. These are strong left-to-right.</p>
  481. </div4>
  482.  
  483. <div4><head>Bidirectional Layout of Mathematics Formulas</head>
  484.  
  485. <p>MathML 2.0 does not address right-to-left or bidirectional
  486. layout in mathematics formulas. Only left-to-right layout is
  487. supported. Right-to-left layout of mathematical formulas
  488. may be addressed in a future version of MathML.</p>
  489.  
  490. </div4>
  491.  
  492. </div3>
  493.  
  494. <div3 id="presm_summary"><head>Summary of Presentation Elements</head>
  495.  
  496. <div4><head>Token Elements</head>
  497. <table border="1">
  498. <tbody>
  499. <tr>
  500. <td><intref ref="presm_mi"><kw role="element">mi</kw></intref></td> 
  501. <td>identifier</td>
  502. </tr>
  503. <tr>
  504. <td><intref ref="presm_mn"><kw role="element">mn</kw></intref></td> 
  505. <td>number</td>
  506. </tr>
  507. <tr>
  508. <td><intref ref="presm_mo"><kw role="element">mo</kw></intref></td> 
  509. <td>operator, fence, or separator</td>
  510. </tr>
  511. <tr>
  512. <td><intref ref="presm_mtext"><kw role="element">mtext</kw></intref></td> 
  513. <td>text</td>
  514. </tr>
  515. <tr>
  516. <td><intref ref="presm_mspace"><kw role="element">mspace</kw></intref></td> 
  517. <td>space</td>
  518. </tr>
  519. <tr>
  520. <td><intref ref="presm_ms"><kw role="element">ms</kw></intref></td> 
  521. <td>string literal</td>
  522. </tr>
  523. <tr>
  524. <td><intref ref="presm_mglyph"><kw role="element">mglyph</kw></intref></td> 
  525. <td>adding new character glyphs to MathML</td>
  526. </tr>
  527. </tbody>
  528. </table>
  529. </div4>
  530.  
  531. <div4><head>General Layout Schemata</head>
  532. <table border="1">
  533. <tbody>
  534. <tr>
  535. <td><intref ref="presm_mrow"><kw role="element">mrow</kw></intref></td> 
  536. <td>group any number of sub-expressions horizontally</td>
  537. </tr>
  538. <tr>
  539. <td><intref ref="presm_mfrac"><kw role="element">mfrac</kw></intref></td> 
  540. <td>form a fraction from two sub-expressions</td>
  541. </tr>
  542. <tr>
  543. <td><intref ref="presm_mroot"><kw role="element">msqrt</kw></intref></td> 
  544. <td>form a square root (radical without an index)</td>
  545. </tr>
  546. <tr>
  547. <td><intref ref="presm_mroot"><kw role="element">mroot</kw></intref></td> 
  548. <td>form a radical with specified index</td>
  549. </tr>
  550. <tr>
  551. <td><intref ref="presm_mstyle"><kw role="element">mstyle</kw></intref></td> 
  552. <td>style change</td>
  553. </tr>
  554. <tr>
  555. <td><intref ref="presm_merror"><kw role="element">merror</kw></intref></td> 
  556. <td>enclose a syntax error message from a preprocessor</td>
  557. </tr>
  558. <tr>
  559. <td><intref ref="presm_mpadded"><kw role="element">mpadded</kw></intref></td> 
  560. <td>adjust space around content</td>
  561. </tr>
  562. <tr>
  563. <td><intref ref="presm_mphantom"><kw role="element">mphantom</kw></intref></td> 
  564. <td>make content invisible but preserve its size</td>
  565. </tr>
  566. <tr>
  567. <td><intref ref="presm_mfenced"><kw role="element">mfenced</kw></intref></td> 
  568. <td>surround content with a pair of fences</td>
  569. </tr>
  570. <tr>
  571. <td><intref ref="presm_menclose"><kw role="element">menclose</kw></intref></td> 
  572. <td>enclose content with a stretching symbol such as a long division sign.</td>
  573. </tr>
  574. </tbody>
  575. </table>
  576. </div4>
  577.  
  578. <div4><head>Script and Limit Schemata</head>
  579. <table border="1">
  580. <tbody>
  581. <tr>
  582. <td><intref ref="presm_msub"><kw role="element">msub</kw></intref></td> 
  583. <td>attach a subscript to a base</td>
  584. </tr>
  585. <tr>
  586. <td><intref ref="presm_msup"><kw role="element">msup</kw></intref></td> 
  587. <td>attach a superscript to a base</td>
  588. </tr>
  589. <tr>
  590. <td><intref ref="presm_msubsup"><kw role="element">msubsup</kw></intref></td> 
  591. <td>attach a subscript-superscript pair to a base</td>
  592. </tr>
  593. <tr>
  594. <td><intref ref="presm_munder"><kw role="element">munder</kw></intref></td> 
  595. <td>attach an underscript to a base</td>
  596. </tr>
  597. <tr>
  598. <td><intref ref="presm_mover"><kw role="element">mover</kw></intref></td> 
  599. <td>attach an overscript to a base</td>
  600. </tr>
  601. <tr>
  602. <td><intref ref="presm_munderover"><kw role="element">munderover</kw></intref></td> 
  603. <td>attach an underscript-overscript pair to a base</td>
  604. </tr>
  605. <tr>
  606. <td><intref ref="presm_mmultiscripts"><kw role="element">mmultiscripts</kw></intref></td> 
  607. <td>attach prescripts and tensor indices to a base</td>
  608. </tr>
  609. </tbody>
  610. </table>
  611. </div4>
  612.  
  613. <div4><head>Tables and Matrices</head>
  614. <table border="1">
  615. <tbody>
  616. <tr>
  617. <td><intref ref="presm_mtable"><kw role="element">mtable</kw></intref></td> 
  618. <td>table or matrix</td>
  619. </tr>
  620. <tr>
  621. <td><intref ref="presm_mlabeledtr"><kw role="element">mlabeledtr</kw></intref></td> 
  622. <td>row in a table or matrix with a label or equation number</td>
  623. </tr>
  624. <tr>
  625. <td><intref ref="presm_mtr"><kw role="element">mtr</kw></intref></td> 
  626. <td>row in a table or matrix</td>
  627. </tr>
  628. <tr>
  629. <td><intref ref="presm_mtd"><kw role="element">mtd</kw></intref></td> 
  630. <td>one entry in a table or matrix</td>
  631. </tr>
  632. <tr>
  633. <td>
  634. <intref ref="presm_malign"><kw role="element">maligngroup</kw></intref> and
  635. <intref ref="presm_malign"><kw role="element">malignmark</kw></intref></td> 
  636. <td>alignment markers</td>
  637. </tr>
  638. </tbody>
  639. </table>
  640. </div4>
  641.  
  642. <div4><head>Enlivening Expressions</head>
  643. <table border="1">
  644. <tbody>
  645. <tr>
  646. <td><intref ref="presm_maction"><kw role="element">maction</kw></intref></td> 
  647. <td>bind actions to a sub-expression</td>
  648. </tr>
  649. </tbody>
  650. </table>
  651. </div4>
  652. </div3>
  653. </div2>
  654.  
  655. <div2 id="presm_tokel"><head>Token Elements</head>
  656.  
  657. <p>Token elements in presentation markup are broadly intended to
  658. represent the smallest units of mathematical notation which carry
  659. meaning.  Tokens are roughly analogous to words in text.  However,
  660. because of the precise, symbolic nature of mathematical notation, the
  661. various categories and properties of token elements figure prominently in
  662. MathML markup.  By contrast, in textual data, individual words rarely
  663. need to be marked up or styled specially.</p>
  664.  
  665. <p>Frequently tokens consist of a single character denoting a
  666. mathematical symbol.  Other cases, e.g. function names, involve
  667. multi-character tokens.  Further, because traditional mathematical
  668. notation makes wide use of symbols distinguished by their
  669. typographical properties (e.g. a Fraktur 'g' for a Lie algebra, or a
  670. bold 'x' for a vector), care must be taken to insure that styling
  671. mechanisms respect typographical properties which carry meaning.
  672. Consequently, characters, tokens, and typographical properties of
  673. symbols are closely related to one another in MathML.
  674. </p>
  675.  
  676. <div3 id="presm_tokenchars"><head>MathML characters in
  677. token elements</head>
  678.  
  679. <p>Character data in MathML markup is only allowed to occur as part of
  680. the content of token elements.  The only exception is whitespace
  681. between elements, which is ignored.  Token elements can
  682. contain any sequence of zero or more Unicode characters.  In
  683. particular, tokens with empty content are allowed, and should
  684. typically render invisibly, with no width except for the normal extra
  685. spacing for that kind of token element.  The exceptions to this are
  686. the empty elements <kw role="element">mspace</kw> and
  687. <kw role="element">mglyph</kw>.
  688. The <kw role="element">mspace</kw> element's width depends upon
  689. its attribute values.
  690. The <kw role="element">mglyph</kw> element
  691. renders using the character described by its attributes.</p>
  692.  
  693. <p>While all Unicode character data is valid in token element content, MathML
  694. 2.0 distinguishes a special subset of named Unicode 3.2 characters,
  695. called MathML characters in this document.
  696. The complete list of MathML characters is defined in
  697. <specref ref="chars"/>.  MathML characters can be either represented
  698. directly as Unicode character data, or indirectly via numeric or
  699. character entity references.  See <specref ref="chars"/> for a
  700. discussion of the advantages and disadvantages of numeric 
  701. character references versus
  702. entity references.  New mathematics characters that arise, or non-standard
  703. glyphs for existing MathML characters, may be represented by means of
  704. the <kw role="element">mglyph</kw> element.</p>
  705.  
  706. <p>Apart from the <kw role="element">mglyph</kw> element, the <kw
  707. role="element">malignmark</kw> element is the only other element
  708. allowed in the content of tokens.  See <specref ref="presm_malign"/>
  709. for details.</p>
  710.  
  711. <p>Token elements (other than <kw role="element">mspace</kw> and
  712. <kw role="element">mglyph</kw>) should
  713. be rendered as their content (i.e. in the visual case, as a
  714. closely-spaced horizontal row of standard glyphs for the characters in
  715. their content). Rendering algorithms should also take into account the
  716. mathematics style attributes as described below, and modify surrounding
  717. spacing by rules or attributes specific to each type of token
  718. element.</p>
  719.  
  720. <div4 id="presm_symbolchars"><head>Alphanumeric symbol
  721. characters</head> 
  722.  
  723. <p>A large class of mathematical symbols are single letter identifiers
  724. typically used as variable names in formulas.  Different font variants
  725. of a letter are treated as separate symbols.  For example, a Fraktur
  726. 'g' might denote a Lie algebra, while a Roman 'g' denotes the
  727. corresponding Lie group.  These letter-like symbols are traditionally
  728. typeset differently than the same characters appearing in text, using
  729. different spacing and ligature conventions.  These characters must
  730. also be treated specially by style mechanisms, since arbitrary style
  731. transformations can change meaning in an expression.  </p>
  732.  
  733. <p>For these reasons, Unicode 3.1 will be adding more than nine
  734. hundred Math Alphanumeric Symbol characters corresponding to letter-like
  735. symbols.  These characters are in the Secondary Multilingual Plane
  736. (SMP).  See <specref ref="chars"/> for more information.
  737. As valid Unicode data, these characters are permitted in MathML 2.0, and as
  738. tools and fonts for them become widely available, we anticipate they
  739. will be the predominant way of denoting letter-like symbols.</p>
  740.  
  741. <p>Until support for SMP characters is widely available, however, it
  742. is still necessary to provide an alternative encoding using only Basic
  743. Multilingual Plane (BMP) characters together with markup.  MathML 2.0
  744. defines a correspondence between token elements with certain
  745. combinations of BMP character data and the <kw
  746. role="attrib">mathvariant</kw> attribute and tokens containing SMP
  747. Math Alphanumeric Symbol characters.  Processing applications that accept SMP
  748. characters are required to treat the corresponding BMP and attribute
  749. combinations identically.  The next section discusses the <kw
  750. role="attrib">mathvariant</kw> attribute in more detail, and a
  751. complete technical description of the corresponding characters is given in
  752. <specref ref="chars_BMP-SMP"/>.</p>
  753.  
  754. </div4>
  755. </div3>
  756.  
  757. <div3 id="presm_commatt"><head>Mathematics style attributes common to token
  758. elements</head> 
  759.  
  760. <p>MathML 2.0 introduces four new <emph>mathematics style</emph> attributes.
  761. These attributes are valid on all presentation token elements except
  762. <kw role="element">mspace</kw> and <kw role="element">mglyph</kw>, and
  763. on no other elements except <kw role="element">mstyle</kw>.  The attributes
  764. are:
  765.  
  766. <table border="1">
  767. <thead>
  768. <tr>
  769. <td>Name</td>
  770. <td>values</td>
  771. <td>default</td>
  772. </tr>
  773. </thead>
  774. <tbody>
  775. <tr>
  776. <td>mathvariant</td>
  777. <td>
  778. normal | bold | italic | bold-italic | double-struck | 
  779. bold-fraktur | script | bold-script |
  780. fraktur | sans-serif | bold-sans-serif | sans-serif-italic |
  781. sans-serif-bold-italic | monospace</td>
  782. <td>normal (<emph>except on</emph> <kw role="starttag">mi</kw>)</td>
  783. </tr>
  784. <tr>
  785. <td>mathsize</td>
  786. <td>small | normal | big | number v-unit</td>
  787. <td>inherited</td>
  788. </tr>
  789. <tr>
  790. <td>mathcolor</td>
  791. <td>#rgb | #rrggbb | html-color-name</td>
  792. <td>inherited</td>
  793. </tr>
  794. <tr>
  795. <td>mathbackground</td>
  796. <td>#rgb | #rrggbb | html-color-name</td>
  797. <td>inherited</td>
  798. </tr>
  799. </tbody>
  800. </table>
  801. </p>
  802.  
  803. <p>(See <specref ref="fund_attval"/> for terminology and
  804. notation used in attribute value descriptions.)</p>
  805.  
  806. <p>The mathematics style attributes define logical classes of token
  807. elements.  Each class is intended to correspond to a collection of
  808. typographically-related symbolic tokens that have a meaning within a
  809. given math expression, and therefore need to be visually distinguished
  810. and protected from inadvertent document-wide style changes which might
  811. change their meanings.</p>
  812.  
  813. <p>When MathML rendering takes place in an environment where CSS is
  814. available, the mathematics style attributes can be viewed as
  815. predefined selectors for CSS style rules.  See <specref
  816. ref="interf_style"/> and <specref ref="stylesheet"/> for further
  817. discussion and a sample CSS style sheet.  When CSS is not available,
  818. it is up to the internal style mechanism of the rendering application
  819. to visually distinguish the different logical classes.</p>
  820.  
  821. <p>At a theoretical level, renderers have complete freedom in
  822. mapping mathematics style attributes to specific rendering properties.
  823. However, in practice, the mathematics style attribute names and values
  824. suggest obvious typographical properties, and renderers should attempt
  825. to respect these natural interpretations as far as possible.  For
  826. example, it is reasonable to render a token with the <kw
  827. role="attrib">mathvariant</kw> attribute set to <kw
  828. role="attval">sans-serif</kw> in Helvetica or Arial.  However,
  829. rendering the token in a Times Roman font could
  830. be seriously misleading and should be avoided. </p>
  831.  
  832. <p>A issue arises in that the natural interpretations of the <kw
  833. role="attrib">mathvariant</kw> attribute values only make sense for
  834. certain characters.  For example, there is no clear cut rendering for
  835. a 'fraktur' alpha, or a 'bold italic' Kanji character.  In general,
  836. the only cases that have a clear interpretation are exactly the ones
  837. that correspond to SMP Math Alphanumeric Symbol characters.</p>
  838.  
  839. <p>Consequently, style sheet authors and application developers are
  840. encouraged in the strongest possible terms to respect the obvious
  841. typographical interpretation of the <kw role="attrib">mathvariant</kw>
  842. attribute when applied to characters that have SMP Math Alphanumeric Symbol
  843. counterparts.  In all other cases, it is up to the renderer to
  844. determine what effect, if any, the <kw role="attrib">mathvariant</kw>
  845. attribute will have.  For example, a renderer might sensibly choose to
  846. display a token with the contents <kw role="entity">sum</kw> (a
  847. character with no SMP counterpart) in bold face font if it has the <kw
  848. role="attrib">mathvariant</kw> attribute set to <kw
  849. role="attval">bold</kw> or to <kw role="attval">bold-fraktur</kw>, and
  850. to display it in a default Roman font if the <kw
  851. role="attrib">mathvariant</kw> attribute is set to <kw
  852. role="attval">fraktur</kw>.  As this example indicates, authors should
  853. refrain from using the <kw role="attrib">mathvariant</kw>
  854. attribute with characters that do not have SMP counterparts, since
  855. renderings may not be useful or predictable.</p>
  856.  
  857. <p>Finally, there is a redundancy problem with the <kw
  858. role="attrib">mathvariant</kw> attribute that must be dealt with as a
  859. special case.  When the <kw role="attrib">mathvariant</kw> attribute
  860. is used on an <kw role="element">mi</kw> element containing a single
  861. character from the specific ranges of BMP character data detailed in
  862. <specref ref="chars_BMP-SMP"/>, the resulting rendering
  863. will be visually indistinguishable from an <kw role="element">mi</kw>
  864. element with no attributes containing the corresponding SMP
  865. character.  Therefore MathML 2.0 mandates that processing applications
  866. treat these two representations as equivalent.  This is primarily an
  867. issue for applications that support searching and/or equality
  868. testing.</p>
  869.  
  870. <p>Token elements also permit <kw role="attrib">id</kw>,
  871. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  872. <kw role="attrib">style</kw>
  873. attributes for compatibility with style sheet
  874. mechanisms, as described in <specref ref="fund_globatt"/>.
  875. However, some care must be taken when using CSS generally.  Using CSS to
  876. produce visual effects that alter the meaning of an equation should be
  877. especially avoided, since MathML is used in many non-CSS environments.
  878. Similarly, care should be taken to insure arbitrary document-wide
  879. style transformations do not affect mathematics expressions in such a way
  880. that meaning is altered.</p>
  881.  
  882. <p>Since MathML expressions are often embedded in a textual data
  883. format such as XHTML, the surrounding text and the MathML must share
  884. rendering attributes such as font size, so that the renderings will be
  885. compatible in style. For this reason, most attribute values affecting
  886. text rendering are inherited from the rendering environment, as shown
  887. in the <quote>default</quote> column in the table above. (In
  888. cases where the surrounding text and the MathML are being rendered by
  889. separate software, e.g. a browser and a plug-in, it is also important
  890. for the rendering environment to provide the MathML renderer with
  891. additional information, such as the baseline position of surrounding
  892. text, which is not specified by any MathML attributes.)
  893. Note, however, that MathML 2.0 doesn't specify the mechanism by which
  894. style information is inherited from the rendering environment.
  895. For example, one browser plug-in might choose to rely
  896. completely on the CSS inheritance mechanism and use the fully resolved
  897. CSS properties for rendering, while another application might only consult
  898. a style environment at the root node, and then use its own internal style
  899. inheritance rules.</p>
  900.  
  901. <p>Most MathML renderers will probably want to rely on some degree to
  902. additional, internal style processing algorithms.  In particular,
  903. inheritance of the <kw role="attrib">mathvariant</kw> attribute does
  904. not follow the CSS model.  The default value for this attribute is <kw
  905. role="attval">normal</kw> (non-slanted) for all tokens except
  906. <kw role="element">mi</kw>.
  907. For <kw role="element">mi</kw> tokens, the default depends on the number of
  908. characters in tokens' content.  (The <intref
  909. ref="interf_deprec">deprecated</intref> <kw
  910. role="attrib">fontslant</kw> attribute also behaves this way.) See
  911. <specref ref="presm_mi"/> for details.  
  912. </p>
  913.  
  914.  
  915. <div4 id="presm_deprecatt"><head>Deprecated style attributes on token
  916. elements</head> 
  917.  
  918. <p>The MathML 1.01 style attributes listed below have been <intref
  919. ref="interf_deprec">deprecated</intref> in MathML 2.0.  In
  920. rendering environments that support CSS, it is preferable to use CSS
  921. to control the rendering properties corresponding to these attributes.
  922. However as explained above, direct manipulation of these rendering
  923. properties by whatever means should usually be avoided.</p>
  924.  
  925. <p>If both a new mathematics style attribute and conflicting deprecated
  926. attributes are given, the new math style attribute value should be
  927. used.  For example
  928.  
  929. <eg role='mathml'><![CDATA[
  930. <mi fontweight='bold' mathvariant='normal'> a </mi>
  931. ]]></eg>
  932.  
  933. should render in a normal weight font, and
  934.  
  935. <eg role='mathml'><![CDATA[
  936. <mi fontweight='bold' mathvariant='sans-serif'> a </mi>
  937. ]]></eg>
  938.  
  939. should render in a normal weight sans serif font.  In the example
  940.  
  941. <eg role='mathml'><![CDATA[
  942. <mi fontweight='bold' mathvariant='fraktur'> a1 </mi>
  943. ]]></eg>
  944.  
  945. the <kw role="attrib">mathvariant</kw> attribute still overrides <kw
  946. role="attrib">fontweight</kw> attribute, even though <kw
  947. role="attval">fraktur</kw> generally shouldn't be applied to a '1'
  948. since there is no corresponding SMP Math Alphanumeric Symbol
  949. character.  In the absence of fonts containing Fraktur digits,
  950. this would probably render as a Fraktur 'a' followed by a Roman '1' in
  951. most renderers.</p>
  952.  
  953. <p>The new mathematics style attributes also override deprecated 1.01
  954. style attribute values that are inherited.  Thus
  955.  
  956. <eg role='mathml'><![CDATA[
  957. <mstyle fontstyle='italic'>
  958.   <mi mathvariant='bold'> a </mi>
  959. </mstyle>
  960. ]]></eg>
  961.  
  962. renders in a bold upright font, not a bold italic font.</p>
  963.  
  964. <p>At the same time, the MathML 1.01 attributes still serve a
  965. purpose. Since they correspond directly to rendering properties needed
  966. for mathematics layout, they are very useful for describing MathML layout
  967. rules and algorithms.  For this reason, and for backward compatibility,
  968. the MathML rendering rules suggested in this chapter continue to be
  969. described in terms of the rendering properties described by these
  970. MathML 1.01 style attributes.</p>
  971.  
  972. <p>The deprecated attributes are:
  973.  
  974. <table border="1">
  975. <thead>
  976. <tr>
  977. <td>Name</td>
  978. <td>values</td>
  979. <td>default</td>
  980. </tr>
  981. </thead>
  982. <tbody>
  983. <tr>
  984. <td>fontsize</td>
  985. <td>number v-unit</td>
  986. <td>inherited</td>
  987. </tr>
  988. <tr>
  989. <td>fontweight</td>
  990. <td>normal | bold</td>
  991. <td>inherited</td>
  992. </tr>
  993. <tr>
  994. <td>fontstyle</td>
  995. <td>normal | italic</td>
  996. <td>normal (<emph>except on</emph> <kw role="starttag">mi</kw>)</td>
  997. </tr>
  998. <tr>
  999. <td>fontfamily</td>
  1000. <td>string | css-fontfamily</td>
  1001. <td>inherited</td>
  1002. </tr>
  1003. <tr>
  1004. <td>color</td>
  1005. <td>#rgb | #rrggbb | html-color-name</td>
  1006. <td>inherited</td>
  1007. </tr>
  1008. </tbody>
  1009. </table>
  1010. </p>
  1011.  
  1012. <p>The <kw role="attrib">fontsize</kw> attribute specifies the desired
  1013. font size.  <kw role="attrib">v-unit</kw> represents a unit of
  1014. vertical length (see <specref ref="fund_cssatt"/>). The most common
  1015. unit for specifying font sizes in typesetting is <code>pt</code>
  1016. (points).</p>
  1017.  
  1018. <p>If the requested size of the current font is not available, the
  1019. renderer should approximate it in the manner likely to lead to the
  1020. most intelligible, highest quality rendering.</p>
  1021.  
  1022. <p>Many MathML elements automatically change <kw
  1023. role="attrib">fontsize</kw> in some of their children; see the
  1024. discussion of <kw role="attrib">scriptlevel</kw> in the section on <kw
  1025. role="element">mstyle</kw>, <specref ref="presm_mstyle"/>.</p>
  1026.  
  1027. <p>The value of the <kw role="attrib">fontfamily</kw> attribute should
  1028. be the name of a font that may be available to a MathML renderer, or
  1029. information that permits the renderer to select a font in some manner;
  1030. acceptable values and their meanings are dependent on the specific
  1031. renderer and rendering environment in use, and are not specified by
  1032. MathML (but see the note about <kw role="attrib">css-fontfamily</kw>
  1033. below). (Note that the renderer's mechanism for finding fonts by name
  1034. may be case-sensitive.)</p>
  1035.  
  1036. <p>If the value of <kw role="attrib">fontfamily</kw> is not recognized by a
  1037. particular MathML renderer, this should never be interpreted as a
  1038. MathML error; rather, the renderer should either use a font that it
  1039. considers to be a suitable substitute for the requested font, or
  1040. ignore the attribute and act as if no value had been given.</p>
  1041.  
  1042. <p>Note that any use of the <kw role="attrib">fontfamily</kw>
  1043. attribute is unlikely to be portable across all MathML renderers. In
  1044. particular, it should never be used to try to achieve the effect of a
  1045. reference to a non-ASCII MathML character (for example, by using a
  1046. reference to a character in some symbol font that maps ordinary
  1047. characters to glyphs for non-ASCII characters). As a corollary to this
  1048. principle, MathML renderers should attempt to always produce
  1049. intelligible renderings for the MathML characters listed in <specref
  1050. ref="chars"/>, even when these characters are not available in the
  1051. font family indicated. Such a rendering is always possible – as
  1052. a last resort, a character can be rendered to appear as an XML-style
  1053. entity reference using one of the entity names given for the same
  1054. character in <specref ref="chars"/>.</p>
  1055.  
  1056. <p>The symbol <kw role="attrib">css-fontfamily</kw> refers to a legal
  1057. value for the <kw role="attrib">font-family</kw> property in CSS,
  1058. which is a comma-separated list of alternative font family names or
  1059. generic font types in order of preference, as documented in more
  1060. detail in CSS<bibref ref="CSS2"/>.
  1061. MathML renderers are encouraged to make use of the CSS
  1062. syntax for specifying fonts when this is practical in their rendering
  1063. environment, even if they do not otherwise support CSS. (See also the
  1064. subsection CSS-compatible attributes within <specref
  1065. ref="fund_cssatt"/>).</p>
  1066. </div4>
  1067.  
  1068. <div4 id="presm_color"><head>Color-related attributes</head> 
  1069.  
  1070. <p>The <kw role="attrib">mathcolor</kw> (and deprecated <kw role="attrib">color</kw>) attribute controls the color in which the
  1071. content of tokens is rendered. Additionally, when inherited from
  1072. <kw role="element">mstyle</kw> or from a MathML expression's rendering
  1073. environment, it controls the color of all other drawing by MathML
  1074. elements, including the lines or radical signs that can be drawn by
  1075. <kw role="element">mfrac</kw>, <kw role="element">mtable</kw>, or
  1076. <kw role="element">msqrt</kw>.</p>
  1077.  
  1078. <p>The values of 
  1079. <kw role="attrib">mathcolor</kw>,
  1080. <kw role="attrib">color</kw>,
  1081. <kw role="attrib">mathbackground</kw>,
  1082. and <kw role="attrib">background</kw> can be specified as
  1083. a string consisting of '#' followed without intervening whitespace by
  1084. either 1-digit or 2-digit hexadecimal values for the red, green, and
  1085. blue components, respectively, of the desired color, with the same
  1086. number of digits used for each component (or as the keyword
  1087. <quote>transparent</quote> for <kw role="attrib">background</kw>). The hexadecimal digits are not
  1088. case-sensitive. The possible 1-digit values range from 0 (component
  1089. not present) to F (component fully present), and the possible 2-digit
  1090. values range from 00 (component not present) to FF (component fully
  1091. present), with the 1-digit value <mi>x</mi> being equivalent to the
  1092. 2-digit value <emph>xx</emph> (rather than <emph>x0</emph>).
  1093. % <mi>x</mi>0 would be a more strictly correct notation,
  1094. but renders terribly in some browsers.</p>
  1095.  
  1096. <p>These attributes can also be specified as an
  1097. <kw role="attrib">html-color-name</kw>, which is defined below.</p>
  1098.  
  1099. <p>The color syntax described above is a subset of the syntax of the <kw
  1100. role="attrib">color</kw> and <kw role="attrib">background-color</kw>
  1101. properties of CSS. The <kw role="attrib">background-color</kw> syntax
  1102. is in turn a subset of the full CSS <kw role="attrib">background</kw>
  1103. property syntax, which also permits specification of (for example)
  1104. background images with optional repeats. The more general attribute name
  1105. <kw role="attrib">background</kw> is used in MathML to facilitate possible
  1106. extensions to the attribute's scope in future versions of MathML.</p>
  1107.  
  1108. <p>Color values on either attribute can also be specified as an <kw
  1109. role="attrib">html-color-name</kw>, that is, as one of the color-name
  1110. keywords defined in <bibref ref="HTML4"/>
  1111. (<kw role="attval">aqua</kw>,
  1112. <kw role="attval">black</kw>,
  1113. <kw role="attval">blue</kw>,
  1114. <kw role="attval">fuchsia</kw>,
  1115. <kw role="attval">gray</kw>,
  1116. <kw role="attval">green</kw>,
  1117. <kw role="attval">lime</kw>,
  1118. <kw role="attval">maroon</kw>,
  1119. <kw role="attval">navy</kw>,
  1120. <kw role="attval">olive</kw>,
  1121. <kw role="attval">purple</kw>,
  1122. <kw role="attval">red</kw>,
  1123. <kw role="attval">silver</kw>,
  1124. <kw role="attval">teal</kw>,
  1125. <kw role="attval">white</kw>, and
  1126. <kw role="attval">yellow</kw>).
  1127. Note that the color name keywords are not case-sensitive, unlike most 
  1128. keywords in MathML attribute values for compatibility with CSS and HTML.</p>
  1129.  
  1130. <p>The suggested MathML visual rendering rules do not define the
  1131. precise extent of the region whose background is affected by using the
  1132. <kw role="attrib">background</kw> attribute on <kw role="element">mstyle</kw>,
  1133. except that, when <kw role="element">mstyle</kw>'s content does not have
  1134. negative dimensions and its drawing region is not overlapped by other
  1135. drawing due to surrounding negative spacing, this region should lie
  1136. behind all the drawing done to render the content of the
  1137. <kw role="element">mstyle</kw>, but should not lie behind any of the
  1138. drawing done to render surrounding expressions. The effect of overlap
  1139. of drawing regions caused by negative spacing on the extent of the
  1140. region affected by the <kw role="attrib">background</kw> attribute is not
  1141. defined by these rules.</p>
  1142.  
  1143. </div4>
  1144. </div3>
  1145.  
  1146. <div3 id="presm_mi"><head>Identifier (<kw role="element">mi</kw>)</head>
  1147.  
  1148. <div4><head>Description</head>
  1149.  
  1150. <p>An <kw role="element">mi</kw> element represents a symbolic name or
  1151. arbitrary text that should be rendered as an identifier. Identifiers
  1152. can include variables, function names, and symbolic constants.</p>
  1153.  
  1154. <p>Not all <quote>mathematical identifiers</quote> are represented by
  1155. <kw role="element">mi</kw> elements – for example, subscripted or primed
  1156. variables should be represented using <kw role="element">msub</kw> or
  1157. <kw role="element">msup</kw> respectively. Conversely, arbitrary text
  1158. playing the role of a <quote>term</quote> (such as an ellipsis in a summed series)
  1159. can be represented using an <kw role="element">mi</kw> element, as shown
  1160. in an example in <specref ref="presm_mixtextmath"/>.</p>
  1161.  
  1162. <p>It should be stressed that <kw role="element">mi</kw> is a
  1163. presentation element, and as such, it only indicates that its content
  1164. should be rendered as an identifier. In the majority of cases, the
  1165. contents of an <kw role="element">mi</kw> will actually represent a
  1166. mathematical identifier such as a variable or function name. However,
  1167. as the preceding paragraph indicates, the correspondence between
  1168. notations that should render like identifiers and notations that are
  1169. actually intended to represent mathematical identifiers is not
  1170. perfect. For an element whose semantics is guaranteed to be that of an
  1171. identifier, see the description of <kw role="element">ci</kw> in 
  1172. <specref ref="contm"/>.</p>
  1173. </div4>
  1174.  
  1175. <div4><head>Attributes</head>
  1176. <p><kw role="element">mi</kw> elements accept the attributes listed in
  1177. <specref ref="presm_commatt"/>, but in one case with a different default value:
  1178. <table border="1">
  1179. <thead>
  1180. <tr>
  1181. <td>Name</td>
  1182. <td>values</td>
  1183. <td>default</td>
  1184. </tr>
  1185. </thead>
  1186. <tbody>
  1187. <tr>
  1188. <td>mathvariant</td>
  1189. <td>normal | bold | italic | bold-italic | double-struck |
  1190.   bold-fraktur | script | bold-script |
  1191. fraktur | sans-serif | bold-sans-serif | sans-serif-italic |
  1192. sans-serif-bold-italic | monospace</td>
  1193. <td>(depends on content; described below)</td>
  1194. </tr>
  1195. <tr>
  1196. <td>fontstyle (<intref ref="interf_deprec">deprecated</intref>)</td>
  1197. <td>normal | italic</td>
  1198. <td>(depends on content; described below)</td>
  1199. </tr>
  1200. </tbody>
  1201. </table>
  1202. </p>
  1203.  
  1204. <p>A typical graphical renderer would render an <kw
  1205. role="element">mi</kw> element as the characters in its content, with
  1206. no extra spacing around the characters (except spacing associated with
  1207. neighboring elements). The default <kw role="attrib">mathvariant</kw>
  1208. and <kw role="attrib">fontstyle</kw> would (typically) be <kw
  1209. role="attval">normal</kw> (non-slanted) unless the content is a single
  1210. character, in which case it would be <kw
  1211. role="attval">italic</kw>. Note that this rule for <kw
  1212. role="attrib">mathvariant</kw> and <kw role="attrib">fontstyle</kw>
  1213. attributes is specific to <kw role="element">mi</kw> elements; the
  1214. default value for the <kw role="attrib">mathvariant</kw> and <kw
  1215. role="attrib">fontstyle</kw> attributes on other MathML token elements
  1216. is <kw role="attval">normal</kw>.</p> 
  1217.  
  1218. <p>Note that for purposes of determining equivalences of Math
  1219. Alphanumeric Symbol
  1220. characters (See <specref ref="chars_BMP-SMP"/> and <specref
  1221. ref="presm_symbolchars"/>) the value of the <kw 
  1222. role="attrib">mathvariant</kw> attribute should be resolved first,
  1223. including the special defaulting behavior described above.
  1224. </p>
  1225. </div4>
  1226.  
  1227. <div4><head>Examples</head>
  1228. <eg role='mathml'><![CDATA[
  1229. <mi> x </mi>
  1230. <mi> D </mi>
  1231. <mi> sin </mi>
  1232. <mi mathvariant='script'> L </mi>
  1233. <mi></mi>
  1234. ]]></eg>
  1235.  
  1236. <p>An <kw role="element">mi</kw> element with no content is allowed;
  1237. <code><mi></mi></code> might, for example, be used by an
  1238. <quote>expression editor</quote> to represent a location in a MathML expression
  1239. which requires a <quote>term</quote> (according to conventional syntax for
  1240. mathematics) but does not yet contain one.</p>
  1241.  
  1242. <p>Identifiers include function names such as
  1243. <quote>sin</quote>. Expressions such as <quote>sin <mi>x</mi></quote>
  1244. should be written using the <kw role="entity">ApplyFunction</kw> operator
  1245. (which also has the short name <kw role="entity">af</kw>) as shown below;
  1246. see also the discussion of invisible operators in <specref
  1247. ref="presm_mo"/>.
  1248. <eg role='mathml'><![CDATA[
  1249. <mrow>
  1250.   <mi> sin </mi>
  1251.   <mo> ⁡ </mo>
  1252.   <mi> x </mi>
  1253. </mrow>
  1254. ]]></eg>
  1255. </p>
  1256.  
  1257. <p>Miscellaneous text that should be treated as a <quote>term</quote> can also be
  1258. represented by an <kw role="element">mi</kw> element, as in:
  1259. <eg role='mathml'><![CDATA[
  1260. <mrow>
  1261.   <mn> 1 </mn>
  1262.   <mo> + </mo>
  1263.   <mi> ... </mi>
  1264.   <mo> + </mo>
  1265.   <mi> n </mi>
  1266. </mrow>
  1267. ]]></eg>
  1268. </p>
  1269.  
  1270. <p>When an <kw role="element">mi</kw> is used in such exceptional
  1271. situations, explicitly setting the <kw role="attrib">fontstyle</kw> attribute
  1272. may give better results than the default behavior of some
  1273. renderers.</p>
  1274.  
  1275. <p>The names of symbolic constants should be represented as
  1276. <kw role="element">mi</kw> elements:
  1277. <eg role='mathml'><![CDATA[
  1278. <mi> π </mi>
  1279. <mi> ⅈ </mi>
  1280. <mi> ⅇ </mi>
  1281. ]]></eg>
  1282. </p>
  1283.  
  1284. <p>Use of special entity references for such constants can simplify
  1285. the interpretation of MathML presentation elements.
  1286. See <specref ref="chars"/> for a complete list of character entity
  1287. references in MathML.</p>
  1288. </div4>
  1289. </div3>
  1290.  
  1291. <div3 id="presm_mn"><head>Number (<kw role="element">mn</kw>)</head>
  1292.  
  1293. <div4><head>Description</head>
  1294.  
  1295. <p>An <kw role="element">mn</kw> element represents a <quote>numeric
  1296. literal</quote> or other data that should be rendered as a numeric
  1297. literal. Generally speaking, a numeric literal is a sequence of digits,
  1298. perhaps including a decimal point, representing an unsigned integer or real
  1299. number.</p>
  1300.  
  1301. <p>The mathematical concept of a <quote>number</quote> can be quite 
  1302. subtle and involved, depending on the context. As a consequence, not all
  1303. mathematical numbers should be represented using <kw
  1304. role="element">mn</kw>; examples of mathematical numbers that should be
  1305. represented differently are shown below, and include 
  1306. complex numbers, ratios of numbers shown as fractions, and names of numeric
  1307. constants.</p>
  1308.  
  1309. <p>Conversely, since <kw role="element">mn</kw> is a presentation
  1310. element, there are a few situations where it may desirable to include
  1311. arbitrary text in the content of an <kw role="element">mn</kw> that
  1312. should merely render as a numeric literal, even though that content
  1313. may not be unambiguously interpretable as a number according to any
  1314. particular standard encoding of numbers as character sequences. As a
  1315. general rule, however, the <kw role="element">mn</kw> element should be
  1316. reserved for situations where its content is actually intended to
  1317. represent a numeric quantity in some fashion.  For an element whose
  1318. semantics are guaranteed to be that of a particular kind of
  1319. mathematical number, see the description of <kw role="element">cn</kw> in
  1320. <specref ref="contm"/>.</p>
  1321. </div4>
  1322.  
  1323. <div4><head>Attributes</head>
  1324.  
  1325. <p><kw role="element">mn</kw> elements accept the attributes listed in
  1326. <specref ref="presm_commatt"/>.</p>
  1327.  
  1328. <p>A typical graphical renderer would render an
  1329. <kw role="element">mn</kw> element as the characters of its content, with
  1330. no extra spacing around them (except spacing from neighboring elements
  1331. such as <kw role="element">mo</kw>). Unlike <kw role="element">mi</kw>,
  1332. <kw role="element">mn</kw> elements are (typically) rendered in an
  1333. unslanted font by default, regardless of their content.</p>
  1334. </div4>
  1335.  
  1336. <div4><head>Examples</head>
  1337. <eg role='mathml'><![CDATA[
  1338. <mn> 2 </mn>
  1339. <mn> 0.123 </mn>
  1340. <mn> 1,000,000 </mn>
  1341. <mn> 2.1e10 </mn>
  1342. <mn> 0xFFEF </mn>
  1343. <mn> MCMLXIX </mn>
  1344. <mn> twenty one </mn>
  1345. ]]></eg>
  1346. </div4>
  1347.  
  1348. <div4><head>Numbers that should <emph>not</emph> be written 
  1349. using <kw role="element">mn</kw> alone</head>
  1350.  
  1351. <p>Many mathematical numbers should be represented using presentation
  1352. elements other than <kw role="element">mn</kw> alone; this includes
  1353. complex numbers, ratios of numbers shown as fractions, and 
  1354. names of numeric constants. Examples of MathML representations of
  1355. such numbers include:
  1356. <eg role='mathml'><![CDATA[
  1357. <mrow>
  1358.   <mn> 2 </mn>
  1359.   <mo> + </mo>
  1360.   <mrow>
  1361.     <mn> 3 </mn>
  1362.     <mo> ⁢ </mo>
  1363.     <mi> ⅈ </mi>
  1364.   </mrow>
  1365. </mrow>
  1366. <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac>
  1367. <mi> π </mi>
  1368. <mi> ⅇ </mi>
  1369. ]]></eg>
  1370. </p>
  1371. </div4>
  1372. </div3>
  1373.  
  1374. <div3 id="presm_mo"><head>Operator, Fence, Separator or Accent
  1375.   (<kw role="element">mo</kw>)</head>
  1376.  
  1377. <div4><head>Description</head>
  1378.  
  1379. <p>An <kw role="element">mo</kw> element represents an operator or
  1380. anything that should be rendered as an operator. In general, the
  1381. notational conventions for mathematical operators are quite
  1382. complicated, and therefore MathML provides a relatively sophisticated
  1383. mechanism for specifying the rendering behavior of an
  1384. <kw role="element">mo</kw> element.  As a consequence, in MathML the list
  1385. of things that should <quote>render as an operator</quote> includes a number of
  1386. notations that are not mathematical operators in the ordinary
  1387. sense. Besides ordinary operators with infix, prefix, or postfix
  1388. forms, these include fence characters such as braces, parentheses, and
  1389. <quote>absolute value</quote> bars, separators such as comma and semicolon, and
  1390. mathematical accents such as a bar or tilde over a symbol.</p>
  1391.  
  1392. <p>The term <quote>operator</quote> as used in the present chapter means
  1393. any symbol or notation that should render as an operator, and that is
  1394. therefore representable by an <kw role="element">mo</kw> element. That is,
  1395. the term <quote>operator</quote> includes any ordinary operator, fence,
  1396. separator, or accent unless otherwise specified or clear from the
  1397. context.</p>
  1398.  
  1399. <p>All such symbols are represented in MathML with <kw
  1400. role="element">mo</kw> elements since they are subject to essentially the
  1401. same rendering attributes and rules; subtle distinctions in the rendering
  1402. of these classes of symbols, when they exist, are supported using the
  1403. boolean attributes <kw role="attrib">fence</kw>, <kw
  1404. role="attrib">separator</kw> and <kw role="attrib">accent</kw>, which can be
  1405. used to distinguish these cases.</p>
  1406.  
  1407. <p>A key feature of the <kw role="element">mo</kw> element is that its
  1408. default attribute values are set on a case-by-case basis from an
  1409. <quote>operator dictionary</quote> as explained below. In particular, default
  1410. values for <kw role="attrib">fence</kw>, <kw role="attrib">separator</kw> and
  1411. <kw role="attrib">accent</kw> can usually be found in the operator dictionary
  1412. and therefore need not be specified on each <kw role="element">mo</kw>
  1413. element.</p>
  1414.  
  1415. <p>Note that some mathematical operators are represented not by <kw
  1416. role="element">mo</kw> elements alone, but by <kw role="element">mo</kw>
  1417. elements <quote>embellished</quote> with (for example) surrounding
  1418. superscripts; this is further described below. Conversely, as presentation
  1419. elements, <kw role="element">mo</kw> elements can contain arbitrary text,
  1420. even when that text has no standard interpretation as an operator; for an
  1421. example, see the discussion <quote>Mixing text and mathematics</quote> in
  1422. <specref ref="presm_mtext"/>. See also <specref ref="contm"/> for
  1423. definitions of MathML content elements that are guaranteed to have the
  1424. semantics of specific mathematical operators.</p>
  1425. </div4>
  1426.  
  1427. <div4><head>Attributes</head>
  1428.  
  1429. <p><kw role="element">mo</kw> elements accept the attributes listed in
  1430. <specref ref="presm_commatt"/>, and the additional attributes listed here.
  1431. Most attributes get their default values from the 
  1432. <specref ref="presm_opdict"/>, as described later in this 
  1433. section. When a dictionary entry is not found for a given
  1434. <kw role="element">mo</kw> element, the default value shown here in
  1435. parentheses is used.
  1436. <table border="1" id="presm_table-mo">
  1437. <thead>
  1438. <tr>
  1439. <td>Name</td>
  1440. <td>values</td>
  1441. <td>default</td>
  1442. </tr>
  1443. </thead>
  1444. <tbody>
  1445. <tr>
  1446. <td>form</td>
  1447. <td>prefix | infix | postfix</td>
  1448. <td>set by position of operator in an <kw role="element">mrow</kw> (rule given below);
  1449.     used with <kw role="element">mo</kw> content to index operator dictionary</td>
  1450. </tr>
  1451. <tr>
  1452. <td>fence</td>
  1453. <td>true | false</td>
  1454. <td>set by dictionary (false)</td>
  1455. </tr>
  1456. <tr>
  1457. <td>separator</td>
  1458. <td>true | false</td>
  1459. <td>set by dictionary (false)</td>
  1460. </tr>
  1461. <tr>
  1462. <td>lspace</td>
  1463. <td>number h-unit | namedspace</td>
  1464. <td>set by dictionary (thickmathspace)</td>
  1465. </tr>
  1466. <tr>
  1467. <td>rspace</td>
  1468. <td>number h-unit | namedspace</td>
  1469. <td>set by dictionary (thickmathspace)</td>
  1470. </tr>
  1471. <tr>
  1472. <td>stretchy</td>
  1473. <td>true | false</td>
  1474. <td>set by dictionary (false)</td>
  1475. </tr>
  1476. <tr>
  1477. <td>symmetric</td>
  1478. <td>true | false</td>
  1479. <td>set by dictionary (true)</td>
  1480. </tr>
  1481. <tr>
  1482. <td>maxsize</td>
  1483. <td>number [ v-unit | h-unit ] | namedspace | infinity</td>
  1484. <td>set by dictionary (infinity)</td>
  1485. </tr>
  1486. <tr>
  1487. <td>minsize</td>
  1488. <td>number [ v-unit | h-unit ] | namedspace</td>
  1489. <td>set by dictionary (1)</td>
  1490. </tr>
  1491. <tr>
  1492. <td>largeop</td>
  1493. <td>true | false</td>
  1494. <td>set by dictionary (false)</td>
  1495. </tr>
  1496. <tr>
  1497. <td>movablelimits</td>
  1498. <td>true | false</td>
  1499. <td>set by dictionary (false)</td>
  1500. </tr>
  1501. <tr>
  1502. <td>accent</td>
  1503. <td>true | false</td>
  1504. <td>set by dictionary (false)</td>
  1505. </tr>
  1506. </tbody>
  1507. </table>
  1508. </p>
  1509.  
  1510. <p><kw role="attrib">h-unit</kw> represents a unit of horizontal
  1511. length, and <kw role="attrib">v-unit</kw> represents a unit of vertical
  1512. length (see
  1513. <specref ref="fund_units"/>).
  1514. <kw role="attrib">namedspace</kw> is one of
  1515. <kw role="attval">veryverythinmathspace</kw>,
  1516. <kw role="attval">verythinmathspace</kw>,
  1517. <kw role="attval">thinmathspace</kw>,
  1518. <kw role="attval">mediummathspace</kw>,
  1519. <kw role="attval">thickmathspace</kw>,
  1520. <kw role="attval">verythickmathspace</kw>, or
  1521. <kw role="attval">veryverythickmathspace</kw>.
  1522. These values can be set by using the <kw role="element">mstyle</kw> element
  1523. as is further discussed in <specref ref="presm_mstyle"/>.
  1524. </p>
  1525.  
  1526. <p>If no unit is given with <kw role="attrib">maxsize</kw> or <kw
  1527. role="attrib">minsize</kw>, the number is a multiplier of the normal size
  1528. of the operator in the direction (or directions) in which it stretches.
  1529. These attributes are further explained below.</p>
  1530.  
  1531. <p>Typical graphical renderers show all <kw role="element">mo</kw>
  1532. elements as the characters of their content, with additional spacing
  1533. around the element determined from the attributes listed
  1534. above. Detailed rules for determining operator spacing in visual
  1535. renderings are described in a subsection below. As always, MathML does
  1536. not require a specific rendering, and these rules are provided as
  1537. suggestions for the convenience of implementors.</p>
  1538.  
  1539. <p>Renderers without access to complete fonts for the MathML character
  1540. set may choose not to render an <kw role="element">mo</kw> element as
  1541. precisely the characters in its content in some cases. For example,
  1542. <code><![CDATA[<mo> ≤ </mo>]]></code> might be rendered as
  1543. <code><=</code> to a terminal.  However, as a general rule,
  1544. renderers should attempt to render the content of an
  1545. <kw role="element">mo</kw> element as literally as possible.
  1546. That is,
  1547. <code><![CDATA[<mo> ≤ </mo>]]></code> and
  1548. <code><![CDATA[<mo> <= </mo>]]></code> should render differently.
  1549. (The first one should render as a single character
  1550. representing a less-than-or-equal-to sign, and the second one as the
  1551. two-character sequence <code><=</code>.)</p>
  1552. </div4>
  1553.  
  1554. <div4><head>Examples with ordinary operators</head>
  1555.  
  1556. <eg role='mathml'><![CDATA[
  1557. <mo> + </mo>
  1558. <mo> < </mo>
  1559. <mo> ≤ </mo>
  1560. <mo> <= </mo>
  1561. <mo> ++ </mo>
  1562. <mo> ∑ </mo>
  1563. <mo> .NOT. </mo>
  1564. <mo> and </mo>
  1565. <mo> ⁢ </mo>
  1566. <mo mathvariant='bold'> + </mo>
  1567. ]]></eg>
  1568. </div4>
  1569.  
  1570. <div4><head>Examples with fences and separators</head>
  1571.  
  1572. <p>Note that the <kw role="element">mo</kw> elements in these examples
  1573. don't need explicit <kw role="attrib">fence</kw> or <kw
  1574. role="attrib">separator</kw> attributes, since these can be found using the
  1575. operator dictionary as described below. Some of these examples could also
  1576. be encoded using the <kw role="element">mfenced</kw> element described in
  1577. <specref ref="presm_mfenced"/>.</p>
  1578.  
  1579. <p>(<mi>a</mi>+<mi>b</mi>)
  1580. <eg role='mathml'><![CDATA[
  1581. <mrow>
  1582.   <mo> ( </mo>
  1583.   <mrow>
  1584.     <mi> a </mi>
  1585.     <mo> + </mo>
  1586.     <mi> b </mi>
  1587.   </mrow>
  1588.   <mo> ) </mo>
  1589. </mrow>
  1590. ]]></eg>
  1591. </p>
  1592.  
  1593. <p>[0,1)
  1594. <eg role='mathml'><![CDATA[
  1595. <mrow>
  1596.   <mo> [ </mo>
  1597.   <mrow>
  1598.     <mn> 0 </mn>
  1599.     <mo> , </mo>
  1600.     <mn> 1 </mn>
  1601.   </mrow>
  1602.   <mo> ) </mo>
  1603. </mrow>
  1604. ]]></eg>
  1605. </p>
  1606.  
  1607. <p><mi>f</mi>(<mi>x</mi>,<mi>y</mi>)
  1608. <eg role='mathml'><![CDATA[
  1609. <mrow>
  1610.   <mi> f </mi>
  1611.   <mo> ⁡ </mo>
  1612.   <mrow>
  1613.     <mo> ( </mo>
  1614.     <mrow>
  1615.       <mi> x </mi>
  1616.       <mo> , </mo>
  1617.       <mi> y </mi>
  1618.     </mrow>
  1619.     <mo> ) </mo>
  1620.   </mrow>
  1621. </mrow>
  1622. ]]></eg>
  1623. </p>
  1624. </div4>
  1625.  
  1626. <div4><head>Invisible operators</head>
  1627.  
  1628. <p>Certain operators that are <quote>invisible</quote> in traditional
  1629. mathematical notation should be represented using specific entity
  1630. references within <kw role="element">mo</kw> elements, rather than simply
  1631. by nothing. The entity references used for these <quote>invisible
  1632. operators</quote> are:
  1633. <table border="1">
  1634. <thead>
  1635. <tr>
  1636. <td>Full name</td>
  1637. <td>Short name</td>
  1638. <td>Examples of use</td>
  1639. </tr>
  1640. </thead>
  1641. <tbody>
  1642. <tr>
  1643. <td><kw role="entity">InvisibleTimes</kw></td>
  1644. <td><kw role="entity">it</kw></td>
  1645. <td><mi>x</mi><mi>y</mi></td>
  1646. </tr>
  1647. <tr>
  1648. <td><kw role="entity">ApplyFunction</kw></td>
  1649. <td><kw role="entity">af</kw></td>
  1650. <td><mi>f</mi>(<mi>x</mi>) sin <mi>x</mi></td> 
  1651. </tr>
  1652. <tr>
  1653. <td><kw role="entity">InvisibleComma</kw></td>
  1654. <td><kw role="entity">ic</kw></td>
  1655. <td><mi>m</mi><sub>12</sub></td>
  1656. </tr>
  1657. </tbody>
  1658. </table>
  1659. </p>
  1660.  
  1661. <p>The MathML representations of the examples in the above table are:
  1662. <eg role='mathml'><![CDATA[
  1663. <mrow>
  1664.   <mi> x </mi>
  1665.   <mo> ⁢ </mo>
  1666.   <mi> y </mi>
  1667. </mrow>
  1668.  
  1669. <mrow>
  1670.   <mi> f </mi>
  1671.   <mo> ⁡ </mo>
  1672.   <mrow>
  1673.     <mo> ( </mo>
  1674.     <mi> x </mi>
  1675.     <mo> ) </mo>
  1676.   </mrow>
  1677. </mrow>
  1678.  
  1679. <mrow>
  1680.   <mi> sin </mi>
  1681.   <mo> ⁡ </mo>
  1682.   <mi> x </mi>
  1683. </mrow>
  1684.  
  1685. <msub>
  1686.   <mi> m </mi>
  1687.   <mrow>
  1688.     <mn> 1 </mn>
  1689.     <mo> ⁣ </mo>
  1690.     <mn> 2 </mn>
  1691.   </mrow>
  1692. </msub>
  1693. ]]></eg>
  1694. </p>
  1695.  
  1696. <p>The reasons for using specific <kw role="element">mo</kw> elements for
  1697. invisible operators include:
  1698. <ulist>
  1699. <item><p>such operators should often have specific effects on visual
  1700. rendering (particularly spacing and linebreaking rules) that are not
  1701. the same as either the lack of any operator, or spacing represented by
  1702. <kw role="element">mspace</kw> or <kw role="element">mtext</kw>
  1703. elements;</p> 
  1704. </item>
  1705.  
  1706. <item><p>these operators should often have specific audio renderings
  1707. different than that of the lack of any operator;</p>
  1708. </item>
  1709.  
  1710. <item><p>automatic semantic interpretation of MathML presentation elements
  1711. is made easier by the explicit specification of such operators.</p>
  1712. </item>
  1713. </ulist>
  1714. </p>
  1715.  
  1716. <p>For example, an audio renderer might render <mi>f</mi>(<mi>x</mi>)
  1717. (represented as in the above examples) by speaking <quote>f of x</quote>, but use
  1718. the word <quote>times</quote> in its rendering of <mi>x</mi><mi>y</mi>.
  1719. Although its rendering must still be different depending on the structure
  1720. of neighboring elements (sometimes leaving out <quote>of</quote> or
  1721. <quote>times</quote> entirely), its task is made much easier by the use of
  1722. a different <kw role="element">mo</kw> element for each invisible
  1723. operator.</p>
  1724. </div4>
  1725.  
  1726. <div4><head>Names for other special operators</head>
  1727.  
  1728. <p>MathML also includes <kw role="entity">DifferentialD</kw> for use
  1729. in an <kw role="element">mo</kw> element representing the differential
  1730. operator symbol usually denoted by <quote>d</quote>.  The reasons for
  1731. explicitly using this special entity are similar to those for using
  1732. the special entities for invisible operators described in the
  1733. preceding section.  </p>
  1734.  
  1735. </div4>
  1736.  
  1737. <div4><head>Detailed rendering rules for <kw role="element">mo</kw> elements</head>
  1738.  
  1739. <p>Typical visual rendering behaviors for <kw role="element">mo</kw>
  1740. elements are more complex than for the other MathML token elements, so
  1741. the rules for rendering them are described in this separate
  1742. subsection.</p>
  1743.  
  1744. <p>Note that, like all rendering rules in MathML, these rules are
  1745. suggestions rather than requirements.  Furthermore, no attempt is made
  1746. to specify the rendering completely; rather, enough information is
  1747. given to make the intended effect of the various rendering attributes
  1748. as clear as possible.</p>
  1749.  
  1750. <div5 id="presm_opdict"><head>The operator dictionary</head>
  1751.  
  1752. <p>Many mathematical symbols, such as an integral sign, a plus sign,
  1753. or a parenthesis, have a well-established, predictable, traditional
  1754. notational usage. Typically, this usage amounts to certain default
  1755. attribute values for <kw role="element">mo</kw> elements with specific
  1756. contents and a specific <kw role="attrib">form</kw> attribute. Since these
  1757. defaults vary from symbol to symbol, MathML anticipates that renderers
  1758. will have an <quote>operator dictionary</quote> of default attributes for
  1759. <kw role="element">mo</kw> elements (see <specref ref="oper-dict"/>) indexed by each
  1760. <kw role="element">mo</kw> element's content and <kw role="attrib">form</kw>
  1761. attribute.  If an <kw role="element">mo</kw> element is not listed in the
  1762. dictionary, the default values shown in parentheses in the table of
  1763. attributes for <kw role="element">mo</kw> should be used, since these
  1764. values are typically acceptable for a generic operator.</p>
  1765.  
  1766. <p>Some operators are <quote>overloaded</quote>, in the sense that they can occur
  1767. in more than one form (prefix, infix, or postfix), with possibly
  1768. different rendering properties for each form. For example, <quote>+</quote> can be
  1769. either a prefix or an infix operator. Typically, a visual renderer
  1770. would add space around both sides of an infix operator, while only on
  1771. the left of a prefix operator. The <kw role="attrib">form</kw> attribute allows
  1772. specification of which form to use, in case more than one form is
  1773. possible according to the operator dictionary and the default value
  1774. described below is not suitable.</p>
  1775. </div5>
  1776.  
  1777. <div5 id="presm_formdefval"><head>Default value of the
  1778. <kw role="attrib">form</kw> attribute</head>
  1779.  
  1780. <p>The <kw role="attrib">form</kw> attribute does not usually have to be
  1781. specified explicitly, since there are effective heuristic rules for
  1782. inferring the value of the <kw role="attrib">form</kw> attribute from the
  1783. context. If it is not specified, and there is more than one possible
  1784. form in the dictionary for an <kw role="element">mo</kw> element with
  1785. given content, the renderer should choose which form to use as follows
  1786. (but see the exception for embellished operators, described later):
  1787. <ulist>
  1788. <item><p>If the operator is the first argument in an <kw
  1789. role="element">mrow</kw> of length (i.e. number of arguments) greater than
  1790. one (ignoring all space-like arguments (see <specref ref="presm_mspace"/>) in the
  1791. determination of both the length and the first argument), the prefix form
  1792. is used;</p>
  1793. </item>
  1794.  
  1795. <item><p>if it is the last argument in an <kw role="element">mrow</kw> of
  1796. length greater than one (ignoring all space-like arguments), the postfix
  1797. form is used;</p>
  1798. </item>
  1799.  
  1800. <item><p>in all other cases, including when the operator is not part of an
  1801. <kw role="element">mrow</kw>, the infix form is used.</p>
  1802. </item>
  1803. </ulist>
  1804. </p>
  1805.  
  1806. <p>Note that these rules make reference to the
  1807. <kw role="element">mrow</kw> in which the <kw role="element">mo</kw>
  1808. element lies. In some situations, this <kw role="element">mrow</kw>
  1809. might be an inferred <kw role="element">mrow</kw> implicitly present
  1810. around the arguments of an element such as
  1811. <kw role="element">msqrt</kw> or <kw role="element">mtd</kw>.</p>
  1812.  
  1813. <p>Opening (left) fences should have <kw role="attrib">form</kw>="prefix",
  1814. and closing (right) fences should have <kw role="attrib">form</kw>="postfix";
  1815. separators are usually <quote>infix</quote>, but not always,
  1816. depending on their surroundings. As with ordinary operators,
  1817. these values do not usually need to be specified explicitly.</p>
  1818.  
  1819. <p>If the operator does not occur in the dictionary with the specified
  1820. form, the renderer should use one of the forms that is available
  1821. there, in the order of preference: infix, postfix, prefix; if no forms
  1822. are available for the given <kw role="element">mo</kw> element content, the
  1823. renderer should use the defaults given in parentheses in the table of
  1824. attributes for <kw role="element">mo</kw>.</p>
  1825. </div5>
  1826.  
  1827. <div5><head>Exception for embellished operators</head>
  1828.  
  1829. <p>There is one exception to the above rules for choosing an <kw
  1830. role="element">mo</kw> element's default <kw role="attrib">form</kw>
  1831. attribute. An <kw role="element">mo</kw> element that is
  1832. <quote>embellished</quote> by one or more nested subscripts, superscripts,
  1833. surrounding text or whitespace, or style changes behaves differently. It is
  1834. the embellished operator as a whole (this is defined precisely, below)
  1835. whose position in an <kw role="element">mrow</kw> is examined by the above
  1836. rules and whose surrounding spacing is affected by its form, not the <kw
  1837. role="element">mo</kw> element at its core; however, the attributes
  1838. influencing this surrounding spacing are taken from the <kw
  1839. role="element">mo</kw> element at the core (or from that element's
  1840. dictionary entry).</p>
  1841.  
  1842. <p>For example, the <quote>+<sub>4</sub></quote> in 
  1843. <mi>a</mi>+<sub>4</sub><mi>b</mi>
  1844. should be considered an infix operator as a whole, due to its position
  1845. in the middle of an <kw role="element">mrow</kw>, but its rendering
  1846. attributes should be taken from the <kw role="element">mo</kw> element
  1847. representing the <quote>+</quote>, or when those are not specified explicitly,
  1848. from the operator dictionary entry for <code><mo form="infix"> +
  1849. </mo></code>.
  1850. The precise definition of an <quote>embellished operator</quote> is: 
  1851. <ulist>
  1852. <item><p>an <kw role="element">mo</kw> element;</p>
  1853. </item>
  1854.  
  1855. <item><p>or one of the elements
  1856. <kw role="element">msub</kw>,
  1857. <kw role="element">msup</kw>,
  1858. <kw role="element">msubsup</kw>,
  1859. <kw role="element">munder</kw>,
  1860. <kw role="element">mover</kw>,
  1861. <kw role="element">munderover</kw>,
  1862. <kw role="element">mmultiscripts</kw>,
  1863. <kw role="element">mfrac</kw>, or
  1864. <kw role="element">semantics</kw>
  1865. (<specref ref="contm_synsem"/>), whose first argument exists and is an embellished
  1866. operator;</p>
  1867. </item>
  1868.  
  1869. <item><p>or one of the elements
  1870. <kw role="element">mstyle</kw>,
  1871. <kw role="element">mphantom</kw>, or
  1872. <kw role="element">mpadded</kw>,
  1873. such that an <kw role="element">mrow</kw> containing the same
  1874. arguments would be an embellished operator;</p>
  1875. </item>
  1876.  
  1877. <item><p>or an <kw role="element">maction</kw> element whose selected
  1878. sub-expression exists and is an embellished operator;</p> </item>
  1879.  
  1880. <item><p>or an <kw role="element">mrow</kw> whose arguments consist (in any order)
  1881. of one embellished operator and zero or more space-like elements.</p>
  1882. </item> 
  1883. </ulist>
  1884. Note that this definition permits nested embellishment only when
  1885. there are no intervening enclosing elements not in the above list.</p>
  1886.  
  1887. <p>The above rules for choosing operator forms and defining
  1888. embellished operators are chosen so that in all ordinary cases it will
  1889. not be necessary for the author to specify a <kw role="attrib">form</kw>
  1890. attribute.</p>
  1891. </div5>
  1892.  
  1893. <div5><head>Rationale for definition of embellished operators</head>
  1894.  
  1895. <p>The following notes are included as a rationale for certain aspects
  1896. of the above definitions, but should not be important for most users
  1897. of MathML.</p>
  1898.  
  1899. <p>An <kw role="element">mfrac</kw> is included as an
  1900. <quote>embellisher</quote> because of the common notation for a
  1901. differential operator:
  1902. <eg role='mathml'><![CDATA[
  1903. <mfrac>
  1904.   <mo> ⅆ </mo>
  1905.   <mrow>
  1906.     <mo> ⅆ </mo>
  1907.     <mi> x </mi>
  1908.   </mrow>
  1909. </mfrac>
  1910. ]]></eg>
  1911. </p>
  1912.  
  1913. <p>Since the definition of embellished operator affects the use of the
  1914. attributes related to stretching, it is important that it includes
  1915. embellished fences as well as ordinary operators; thus it applies to
  1916. any <kw role="element">mo</kw> element.</p>
  1917.  
  1918. <p>Note that an <kw role="element">mrow</kw> containing a single argument
  1919. is an embellished operator if and only if its argument is an embellished
  1920. operator. This is because an <kw role="element">mrow</kw> with a single
  1921. argument must be equivalent in all respects to that argument alone (as
  1922. discussed in <specref ref="presm_mrow"/>). This means that an <kw
  1923. role="element">mo</kw> element that is the sole argument of an <kw
  1924. role="element">mrow</kw> will determine its default <kw
  1925. role="attrib">form</kw> attribute based on that <kw
  1926. role="element">mrow</kw>'s position in a surrounding, perhaps inferred, <kw
  1927. role="element">mrow</kw> (if there is one), rather than based on its own
  1928. position in the <kw role="element">mrow</kw> in which it is the sole
  1929. argument.</p> 
  1930.  
  1931. <p>Note that the above definition defines every
  1932. <kw role="element">mo</kw> element to be <quote>embellished</quote> – that is,
  1933. <quote>embellished operator</quote> can be considered (and implemented in
  1934. renderers) as a special class of MathML expressions, of which
  1935. <kw role="element">mo</kw> is a specific case.</p>
  1936. </div5>
  1937.  
  1938. <div5><head>Spacing around an operator</head>
  1939.  
  1940. <p>The amount of space added around an operator (or embellished operator),
  1941. when it occurs in an <kw role="element">mrow</kw>, can be directly
  1942. specified by the <kw role="attrib">lspace</kw> and <kw
  1943. role="attrib">rspace</kw> attributes. These values are in ems if no units
  1944. are given. By convention, operators that tend to bind tightly to their
  1945. arguments have smaller values for spacing than operators that tend to bind
  1946. less tightly. This convention should be followed in the operator dictionary
  1947. included with a MathML renderer. In &TeX;, these values can only be one of
  1948. three values; typically they are 3/18em, 4/18em, and 5/18em. MathML does
  1949. not impose this limit.</p>
  1950.  
  1951. <p>Some renderers may choose to use no space around most operators
  1952. appearing within subscripts or superscripts, as is done in &TeX;.</p>
  1953.  
  1954. <p>Non-graphical renderers should treat spacing attributes, and other
  1955. rendering attributes described here, in analogous ways for their
  1956. rendering medium.  For example, more space might translate into a
  1957. longer pause in an audio rendering.</p>
  1958. </div5>
  1959. </div4>
  1960.  
  1961. <div4><head>Stretching of operators, fences and accents</head>
  1962.  
  1963. <p>Four attributes govern whether and how an operator (perhaps embellished)
  1964. stretches so that it matches the size of other elements: <kw
  1965. role="attrib">stretchy</kw>, <kw role="attrib">symmetric</kw>, <kw
  1966. role="attrib">maxsize</kw>, and <kw role="attrib">minsize</kw>. If an
  1967. operator has the attribute <kw role="attrib">stretchy</kw>=<kw
  1968. role="attval">true</kw>, then it (that is, each character in its content)
  1969. obeys the stretching rules listed below, given the constraints imposed by
  1970. the fonts and font rendering system. In practice, typical renderers will
  1971. only be able to stretch a small set of characters, and quite possibly will
  1972. only be able to generate a discrete set of character sizes.</p>
  1973.  
  1974. <p>There is no provision in MathML for specifying in which direction
  1975. (horizontal or vertical) to stretch a specific character or operator;
  1976. rather, when <kw role="attrib">stretchy</kw>=<kw role="attval">true</kw> it
  1977. should be stretched in each direction for which stretching is possible. It
  1978. is up to the renderer to know in which directions it is able to stretch
  1979. each character.  (Most characters can be stretched in at most one direction
  1980. by typical renderers, but some renderers may be able to stretch certain
  1981. characters, such as diagonal arrows, in both directions independently.)</p>
  1982.  
  1983. <p>The <kw role="attrib">minsize</kw> and <kw role="attrib">maxsize</kw>
  1984. attributes limit the amount of stretching (in either direction). These two
  1985. attributes are given as multipliers of the operator's normal size in the
  1986. direction or directions of stretching, or as absolute sizes using units.
  1987. For example, if a character has <kw role="attrib">maxsize</kw>="3", then it
  1988. can grow to be no more than three times its normal (unstretched) size.</p>
  1989.  
  1990. <p>The <kw role="attrib">symmetric</kw> attribute governs whether the
  1991. height and 
  1992. depth above and below the <intref ref="dt-axis">axis</intref> of the
  1993. character are forced to be equal  
  1994. (by forcing both height and depth to become the maximum of the two).
  1995. An example of a situation where one might set
  1996. <kw role="attrib">symmetric</kw>=<kw role="attval">false</kw> 
  1997. arises with parentheses around a matrix not aligned on the axis, which
  1998. frequently occurs when multiplying non-square matrices. In this case, one
  1999. wants the parentheses to stretch to cover the matrix, whereas stretching
  2000. the parentheses symmetrically would cause them to protrude beyond one edge
  2001. of the matrix. The <kw role="attrib">symmetric</kw> attribute only applies
  2002. to characters that stretch vertically (otherwise it is ignored).</p>
  2003.  
  2004. <p>If a stretchy <kw role="element">mo</kw> element is embellished (as defined
  2005. earlier in this section), the <kw role="element">mo</kw> element at its core is
  2006. stretched to a size based on the context of the embellished operator
  2007. as a whole, i.e. to the same size as if the embellishments were not
  2008. present. For example, the parentheses in the following example (which
  2009. would typically be set to be stretchy by the operator dictionary) will be
  2010. stretched to the same size as each other, and the same size they would
  2011. have if they were not underlined and overlined, and furthermore will
  2012. cover the same vertical interval:
  2013. <eg role='mathml'><![CDATA[
  2014. <mrow>
  2015.   <munder>
  2016.     <mo> ( </mo>
  2017.     <mo> _ </mo>
  2018.   </munder>
  2019.   <mfrac>
  2020.     <mi> a </mi>
  2021.     <mi> b </mi>
  2022.   </mfrac>
  2023.   <mover>
  2024.     <mo> ) </mo>
  2025.     <mo> ‾ </mo>
  2026.   </mover>
  2027. </mrow>
  2028. ]]></eg>
  2029. </p>
  2030.  
  2031. <p>Note that this means that the stretching rules given below must
  2032. refer to the context of the embellished operator as a whole, not just
  2033. to the <kw role="element">mo</kw> element itself.</p>
  2034.  
  2035. <div5><head>Example of stretchy attributes</head>
  2036.  
  2037. <p>This shows one way to set the maximum size of a parenthesis so that
  2038. it does not grow, even though its default value is
  2039. <kw role="attrib">stretchy</kw>=<kw role="attval">true</kw>.
  2040. <eg role='mathml'><![CDATA[
  2041. <mrow>
  2042.   <mo maxsize="1"> ( </mo>
  2043.   <mfrac>
  2044.     <mi> a </mi> <mi> b </mi>
  2045.   </mfrac>
  2046.   <mo maxsize="1"> ) </mo>
  2047. </mrow>
  2048. ]]></eg>
  2049. </p>
  2050.  
  2051. <p>The above should render as 
  2052. <graphic role="inline" source="image/f3001.gif" alt="(\frac{a}{b})"/> 
  2053. as opposed to the default rendering
  2054. <graphic role="inline" source="image/f3002.gif" alt="\left(\frac{a}{b}\right)"/>.</p>
  2055.  
  2056. <p>Note that each parenthesis is sized independently; if only one of
  2057. them had <kw role="attrib">maxsize</kw>="1", they would render with different
  2058. sizes.</p>
  2059. </div5>
  2060.  
  2061. <div5><head>Vertical Stretching Rules</head>
  2062. <ulist>
  2063. <item><p>If a stretchy operator is a direct sub-expression of an <kw
  2064. role="element">mrow</kw> element, or is the sole direct sub-expression of an
  2065. <kw role="element">mtd</kw> element in some row of a table, then it should
  2066. stretch to cover the height and depth (above and below the <kw
  2067. role="attrib">axis</kw>) of the non-stretchy direct sub-expressions in the
  2068. <kw role="element">mrow</kw> element or table row, unless stretching is
  2069. constrained by <kw role="attrib">minsize</kw> or <kw
  2070. role="attrib">maxsize</kw> attributes.</p>
  2071. </item>
  2072.  
  2073. <item><p>In the case of an embellished stretchy operator, the preceding
  2074. rule applies to the stretchy operator at its core.</p>
  2075. </item>
  2076.  
  2077. <item><p>If <kw role="attrib">symmetric</kw>=<kw role="attval">true</kw>,
  2078. then the maximum of the height and depth is used to determine the size,
  2079. before application of the <kw role="attrib">minsize</kw> or <kw
  2080. role="attrib">maxsize</kw> attributes.</p>
  2081. </item>
  2082.  
  2083. <item><p>The preceding rules also apply in situations where the <kw
  2084. role="element">mrow</kw> element is inferred.</p>
  2085. </item>
  2086. </ulist>
  2087.  
  2088. <p>Most common opening and closing fences are defined in the operator
  2089. dictionary to stretch by default; and they stretch vertically. Also,
  2090. operators such as <kw role="entity">sum</kw>, <kw role="entity">int</kw>,
  2091. /, and vertical arrows stretch vertically by default.</p>
  2092.  
  2093. <p>In the case of a stretchy operator in a table cell (i.e. within an
  2094. <kw role="element">mtd</kw> element), the above rules assume each cell of
  2095. the table row containing the stretchy operator covers exactly one row.
  2096. (Equivalently, the value of the <kw role="attrib">rowspan</kw> attribute is
  2097. assumed to be 1 for all the table cells in the table row, including
  2098. the cell containing the operator.)  When this is not the case, the
  2099. operator should only be stretched vertically to cover those table
  2100. cells that are entirely within the set of table rows that the
  2101. operator's cell covers. Table cells that extend into rows not covered
  2102. by the stretchy operator's table cell should be ignored.  See 
  2103. <specref ref="presm_mtdatts"/> for details about the <kw
  2104. role="attrib">rowspan</kw> attribute. 
  2105.  
  2106. </p>
  2107. </div5>
  2108.  
  2109. <div5><head>Horizontal Stretching Rules</head>
  2110. <ulist>
  2111. <item><p>If a stretchy operator, or an embellished stretchy operator,
  2112. is a direct sub-expression of an <kw role="element">munder</kw>,
  2113. <kw role="element">mover</kw>, or <kw role="element">munderover</kw> element, 
  2114. or if it is the sole direct sub-expression of an <kw
  2115. role="element">mtd</kw> element in some
  2116. column of a table (see <kw role="element">mtable</kw>), then it, or the <kw
  2117. role="element">mo</kw> element at its core, should stretch to cover
  2118. the width of the other direct sub-expressions in the given element (or
  2119. in the same table column), given the constraints mentioned above.</p>
  2120. </item>
  2121.  
  2122. <item><p>If a stretchy operator is a direct sub-expression of an
  2123. <kw role="element">munder</kw>, <kw role="element">mover</kw>, or
  2124. <kw role="element">munderover</kw> element, or if it is the sole direct
  2125. sub-expression of an <kw role="element">mtd</kw> element in some column of a
  2126. table, then it should stretch to cover the width of the other direct
  2127. sub-expressions in the given element (or in the same table column),
  2128. given the constraints mentioned above.</p>
  2129. </item>
  2130.  
  2131. <item><p>In the case of an embellished stretchy operator, the preceding
  2132. rule applies to the stretchy operator at its core.</p>
  2133. </item>
  2134.  
  2135. </ulist>
  2136.  
  2137. <p>By default, most horizontal arrows and some accents stretch
  2138. horizontally.</p>
  2139.  
  2140. <p>In the case of a stretchy operator in a table cell (i.e. within an
  2141. <kw role="element">mtd</kw> element), the above rules assume each cell of
  2142. the table column containing the stretchy operator covers exactly one
  2143. column.  (Equivalently, the value of the <kw role="attrib">columnspan</kw>
  2144. attribute is assumed to be 1 for all the table cells in the table row,
  2145. including the cell containing the operator.)  When this is not the
  2146. case, the operator should only be stretched horizontally to cover
  2147. those table cells that are entirely within the set of table columns
  2148. that the operator's cell covers. Table cells that extend into columns
  2149. not covered by the stretchy operator's table cell should be
  2150. ignored.  See <specref ref="presm_mtdatts" /> for details about the <kw
  2151. role="attrib">rowspan</kw> attribute. </p>
  2152.  
  2153. <p>The rules for horizontal stretching include <kw role="element">mtd</kw>
  2154. elements to allow arrows to stretch for use in commutative diagrams
  2155. laid out using <kw role="element">mtable</kw>. The rules for the horizontal
  2156. stretchiness include scripts to make examples such as the following
  2157. work:
  2158. <eg role='mathml'><![CDATA[
  2159. <mrow>
  2160.   <mi> x </mi>
  2161.   <munder>
  2162.     <mo> → </mo>
  2163.     <mtext> maps to </mtext>
  2164.   </munder>
  2165.   <mi> y </mi>
  2166. </mrow>
  2167. ]]></eg>
  2168. </p>
  2169.  
  2170. <p>This displays as 
  2171. <graphic role="inline" source="image/f3003.gif"
  2172.   alt="x \widearrow{\mathrm{maps~to}} y"/>.</p>
  2173. </div5>
  2174.  
  2175. <div5><head>Rules Common to both Vertical and Horizontal Stretching</head>
  2176.  
  2177. <p>If a stretchy operator is not required to stretch (i.e. if it is
  2178. not in one of the locations mentioned above, or if there are no other
  2179. expressions whose size it should stretch to match), then it has the
  2180. standard (unstretched) size determined by the font and current
  2181. fontsize.</p>
  2182.  
  2183. <p>If a stretchy operator is required to stretch, but all other expressions
  2184. in the containing element (as described above) are also stretchy,
  2185. all elements that can stretch should grow to the maximum of the normal
  2186. unstretched sizes of all elements in the containing object, if they can
  2187. grow that large. If the value of <kw role="attrib">minsize</kw> or <kw
  2188. role="attrib">maxsize</kw> prevents this then that (min or max) size is
  2189. used.</p>
  2190.  
  2191. <p>For example, in an <kw role="element">mrow</kw> containing nothing but
  2192. vertically stretchy operators, each of the operators should stretch to
  2193. the maximum of all of their normal unstretched sizes, provided no
  2194. other attributes are set that override this behavior. Of course,
  2195. limitations in fonts or font rendering may result in the final,
  2196. stretched sizes being only approximately the same.</p>
  2197. </div5>
  2198. </div4>
  2199.  
  2200. <div4><head>Other attributes of <kw role="element">mo</kw></head>
  2201.  
  2202. <p>The <kw role="attrib">largeop</kw> attribute specifies whether the
  2203. operator should be drawn larger than normal if <kw
  2204. role="attrib">displaystyle</kw>=<kw role="attval">true</kw> in the current
  2205. rendering environment. This roughly corresponds to &TeX;'s
  2206. <kw>\displaystyle</kw> style setting. MathML uses two attributes, <kw
  2207. role="attrib">displaystyle</kw> and <kw role="attrib">scriptlevel</kw>, to
  2208. control orthogonal presentation features that &TeX; encodes into one
  2209. <quote>style</quote> attribute with values <kw>\displaystyle</kw>,
  2210. <kw>\textstyle</kw>, <kw>\scriptstyle</kw>, and
  2211. <kw>\scriptscriptstyle</kw>. These attributes are discussed further in
  2212. <specref ref="presm_mstyle"/> describing the <kw role="element">mstyle</kw> element.
  2213. Note that these attributes can be specified directly on an <kw
  2214. role="element">mstyle</kw> element's start tag, but not on most other
  2215. elements. Examples of large operators include <kw role="entity">int</kw>
  2216. and <kw role="entity">prod</kw>.</p>
  2217.  
  2218. <p>The <kw role="attrib">movablelimits</kw> attribute specifies whether
  2219. underscripts and overscripts attached to this <kw role="element">mo</kw>
  2220. element should be drawn as subscripts and superscripts when <kw
  2221. role="attrib">displaystyle</kw>=<kw role="attval">false</kw>.  <kw
  2222. role="attrib">movablelimits</kw>=<kw role="attval">false</kw> means that
  2223. underscripts and overscripts should never be drawn as subscripts and
  2224. superscripts. In general, <kw role="attrib">displaystyle</kw> is <kw
  2225. role="attval">true</kw> for displayed mathematics and <kw
  2226. role="attval">false</kw> for inline mathematics. Also, <kw
  2227. role="attrib">displaystyle</kw> is <kw role="attval">false</kw> by default
  2228. within tables, scripts and fractions, and a few other exceptional
  2229. situations detailed in <specref ref="presm_mstyle"/>. Thus, operators with
  2230. <kw role="attrib">movablelimits</kw>=<kw role="attval">true</kw> will
  2231. display with limits (i.e. underscripts and overscripts) in displayed
  2232. mathematics, and with subscripts and superscripts in inline mathematics,
  2233. tables, scripts and so on. Examples of operators that typically have <kw
  2234. role="attrib">movablelimits</kw>=<kw role="attval">true</kw> are <kw
  2235. role="element">sum</kw>, <kw role="element">prod</kw>, and <kw
  2236. role="element">lim</kw>.</p>
  2237.  
  2238. <p>The <kw role="attrib">accent</kw> attribute determines whether this
  2239. operator should be treated by default as an accent (diacritical mark) when
  2240. used as an underscript or overscript; see <kw role="element">munder</kw>,
  2241. <kw role="element">mover</kw>, and <kw role="element">munderover</kw>
  2242. (<specref ref="presm_munder"/>, <specref ref="presm_mover"/> and <specref
  2243. ref="presm_munderover"/>).</p>
  2244.  
  2245. <p>The <kw role="attrib">separator</kw> attribute may affect automatic
  2246. linebreaking in renderers that position ordinary infix operators at
  2247. the beginnings of broken lines rather than at the ends (that is, which
  2248. avoid linebreaking just after such operators), since linebreaking
  2249. should be avoided just before separators, but is acceptable just after
  2250. them.</p>
  2251.  
  2252. <p>The <kw role="attrib">fence</kw> attribute has no effect in the suggested
  2253. visual rendering rules given here; it is not needed for properly
  2254. rendering traditional notation using these rules. It is provided so
  2255. that specific MathML renderers, especially non-visual renderers, have
  2256. the option of using this information.</p>
  2257. </div4>
  2258. </div3>
  2259.  
  2260. <div3 id="presm_mtext"><head>Text (<kw role="element">mtext</kw>)</head>
  2261.  
  2262. <div4><head>Description</head>
  2263.  
  2264. <p>An <kw role="element">mtext</kw> element is used to represent
  2265. arbitrary text that should be rendered as itself. In general, the
  2266. <kw role="element">mtext</kw> element is intended to denote commentary
  2267. text.</p>
  2268.  
  2269. <p>Note that some text with a clearly defined notational role might be
  2270. more appropriately marked up using <kw role="element">mi</kw> or
  2271. <kw role="element">mo</kw>; this is discussed further below.</p>
  2272.  
  2273. <p>An <kw role="element">mtext</kw> element can be used to contain
  2274. <quote>renderable whitespace</quote>, i.e. invisible characters that are
  2275. intended to alter the positioning of surrounding elements. In non-graphical
  2276. media, such characters are intended to have an analogous effect, such as
  2277. introducing positive or negative time delays or affecting rhythm in an
  2278. audio renderer. This is not related to any whitespace in the source MathML
  2279. consisting of blanks, newlines, tabs, or carriage returns; whitespace
  2280. present directly in the source is trimmed and collapsed, as described in
  2281. <specref ref="fund_collapse"/>. Whitespace that is intended to be rendered
  2282. as part of an element's content must be represented by entity references
  2283. or <kw role="element">mspace</kw> elements
  2284. (unless it consists only of single blanks between non-whitespace
  2285. characters).</p>
  2286.  
  2287. <p>Renderable whitespace can have a positive or negative width, as in <kw
  2288. role="entity">ThinSpace</kw> and <kw role="entity">NegativeThinSpace</kw>,
  2289. or zero width, as in <kw role="entity">ZeroWidthSpace</kw>. The complete
  2290. list of such characters is given in <specref ref="chars"/>. Note that there
  2291. is no formal distinction in MathML between renderable whitespace characters
  2292. and any other class of characters, in <kw role="element">mtext</kw> or in
  2293. any other element.</p>
  2294.  
  2295. <p>Renderable whitespace can also include
  2296. characters that affect alignment or linebreaking. Some of these
  2297. characters are: 
  2298. <table border="1">
  2299. <thead>
  2300. <tr>
  2301. <td>Entity name</td>
  2302. <td>Purpose (rough description)</td>
  2303. </tr>
  2304. </thead>
  2305. <tbody>
  2306. <tr>
  2307. <td>&NewLine;</td>
  2308. <td>start a new line and do not indent</td>
  2309. </tr>
  2310. <tr>
  2311. <td>&IndentingNewLine;</td>
  2312. <td>start a new line and do indent</td>
  2313. </tr>
  2314. <tr>
  2315. <td>&NoBreak;</td>
  2316. <td>do not allow a linebreak here</td>
  2317. </tr>
  2318. <tr>
  2319. <td>&GoodBreak;</td>
  2320. <td>if a linebreak is needed on the line, here is a good spot</td>
  2321. </tr>
  2322. <tr>
  2323. <td>&BadBreak;</td>
  2324. <td>if a linebreak is needed on the line, try to avoid breaking here</td>
  2325. </tr>
  2326. </tbody>
  2327. </table>
  2328. </p>
  2329.  
  2330. <p>For the complete list of MathML entities, consult <specref ref="chars"/>.</p>
  2331. </div4>
  2332.  
  2333. <div4><head>Attributes</head>
  2334. <p><kw role="element">mtext</kw> elements accept the attributes listed in
  2335. <specref ref="presm_commatt"/>.</p>
  2336.  
  2337. <p>See also the warnings about the legal grouping of <quote>space-like
  2338. elements</quote> in <specref ref="presm_mspace"/>, and about the use of
  2339. such elements for <quote>tweaking</quote> or conveying meaning in <specref
  2340. ref="presm_mpadded"/>.</p>
  2341. </div4>
  2342.  
  2343. <div4><head>Examples</head>
  2344. <eg role='mathml'><![CDATA[
  2345. <mtext> Theorem 1: </mtext>
  2346. <mtext>   </mtext>
  2347. <mtext>      </mtext>
  2348. <mtext> /* a comment */ </mtext>
  2349. ]]></eg>
  2350. </div4>
  2351.  
  2352. <div4 id="presm_mixtextmath"><head>Mixing text and mathematics</head>
  2353.  
  2354. <p>In some cases, text embedded in mathematics could be more appropriately
  2355. represented using <kw role="element">mo</kw> or <kw role="element">mi</kw> elements.
  2356. For example, the expression `there exists
  2357. <graphic role="inline" source="image/f3004.gif" alt="\delta>0"/>
  2358. such that <mi>f</mi>(<mi>x</mi>) <1' is equivalent to
  2359. <graphic role="inline" source="image/f3005.gif"
  2360.   alt="\exists \delta>0 \backepsilon f(x)<1"/> 
  2361. and could be represented as:
  2362. <eg role='mathml'><![CDATA[
  2363. <mrow>
  2364.   <mo> there exists </mo>
  2365.   <mrow>
  2366.     <mrow>
  2367.       <mi> δ </mi>
  2368.       <mo> > </mo>
  2369.       <mn> 0 </mn>
  2370.     </mrow>
  2371.     <mo> such that </mo>
  2372.     <mrow>
  2373.       <mrow>
  2374.         <mi> f </mi>
  2375.         <mo> ⁡ </mo>
  2376.         <mrow>
  2377.           <mo> ( </mo>
  2378.           <mi> x </mi>
  2379.           <mo> ) </mo>
  2380.         </mrow>
  2381.       </mrow>
  2382.       <mo> < </mo>
  2383.       <mn> 1 </mn>
  2384.     </mrow>
  2385.   </mrow>
  2386. </mrow>
  2387. ]]></eg>
  2388. </p>
  2389.  
  2390. <p>An example involving an <kw role="element">mi</kw> element is:
  2391. <mi>x</mi>+<mi>x</mi><sup>2</sup>+···+<mi>x</mi><sup><mi>n</mi></sup>.
  2392. In this example, ellipsis should be represented using an <kw
  2393. role="element">mi</kw> element, since it takes the place of a term in the
  2394. sum; (see <specref ref="presm_mi"/>).</p>
  2395.  
  2396. <p>On the other hand, expository text within MathML is best
  2397. represented with an <kw role="element">mtext</kw> element. An example
  2398. of this is: <eg role='text'> Theorem 1: if <mi>x</mi> > 1, then
  2399. <mi>x</mi><sup>2</sup> > <mi>x</mi>.  </eg> However, when MathML is
  2400. embedded in HTML, or another document markup language, the example is
  2401. probably best rendered with only the two inequalities represented as
  2402. MathML at all, letting the text be part of the surrounding HTML.</p>
  2403.  
  2404. <p>Another factor to consider in deciding how to mark up text is the
  2405. effect on rendering. Text enclosed in an <kw role="element">mo</kw>
  2406. element is unlikely to be found in a renderer's operator dictionary,
  2407. so it will be rendered with the format and spacing appropriate for an
  2408. <quote>unrecognized operator</quote>, which may or may not be better than the
  2409. format and spacing for <quote>text</quote> obtained by using an
  2410. <kw role="element">mtext</kw> element. An ellipsis entity in an
  2411. <kw role="element">mi</kw> element is apt to be spaced more appropriately
  2412. for taking the place of a term within a series than if it appeared in
  2413. an <kw role="element">mtext</kw> element.</p>
  2414. </div4>
  2415. </div3>
  2416.  
  2417. <div3 id="presm_mspace"><head>Space (<kw role="element">mspace</kw>)</head>
  2418.  
  2419. <div4><head>Description</head>
  2420.  
  2421. <p>An <kw role="element">mspace</kw> empty element represents a blank
  2422. space of any desired size, as set by its attributes.  It can also be
  2423. used to make linebreaking suggestions to a visual renderer.
  2424. Note that the default values for attributes have been chosen so that
  2425. they typically will have no effect on rendering.  Thus, the <kw
  2426. role="element">mspace</kw> element is generally used with one
  2427. or more attribute values explicitly specified.
  2428. </p>
  2429. </div4>
  2430.  
  2431. <div4><head>Attributes</head>
  2432. <p>In addition to the attributes listed below,
  2433. <kw role="element">mspace</kw> permits
  2434. <kw role="attrib">id</kw>,
  2435. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  2436. <kw role="attrib">style</kw> attributes,
  2437. as described in <specref ref="fund_globatt"/>.</p>
  2438. <table border="1">
  2439. <thead>
  2440. <tr>
  2441. <td>Name</td>
  2442. <td>values</td>
  2443. <td>default</td>
  2444. </tr>
  2445. </thead>
  2446. <tbody>
  2447. <tr>
  2448. <td>width</td>
  2449. <td>number h-unit | namedspace</td>
  2450. <td>0em</td>
  2451. <!-- em is shown in the table to indicate that it is a typical unit -->
  2452. </tr>
  2453. <tr>
  2454. <td>height</td>
  2455. <td>number v-unit</td>
  2456. <td>0ex</td>
  2457. <!-- ex is shown in the table to indicate that it is a typical unit -->
  2458. </tr>
  2459. <tr>
  2460. <td>depth</td>
  2461. <td>number v-unit</td>
  2462. <td>0ex</td>
  2463. </tr>
  2464. <tr>
  2465. <td>linebreak</td>
  2466. <td>auto | newline | indentingnewline | nobreak | goodbreak | badbreak</td>
  2467. <td>auto</td>
  2468. </tr>
  2469. </tbody>
  2470. </table>
  2471.  
  2472. <p><kw role="attval">h-unit</kw> and <kw role="attval">v-unit</kw>
  2473. represent units of horizontal or vertical length, respectively (see
  2474. <specref ref="fund_units"/>).</p>
  2475.  
  2476. <p>The <kw role="attrib">linebreak</kw> attribute is used to give a
  2477. linebreaking hint to a visual renderer.  The default value is <kw
  2478. role="attval">auto</kw>, which indicates that a renderer should use
  2479. whatever default linebreaking algorithm it would normally use.  The
  2480. meaning of the other possible values for the <kw
  2481. role="attrib">linebreak</kw> attribute are described above in the
  2482. discussion on renderable whitespace in the <kw
  2483. role="element">mtext</kw> element.  See <specref ref="presm_mtext"/>
  2484. for details.</p>
  2485.  
  2486. <p>In the case when both dimensional attributes and a linebreaking
  2487. attribute are set, the linebreaking attribute is ignored.</p>
  2488.  
  2489. <p>Note the warning about the legal grouping of <quote>space-like elements</quote>
  2490. given below, and the warning about the use of such elements for
  2491. <quote>tweaking</quote> or conveying meaning in <specref ref="presm_mpadded"/>. See also the other
  2492. elements that can render as whitespace, namely
  2493. <kw role="element">mtext</kw>, <kw role="element">mphantom</kw>, and 
  2494. <kw role="element">maligngroup</kw>.</p>
  2495. </div4>
  2496.  
  2497. <div4><head>Definition of space-like elements</head>
  2498.  
  2499. <p>A number of MathML presentation elements are <quote>space-like</quote> in the
  2500. sense that they typically render as whitespace, and do not affect the
  2501. mathematical meaning of the expressions in which they appear. As a
  2502. consequence, these elements often function in somewhat exceptional
  2503. ways in other MathML expressions. For example, space-like elements are
  2504. handled specially in the suggested rendering rules for
  2505. <kw role="element">mo</kw> given in <specref ref="presm_mo"/>. 
  2506. The following MathML elements are defined to be <quote>space-like</quote>:
  2507. <ulist>
  2508. <item><p>an <kw role="element">mtext</kw>, <kw role="element">mspace</kw>,
  2509. <kw role="element">maligngroup</kw>, or <kw role="element">malignmark</kw>
  2510. element;</p> </item>
  2511.  
  2512. <item><p>an <kw role="element">mstyle</kw>, <kw role="element">mphantom</kw>, or
  2513. <kw role="element">mpadded</kw> element, all of whose direct sub-expressions
  2514. are space-like;</p> </item>
  2515.  
  2516. <item><p>an <kw role="element">maction</kw> element whose selected
  2517. sub-expression exists and is space-like;</p> </item>
  2518.  
  2519. <item><p>an <kw role="element">mrow</kw> all of whose direct
  2520. sub-expressions are space-like.</p>
  2521. </item>
  2522. <!-- note: not an embellished space-like thing, though this would be arguable. -->
  2523. </ulist>
  2524. </p>
  2525.  
  2526. <p>Note that an <kw role="element">mphantom</kw> is <emph>not</emph>
  2527. automatically defined to be space-like, unless its content is
  2528. space-like. This is because operator spacing is affected by whether
  2529. adjacent elements are space-like. Since the
  2530. <kw role="element">mphantom</kw> element is primarily intended as an aid
  2531. in aligning expressions, operators adjacent to an
  2532. <kw role="element">mphantom</kw> should behave as if they were adjacent
  2533. to the <emph>contents</emph> of the <kw role="element">mphantom</kw>,
  2534. rather than to an equivalently sized area of whitespace.</p>
  2535. </div4>
  2536.  
  2537. <div4><head>Legal grouping of space-like elements</head>
  2538.  
  2539. <p>Authors who insert space-like elements or
  2540. <kw role="element">mphantom</kw> elements into an existing MathML
  2541. expression should note that such elements <emph>are</emph> counted as
  2542. arguments, in elements that require a specific number of arguments,
  2543. or that interpret different argument positions differently.</p>
  2544.  
  2545. <p>Therefore, space-like elements inserted into such a MathML element
  2546. should be grouped with a neighboring argument of that element by
  2547. introducing an <kw role="element">mrow</kw> for that purpose. For example,
  2548. to allow for vertical alignment on the right edge of the base of a
  2549. superscript, the expression
  2550. <eg role="mathml-error"><![CDATA[
  2551. <msup>
  2552.   <mi> x </mi>
  2553.   <malignmark edge="right"/>
  2554.   <mn> 2 </mn>
  2555. </msup>
  2556. ]]></eg>
  2557. is illegal, because <kw role="element">msup</kw> must have exactly 2 arguments;
  2558. the correct expression would be:
  2559. <eg role='mathml'><![CDATA[
  2560. <msup>
  2561.   <mrow>
  2562.     <mi> x </mi>
  2563.     <malignmark edge="right"/>
  2564.   </mrow>
  2565.   <mn> 2 </mn>
  2566. </msup>
  2567. ]]></eg>
  2568. </p>
  2569.  
  2570. <p>See also the warning about <quote>tweaking</quote> in
  2571. <specref ref="presm_mpadded"/>.</p>
  2572. </div4>
  2573. </div3>
  2574.  
  2575. <div3 id="presm_ms"><head>String Literal (<kw role="element">ms</kw>)</head>
  2576.  
  2577. <div4><head>Description</head>
  2578.  
  2579. <p>The <kw role="element">ms</kw> element is used to represent
  2580. <quote>string literals</quote> in expressions meant to be interpreted by
  2581. computer algebra systems or other systems containing <quote>programming
  2582. languages</quote>. By default, string literals are displayed surrounded by
  2583. double quotes. As explained in <specref ref="presm_mtext"/>, ordinary text
  2584. embedded in a mathematical expression should be marked up with <kw
  2585. role="element">mtext</kw>, or in some cases <kw role="element">mo</kw> or
  2586. <kw role="element">mi</kw>, but never with <kw role="element">ms</kw>.</p>
  2587.  
  2588. <p>Note that the string literals encoded by <kw role="element">ms</kw>
  2589. are <quote>Unicode strings</quote> rather than <quote>ASCII
  2590. strings</quote>. In practice, non-ASCII characters will typically be
  2591. represented by entity references.  For example,
  2592. <code><ms>&amp</ms></code> represents a
  2593. string literal containing a single character, <code>&</code>, and
  2594. <code><ms>&amp;amp;</ms></code> represents a
  2595. string literal containing 5 characters, the first one of which is
  2596. <code>&</code>.</p>
  2597.  
  2598. <p>Like all token elements, <kw role="element">ms</kw> <emph>does</emph> trim and
  2599. collapse whitespace in its content according to the rules of 
  2600. <specref ref="fund_collapse"/>, so whitespace intended to remain in
  2601. the content should be encoded as described in that section.</p>
  2602. </div4>
  2603.  
  2604. <div4><head>Attributes</head>
  2605.  
  2606. <p><kw role="element">ms</kw> elements accept the attributes listed in
  2607. <specref ref="presm_commatt"/>, and additionally: </p>
  2608. <table border="1">
  2609. <thead>
  2610. <tr>
  2611. <td>Name</td>
  2612. <td>values</td>
  2613. <td>default</td>
  2614. </tr>
  2615. </thead>
  2616. <tbody>
  2617. <tr>
  2618. <td>lquote</td>
  2619. <td>string</td>
  2620. <td><kw role="entity">quot</kw></td>
  2621. </tr>
  2622. <tr>
  2623. <td>rquote</td>
  2624. <td>string</td>
  2625. <td><kw role="entity">quot</kw></td>
  2626. </tr>
  2627. </tbody>
  2628. </table>
  2629.  
  2630. <p>In visual renderers, the content of an <kw role="element">ms</kw>
  2631. element is typically rendered with no extra spacing added around the
  2632. string, and a quote character at the beginning and the end of the
  2633. string. By default, the left and right quote characters are both the
  2634. standard double quote character <kw role="entity">quot</kw>. However,
  2635. these characters can be changed with the <kw role="attrib">lquote</kw> and
  2636. <kw role="attrib">rquote</kw> attributes respectively.</p>
  2637.  
  2638. <p>The content of <kw role="element">ms</kw> elements should be rendered
  2639. with visible <quote>escaping</quote> of certain characters in the content,
  2640. including at least <quote>double quote</quote> itself, and preferably whitespace
  2641. other than individual space characters. The intent is for the viewer to see that
  2642. the expression is a string literal, and to see exactly which
  2643. characters form its content. For example, <code><ms>double quote is
  2644. "</ms></code> might be rendered as "double quote is
  2645. \"".</p>
  2646. </div4>
  2647. </div3>
  2648.  
  2649.  
  2650. <div3 id="presm_mglyph"><head>Adding new character glyphs to MathML
  2651.   (<kw role="element">mglyph</kw>)</head>
  2652.  
  2653. <div4><head>Description</head>
  2654.  
  2655. <p>Unicode defines a large number of characters used in mathematics,
  2656. and in most cases, glyphs representing these characters are widely
  2657. available in a variety of fonts.  Although these characters should
  2658. meet almost all users needs, MathML recognizes that mathematics is not
  2659. static and that new characters are added when convenient.  Characters
  2660. that become well accepted will likely be eventually incorporated by
  2661. the Unicode Consortium or other standards bodies, but that is often a
  2662. lengthy process.  In the meantime, a mechanism is necessary for
  2663. accessing glyphs from non-standard fonts representing these characters.</p>
  2664.  
  2665. <p>The <kw role="element">mglyph</kw> element is the means by which
  2666. users can directly access glyphs for characters that are not defined
  2667. by Unicode, or not known to the renderer.  Similarly, the <kw
  2668. role="element">mglyph</kw> element can also be used to select glyph
  2669. variants for existing Unicode characters, as might be desirable when a
  2670. glyph variant has begun to differentiate itself as a new character by
  2671. taking on a distinguished mathematical meaning.</p>
  2672.  
  2673. <p>The <kw role="element">mglyph</kw> element names a specific
  2674. character glyph, and is valid inside any MathML leaf content listed in
  2675. <specref ref="presm_summary"/> (<kw role="element">mi</kw>, etc.) or
  2676. <specref ref="contm_container"/> (<kw role="element">ci</kw>, etc.)
  2677. unless otherwise restricted by an attribute (e.g. <kw
  2678. role="attrib">base</kw>=2 to <kw role="starttag">cn</kw>).  In order
  2679. for a visually-oriented renderer to render the character, the renderer
  2680. must be told what font to use and what index within that font to
  2681. use.</p> 
  2682. </div4>
  2683.  
  2684. <div4><head>Attributes</head>
  2685. <p><kw role="element">mglyph</kw> elements accept the attributes listed in
  2686. <specref ref="presm_commatt"/>, and the additional attributes listed here.</p>
  2687. <table border="1">
  2688. <thead>
  2689. <tr>
  2690. <td>Name</td>
  2691. <td>values</td>
  2692. <td>default</td>
  2693. </tr>
  2694. </thead>
  2695. <tbody>
  2696. <tr>
  2697. <td>alt</td>
  2698. <td>string</td>
  2699. <td>required</td>
  2700. </tr>
  2701. <tr>
  2702. <td>fontfamily</td>
  2703. <td>string | css-fontfamily</td>
  2704. <td>required</td>
  2705. </tr>
  2706. <tr>
  2707. <td>index</td>
  2708. <td>integer</td>
  2709. <td>required</td>
  2710. </tr>
  2711. </tbody>
  2712. </table>
  2713.  
  2714. <p>The <kw role="attrib">alt</kw> attribute provides an alternate name
  2715. for the glyph.  If the specified font can't be found, the renderer may
  2716. use this name in a warning message or some unknown glyph notation. The
  2717. name might also be used by an audio renderer or symbol processing
  2718. system and should be chosen to be descriptive.  The <kw
  2719. role="attrib">fontfamily</kw> and <kw role="attrib">index</kw>
  2720. uniquely identify the <kw role="element">mglyph</kw>; two <kw
  2721. role="element">mglyph</kw>s with the same values for <kw
  2722. role="attrib">fontfamily</kw> and <kw role="attrib">index</kw> should
  2723. be considered identical by applications that must determine whether
  2724. two characters/glyphs are identical.  The <kw role="attrib">alt</kw>
  2725. attribute should not be part of the identity test.</p>
  2726.  
  2727. <p>The <kw role="attrib">fontfamily</kw> and <kw
  2728. role="attrib">index</kw> attributes name a font and position within
  2729. that font.  All font properties apart from <kw
  2730. role="attrib">fontfamily</kw> are inherited.  Variants of the font
  2731. (e.g., bold) that may be inherited may be ignored if the variant of
  2732. the font is not present.</p>
  2733.  
  2734. <p>Authors should be aware that rendering requires the fonts
  2735. referenced by <kw role="element">mglyph</kw>, which the MathML
  2736. renderer may not have access to or may be not be supported by the
  2737. system on which the renderer runs. For these reasons, authors are
  2738. encouraged to use <kw role="element">mglyph</kw> only when
  2739. absolutely necessary, and not for stylistic purposes.</p>
  2740.  
  2741. </div4>
  2742.  
  2743. <div4><head>Example</head>
  2744.  
  2745. <p>The following example illustrates how a researcher might use the <kw
  2746. role="element">mglyph</kw> construct with an experimental font to work
  2747. with braid group notation.
  2748. <eg role='mathml'><![CDATA[
  2749. <mrow>
  2750.   <mi><mglyph fontfamily="my-braid-font" index="2" alt="23braid"/></mi>
  2751.   <mo>+</mo>
  2752.   <mi><mglyph fontfamily="my-braid-font" index="5" alt="132braid"/></mi>
  2753.   <mo>=</mo>
  2754.   <mi><mglyph fontfamily="my-braid-font" index="3" alt="13braid"/></mi>
  2755. </mrow>
  2756. ]]></eg>
  2757. This might render as:
  2758. <graphic role="display" source="image/f3006.gif" alt="\includegraphics{braids}"/> 
  2759. </p>
  2760.  
  2761. </div4>
  2762. </div3>
  2763. </div2>
  2764.  
  2765. <div2 id="presm_genlayout"><head>General Layout Schemata</head>
  2766.  
  2767. <p>Besides tokens there are several families of MathML presentation
  2768. elements. One family of elements deals with various
  2769. <quote>scripting</quote> notations, such as subscript and
  2770. superscript. Another family is concerned with matrices and tables. The
  2771. remainder of the elements, discussed in this section, describe other basic
  2772. notations such as fractions and radicals, or deal with general functions
  2773. such as setting style properties and error handling.</p>
  2774.  
  2775. <div3 id="presm_mrow"><head>Horizontally Group Sub-Expressions
  2776.   (<kw role="element">mrow</kw>)</head>
  2777.  
  2778. <div4><head>Description</head>
  2779.  
  2780. <p>An <kw role="element">mrow</kw> element is used to group together any
  2781. number of sub-expressions, usually consisting of one or more <kw
  2782. role="element">mo</kw> elements acting as <quote>operators</quote> on one
  2783. or more other expressions that are their <quote>operands</quote>.</p>
  2784.  
  2785. <p>Several elements automatically treat their arguments as if they were
  2786. contained in an <kw role="element">mrow</kw> element. See the discussion of
  2787. inferred <kw role="element">mrow</kw>s in <specref
  2788. ref="presm_reqarg"/>. See also <kw role="element">mfenced</kw> (<specref
  2789. ref="presm_mfenced"/>), which can effectively form an <kw
  2790. role="element">mrow</kw> containing its arguments separated by commas.</p>
  2791. </div4>
  2792.  
  2793. <div4><head>Attributes</head>
  2794.  
  2795. <p>This element only permits <kw role="attrib">id</kw>,
  2796. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  2797. <kw role="attrib">style</kw> attributes,
  2798. as described in <specref ref="fund_globatt"/>.</p>
  2799.  
  2800. <p><kw role="element">mrow</kw> elements are typically rendered visually
  2801. as a horizontal row of their arguments, left to right in the order in
  2802. which the arguments occur, or audibly as a sequence of renderings of
  2803. the arguments. The description in <specref ref="presm_mo"/> of suggested rendering
  2804. rules for <kw role="element">mo</kw> elements assumes that all horizontal
  2805. spacing between operators and their operands is added by the rendering
  2806. of <kw role="element">mo</kw> elements (or, more generally, embellished
  2807. operators), not by the rendering of the <kw role="element">mrow</kw>s
  2808. they are contained in.</p>
  2809.  
  2810. <p>MathML is designed to allow renderers to automatically
  2811. <emph>linebreak</emph> expressions (that is, to break excessively long
  2812. expressions into several lines), without requiring authors to specify
  2813. explicitly how this should be done. This is because linebreaking
  2814. positions can't be chosen well without knowing the width of the
  2815. display device and the current font size, which for many uses of
  2816. MathML will not be known except by the renderer at the time of each
  2817. rendering.</p>
  2818.  
  2819. <p>Determining good positions for linebreaks is complex, and rules for
  2820. this are not described here; whether and how it is done is up to each
  2821. MathML renderer. Typically, linebreaking will involve selection of
  2822. <quote>good</quote> points for insertion of linebreaks between successive
  2823. arguments of <kw role="element">mrow</kw> elements.</p>
  2824.  
  2825. <p>Although MathML does not require linebreaking or specify a
  2826. particular linebreaking algorithm, it has several features designed to
  2827. allow such algorithms to produce good results. These include the use
  2828. of special entities for certain operators, including invisible
  2829. operators (see <specref ref="presm_mo"/>), or for providing hints related to
  2830. linebreaking when necessary (see <specref ref="presm_mtext"/>), and the ability to
  2831. use nested <kw role="element">mrow</kw>s to describe sub-expression
  2832. structure (see below).</p>
  2833.  
  2834. <div5><head><kw role="element">mrow</kw> of one argument</head>
  2835.  
  2836. <p>MathML renderers are required to treat an <kw role="element">mrow</kw>
  2837. element containing exactly one argument as equivalent in all ways to
  2838. the single argument occurring alone, provided there are no attributes
  2839. on the <kw role="element">mrow</kw> element's start tag. If there are
  2840. attributes on the <kw role="element">mrow</kw> element's start tag, no
  2841. requirement of equivalence is imposed. This equivalence condition is
  2842. intended to simplify the implementation of MathML-generating software
  2843. such as template-based authoring tools. It directly affects the
  2844. definitions of embellished operator and space-like element and the
  2845. rules for determining the default value of the <kw role="attrib">form</kw>
  2846. attribute of an <kw role="element">mo</kw> element;
  2847. see <specref ref="presm_mo"/> and <specref
  2848. ref="presm_mspace"/>. See also the discussion of equivalence of MathML
  2849. expressions in <specref ref="interf"/>.</p>
  2850. </div5>
  2851. </div4>
  2852.  
  2853. <div4><head>Proper grouping of sub-expressions using <kw role="element">mrow</kw></head>
  2854.  
  2855. <p>Sub-expressions should be grouped by the document author in the same way
  2856. as they are grouped in the mathematical interpretation of the expression;
  2857. that is, according to the underlying <quote>syntax tree</quote> of the
  2858. expression. Specifically, operators and their mathematical arguments should
  2859. occur in a single <kw role="element">mrow</kw>; more than one operator
  2860. should occur directly in one <kw role="element">mrow</kw> only when they
  2861. can be considered (in a syntactic sense) to act together on the interleaved
  2862. arguments, e.g. for a single parenthesized term and its parentheses, for
  2863. chains of relational operators, or for sequences of terms separated by
  2864. <code>+</code> and <code>-</code>. A precise rule is given below.</p>
  2865.  
  2866. <p>Proper grouping has several purposes: it improves display by
  2867. possibly affecting spacing; it allows for more intelligent
  2868. linebreaking and indentation; and it simplifies possible semantic
  2869. interpretation of presentation elements by computer algebra systems,
  2870. and audio renderers.</p>
  2871.  
  2872. <p>Although improper grouping will sometimes result in suboptimal
  2873. renderings, and will often make interpretation other than pure visual
  2874. rendering difficult or impossible, any grouping of expressions using
  2875. <kw role="element">mrow</kw> is allowed in MathML syntax; that is,
  2876. renderers should not assume the rules for proper grouping will be
  2877. followed.</p>
  2878.  
  2879. <div5><head>Precise rule for proper grouping</head>
  2880.  
  2881. <p>A precise rule for when and how to nest sub-expressions using
  2882. <kw role="element">mrow</kw> is especially desirable when generating
  2883. MathML automatically by conversion from other formats for displayed
  2884. mathematics, such as &TeX;, which don't always specify how sub-expressions
  2885. nest. When a precise rule for grouping is desired, the following rule
  2886. should be used:</p>
  2887.  
  2888. <p>Two adjacent operators (i.e. <kw role="element">mo</kw> elements,
  2889. possibly embellished), possibly separated by operands (i.e. anything
  2890. other than operators), should occur in the same
  2891. <kw role="element">mrow</kw> only when the left operator has an infix or
  2892. prefix form (perhaps inferred), the right operator has an infix or
  2893. postfix form, and the operators are listed in the same group of
  2894. entries in the operator dictionary provided in <specref ref="oper-dict"/>.
  2895. In all other cases, nested <kw role="element">mrow</kw>s should be used.</p>
  2896.  
  2897. <p>When forming a nested <kw role="element">mrow</kw> (during generation
  2898. of MathML) that includes just one of two successive operators with
  2899. the forms mentioned above (which mean that either operator could in
  2900. principle act on the intervening operand or operands), it is necessary
  2901. to decide which operator acts on those operands directly (or would do
  2902. so, if they were present). Ideally, this should be determined from the
  2903. original expression; for example, in conversion from an
  2904. operator-precedence-based format, it would be the operator with the
  2905. higher precedence. If this cannot be determined directly from the
  2906. original expression, the operator that occurs later in the suggested
  2907. operator dictionary (<specref ref="oper-dict"/>) can be assumed to have 
  2908. a higher precedence for this purpose.</p>
  2909.  
  2910. <p>Note that the above rule has no effect on whether any MathML
  2911. expression is valid, only on the recommended way of generating MathML
  2912. from other formats for displayed mathematics or directly from written
  2913. notation.</p>
  2914.  
  2915. <p>(Some of the terminology used in stating the above rule in defined
  2916. in <specref ref="presm_mo"/>.)</p>
  2917. </div5>
  2918. </div4>
  2919.  
  2920. <div4><head>Examples</head>
  2921. <p>As an example, 2<mi>x</mi>+<mi>y</mi>-<mi>z</mi>
  2922. should be written as:
  2923. <eg role="mathml"><![CDATA[
  2924. <mrow>
  2925.   <mrow>
  2926.     <mn> 2 </mn>
  2927.     <mo> ⁢ </mo>
  2928.     <mi> x </mi>
  2929.   </mrow>
  2930.   <mo> + </mo>
  2931.   <mi> y </mi>
  2932.   <mo> - </mo>
  2933.   <mi> z </mi>
  2934. </mrow>
  2935. ]]></eg>
  2936. </p>
  2937.  
  2938. <p>The proper encoding of (<mi>x</mi>, <mi>y</mi>) furnishes a less obvious
  2939. example of nesting <kw role="element">mrow</kw>s:
  2940. <eg role='mathml'><![CDATA[
  2941. <mrow>
  2942.   <mo> ( </mo>
  2943.   <mrow>
  2944.     <mi> x </mi>
  2945.     <mo> , </mo>
  2946.     <mi> y </mi>
  2947.   </mrow>
  2948.   <mo> ) </mo>
  2949. </mrow>
  2950. ]]></eg>
  2951. </p>
  2952.  
  2953. <p>In this case, a nested <kw role="element">mrow</kw> is required inside
  2954. the parentheses, since parentheses and commas, thought of as fence and
  2955. separator <quote>operators</quote>, do not act together on their arguments.</p>
  2956. </div4>
  2957. </div3>
  2958.  
  2959. <div3 id="presm_mfrac"><head>Fractions (<kw role="element">mfrac</kw>)</head>
  2960.  
  2961. <div4><head>Description</head>
  2962.  
  2963. <p>The <kw role="element">mfrac</kw> element is used for fractions. It can
  2964. also be used to mark up fraction-like objects such as binomial coefficients
  2965. and Legendre symbols. The syntax for <kw role="element">mfrac</kw> is
  2966. <eg>
  2967. <mfrac> <emph>numerator</emph> <emph>denominator</emph> </mfrac>
  2968. </eg></p>
  2969.  
  2970. </div4>
  2971.  
  2972. <div4><head>Attributes of <kw role="element">mfrac</kw></head>
  2973. <p>In addition to the attributes listed below, this element permits
  2974. <kw role="attrib">id</kw>,
  2975. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  2976. <kw role="attrib">style</kw> attributes,
  2977. as described in <specref ref="fund_globatt"/>.</p>
  2978. <table border="1">
  2979. <thead>
  2980. <tr>
  2981. <td>Name</td>
  2982. <td>values</td>
  2983. <td>default</td>
  2984. </tr>
  2985. </thead>
  2986. <tbody>
  2987. <tr>
  2988. <td>linethickness</td>
  2989. <td>number [ v-unit ] | thin | medium | thick</td>
  2990. <td>1 (rule thickness)</td>
  2991. </tr>
  2992. <tr>
  2993. <td>numalign</td>
  2994. <td>left | center | right</td>
  2995. <td>center</td>
  2996. </tr>
  2997. <tr>
  2998. <td>denomalign</td>
  2999. <td>left | center | right</td>
  3000. <td>center</td>
  3001. </tr>
  3002. <tr>
  3003. <td>bevelled</td>
  3004. <td>true | false</td>
  3005. <td>false</td>
  3006. </tr>
  3007. </tbody>
  3008. </table>
  3009.  
  3010. <p>The <kw role="attrib">linethickness</kw> attribute indicates the thickness of
  3011. the horizontal <quote>fraction bar</quote>, or <quote>rule</quote>, typically used to render
  3012. fractions.  A fraction with <kw role="attrib">linethickness</kw>="0" renders
  3013. without the bar, and might be used within binomial coefficients. A
  3014. <kw role="attrib">linethickness</kw> greater than one might be used with nested
  3015. fractions.  These cases are shown below:
  3016. <graphic source="image/f3007.gif"
  3017.   alt="{a \choose b} \quad {a \over b} \above1pt {c \over d}"/></p>
  3018.  
  3019. <p>In general, the value of <kw role="attrib">linethickness</kw> can be a
  3020. number, as a multiplier of the default thickness of the fraction bar
  3021. (the default thickness is not specified by MathML), or a number with a
  3022. unit of vertical length (see <specref ref="fund_units"/>), or one of the keywords
  3023. <code>medium</code> (same as 1), <code>thin</code> (thinner than 1,
  3024. otherwise up to the renderer), or <code>thick</code> (thicker than 1,
  3025. otherwise up to the renderer).</p>
  3026.  
  3027. <p>The <kw role="attrib">numalign</kw> and 
  3028. <kw role="attrib">denomalign</kw> attributes control the horizontal
  3029. alignment of the numerator and denominator respectively.  Typically,
  3030. numerators and denominators are centered, but a very long numerator or
  3031. denominator might be displayed on several lines and a left alignment
  3032. might be more appropriate for displaying them.</p>
  3033.  
  3034. <p>The <kw role="attrib">bevelled</kw> attribute determines whether the
  3035. fraction is displayed with the numerator above the denominator
  3036. separated by a horizontal line or
  3037. whether a diagonal line is used to separate a slightly raised
  3038. numerator from a slightly lowered denominator.  The latter form
  3039. corresponds to the attribute value being <kw role="attval">true</kw>
  3040. and provides for a more compact form for simple numerator and
  3041. denominators. An example illustrating the bevelled form is show below:
  3042. <graphic source="image/f3008.gif"
  3043.   alt="\frac{1}{x^3 + \frac{x}{3}} = \raisebox{1ex}{$1$}\!
  3044.        \left/ \!\raisebox{-1ex}{$x^3+\frac{x}{3}$} \right."/>
  3045. </p>
  3046.  
  3047. <p>The <kw role="element">mfrac</kw> element sets <kw
  3048. role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, or if it
  3049. was already false increments <kw role="attrib">scriptlevel</kw> by 1,
  3050. within <emph>numerator</emph> and <emph>denominator</emph>. These
  3051. attributes are inherited by every element from its rendering environment,
  3052. but can be set explicitly only on the <kw role="element">mstyle</kw>
  3053. element. (See <specref ref="presm_mstyle"/>.) </p>
  3054. </div4>
  3055.  
  3056. <div4><head>Examples</head>
  3057.  
  3058. <p>The examples shown above can be represented in MathML as:
  3059. <eg role='mathml'><![CDATA[
  3060. <mrow>
  3061.    <mo> ( </mo>
  3062.    <mfrac linethickness="0">
  3063.       <mi> a </mi>
  3064.       <mi> b </mi>
  3065.    </mfrac>
  3066.    <mo> ) </mo>
  3067. </mrow>
  3068. <mfrac linethickness="2">
  3069.    <mfrac>
  3070.       <mi> a </mi>
  3071.       <mi> b </mi>
  3072.    </mfrac>
  3073.    <mfrac>
  3074.       <mi> c </mi>
  3075.       <mi> d </mi>
  3076.    </mfrac>
  3077. </mfrac>
  3078. ]]></eg>
  3079.  
  3080. <eg role='mathml'><![CDATA[
  3081. <mfrac>
  3082.    <mn> 1 </mn>
  3083.    <mrow>
  3084.       <msup>
  3085.          <mi> x </mi>
  3086.          <mn> 3 </mn>
  3087.        </msup>
  3088.        <mo> + </mo>
  3089.        <mfrac>
  3090.          <mi> x </mi>
  3091.          <mn> 3 </mn>
  3092.        </mfrac>
  3093.    </mrow>
  3094. </mfrac>
  3095. <mo> = </mo>
  3096. <mfrac bevelled="true">
  3097.    <mn> 1 </mn>
  3098.    <mrow>
  3099.       <msup>
  3100.          <mi> x </mi>
  3101.          <mn> 3 </mn>
  3102.        </msup>
  3103.        <mo> + </mo>
  3104.        <mfrac>
  3105.          <mi> x </mi>
  3106.          <mn> 3 </mn>
  3107.        </mfrac>
  3108.    </mrow>
  3109. </mfrac>
  3110. ]]></eg>
  3111.  
  3112. </p>
  3113.  
  3114. <p>A more generic example is:
  3115. <eg role='mathml'><![CDATA[
  3116. <mfrac>
  3117.    <mrow>
  3118.       <mn> 1 </mn>
  3119.       <mo> + </mo>
  3120.       <msqrt>
  3121.          <mn> 5 </mn>
  3122.       </msqrt>
  3123.    </mrow>
  3124.    <mn> 2 </mn>
  3125. </mfrac>
  3126. ]]></eg>
  3127. </p>
  3128. </div4>
  3129. </div3>
  3130.  
  3131. <div3 id="presm_mroot"><head>Radicals (<kw role="element">msqrt</kw>, <kw role="element">mroot</kw>)</head>
  3132.  
  3133. <div4><head>Description</head>
  3134.  
  3135. <p>These elements construct radicals. The <kw role="element">msqrt</kw> element is
  3136. used for square roots, while the <kw role="element">mroot</kw> element is used
  3137. to draw radicals with indices, e.g. a cube root. The syntax for these
  3138. elements is:
  3139. <eg>
  3140. <msqrt> <emph>base</emph> </msqrt>
  3141. <mroot> <emph>base</emph> <emph>index</emph> </mroot>
  3142. </eg>
  3143. </p>
  3144.  
  3145. <p>The <kw role="element">mroot</kw> element requires exactly 2 arguments.
  3146. However, <kw role="element">msqrt</kw> accepts any number of arguments; if
  3147. this number is not 1, its contents are treated as a single <quote>inferred
  3148. <kw role="element">mrow</kw></quote> containing its arguments, as described in
  3149. <specref ref="presm_reqarg"/>.</p>
  3150. </div4>
  3151.  
  3152. <div4><head>Attributes</head>
  3153. <p>This element only permits <kw role="attrib">id</kw>,
  3154. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  3155. <kw role="attrib">style</kw> attributes,
  3156. as described in <specref ref="fund_globatt"/>.</p>
  3157.  
  3158. <p>The <kw role="element">mroot</kw> element increments <kw
  3159. role="attrib">scriptlevel</kw> by 2, and sets <kw
  3160. role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, within
  3161. <emph>index</emph>, but leaves both attributes unchanged within
  3162. <emph>base</emph>. The <kw role="element">msqrt</kw> element leaves both
  3163. attributes unchanged within all its arguments. These attributes are
  3164. inherited by every element from its rendering environment, but can be set
  3165. explicitly only on <kw role="element">mstyle</kw>. (See <specref
  3166. ref="presm_mstyle"/>.)</p>
  3167. </div4>
  3168. </div3>
  3169.  
  3170. <div3 id="presm_mstyle"><head>Style Change (<kw role="element">mstyle</kw>)</head>
  3171.  
  3172. <div4><head>Description</head>
  3173.  
  3174. <p>The <kw role="element">mstyle</kw> element is used to make style
  3175. changes that affect the rendering of its
  3176. contents. <kw role="element">mstyle</kw> can be given any attribute
  3177. accepted by any MathML presentation element provided that the
  3178. attribute value is inherited, computed or has a default value;
  3179. presentation element attributes whose values are required are not
  3180. accepted by the <kw role="element">mstyle</kw> element.  In addition
  3181. <kw role="element">mstyle</kw> can also be given certain special
  3182. attributes listed below.</p> 
  3183.  
  3184. <p>The <kw role="element">mstyle</kw> element accepts any number of
  3185. arguments.  If this number is not 1, its contents are treated as a single
  3186. <quote>inferred <kw role="element">mrow</kw></quote> formed from all its
  3187. arguments, as described in <specref ref="presm_reqarg"/>.</p>
  3188.  
  3189. <p>Loosely speaking, the effect of the <kw role="element">mstyle</kw> element
  3190. is to change the default value of an attribute for the elements it
  3191. contains. Style changes work in one of several ways, depending on 
  3192. the way in which default values are specified for an attribute.
  3193. The cases are:
  3194. <ulist>
  3195. <item><p>Some attributes, such as <kw role="attrib">displaystyle</kw> or 
  3196. <kw role="attrib">scriptlevel</kw> (explained below), are inherited 
  3197. from the surrounding context when they are not explicitly set. Specifying
  3198. such an attribute on an <kw role="element">mstyle</kw> element sets the
  3199. value that will be inherited by its child elements. Unless a child element
  3200. overrides this inherited value, it will pass it on to its children, and
  3201. they will pass it to their children, and so on. But if a child element does
  3202. override it, either by an explicit attribute setting or automatically (as
  3203. is common for <kw role="attrib">scriptlevel</kw>), the new (overriding)
  3204. value will be passed on to that element's children, and then to their
  3205. children, etc, until it is again overridden.</p>
  3206. </item>
  3207.  
  3208. <item><p>Other attributes, such as <kw role="attrib">linethickness</kw> on
  3209. <kw role="element">mfrac</kw>, have default values that are not normally
  3210. inherited. That is, if the <kw role="attrib">linethickness</kw> attribute
  3211. is not set on the start tag of an <kw role="element">mfrac</kw> element,
  3212. it will normally use the default value of <kw role="attval">1</kw>, even if it was
  3213. contained in a larger <kw role="element">mfrac</kw> element that set this
  3214. attribute to a different value. For attributes like this, specifying a
  3215. value with an <kw role="element">mstyle</kw> element has the effect of
  3216. changing the default value for all elements within its scope. The net
  3217. effect is that setting the attribute value with <kw
  3218. role="element">mstyle</kw> propagates the change to all the elements it
  3219. contains directly or indirectly, except for the individual elements on
  3220. which the value is overridden. Unlike in the case of inherited attributes,
  3221. elements that explicitly override this attribute have no effect on this
  3222. attribute's value in their children.</p>
  3223. </item>
  3224. <item><p>Another group of attributes, such as <kw
  3225. role="attrib">stretchy</kw> and <kw role="attrib">form</kw>, are
  3226. computed from operator dictionary information, position in the
  3227. enclosing <kw role="element">mrow</kw>, and other similar data.  For
  3228. these attributes, a value specified by an enclosing <kw
  3229. role="element">mstyle</kw> overrides the value that would normally be
  3230. computed.</p>
  3231. </item>
  3232. </ulist>
  3233.  
  3234. </p>
  3235.  
  3236. <p>Note that attribute values inherited from an
  3237. <kw role="element">mstyle</kw> in any manner affect a given element
  3238. in the <kw role="element">mstyle</kw>'s content only if that attribute is
  3239. not given a value in that element's start tag. On any element for
  3240. which the attribute is set explicitly, the value specified on the
  3241. start tag overrides the inherited value. The only exception to this
  3242. rule is when the value given on the start tag is documented as
  3243. specifying an incremental change to the value inherited from that
  3244. element's context or rendering environment.</p>
  3245.  
  3246. <p>Note also that the difference between inherited and non-inherited
  3247. attributes set by <kw role="element">mstyle</kw>, explained above, only
  3248. matters when the attribute is set on some element within the
  3249. <kw role="element">mstyle</kw>'s contents that has children also
  3250. setting it. Thus it never matters for attributes, such as
  3251. <kw role="attrib">color</kw>, which can only be set on token elements (or on
  3252. <kw role="element">mstyle</kw> itself).</p>
  3253.  
  3254. <p>There is one exceptional element, <kw role="element">mpadded</kw>,
  3255. whose attributes cannot be set with <kw role="element">mstyle</kw>.
  3256. The <kw role="element">mpadded</kw> element shares several attribute
  3257. names with the <kw role="element">mspace</kw> and <kw
  3258. role="element">mo</kw> elements.  Thus, when the attributes <kw
  3259. role="attrib">width</kw>, <kw role="attrib">height</kw> and <kw
  3260. role="attrib">depth</kw> are specified on an <kw
  3261. role="element">mstyle</kw> element, they apply only to the <kw
  3262. role="element">mspace</kw> element, and not the corresponding
  3263. attributes of <kw role="element">mpadded</kw>. Similarly, when <kw
  3264. role="attrib">lspace</kw> is set with <kw role="element">mstyle</kw>,
  3265. it applies only to the <kw role="element">mo</kw> element.</p> </div4>
  3266.  
  3267. <div4><head>Attributes</head>
  3268.  
  3269. <p>As stated above, <kw role="element">mstyle</kw> accepts all
  3270. attributes of all MathML presentation elements which do not have
  3271. required values.  That is, all attributes which have an explicit
  3272. default value or a default value which is inherited or computed are
  3273. accepted by the <kw role="element">mstyle</kw> element.</p>
  3274.  
  3275. <p>This element also accepts
  3276. <kw role="attrib">id</kw>,
  3277. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  3278. <kw role="attrib">style</kw> attributes,
  3279. as described in <specref ref="fund_globatt"/>.</p>
  3280.  
  3281. <p>Additionally, <kw role="element">mstyle</kw> can be given the following special
  3282. attributes that are implicitly inherited by every MathML element as
  3283. part of its rendering environment:
  3284. <table border="1">
  3285. <thead>
  3286. <tr>
  3287. <td>Name</td>
  3288. <td>values</td>
  3289. <td>default</td>
  3290. </tr>
  3291. </thead>
  3292. <tbody>
  3293. <tr>
  3294. <td>scriptlevel</td>
  3295. <td>['+' | '-'] unsigned-integer</td>
  3296. <td>inherited</td>
  3297. </tr>
  3298. <tr>
  3299. <td>displaystyle</td>
  3300. <td>true | false</td>
  3301. <td>inherited</td>
  3302. </tr>
  3303. <tr>
  3304. <td>scriptsizemultiplier</td>
  3305. <td>number</td>
  3306. <td>0.71</td>
  3307. </tr>
  3308. <tr>
  3309. <td>scriptminsize</td>
  3310. <td>number v-unit</td>
  3311. <td>8pt</td>
  3312. </tr>
  3313. <tr>
  3314. <td>color</td>
  3315. <td>#rgb | #rrggbb | html-color-name</td>
  3316. <td>inherited</td>
  3317. </tr>
  3318. <tr>
  3319. <td>background</td>
  3320. <td>#rgb | #rrggbb | transparent | html-color-name</td>
  3321. <td>transparent</td>
  3322. </tr>
  3323. <tr>
  3324. <td>veryverythinmathspace</td>
  3325. <td>number h-unit</td>
  3326. <td>0.0555556em</td>
  3327. </tr>
  3328. <tr>
  3329. <td>verythinmathspace</td>
  3330. <td>number h-unit</td>
  3331. <td>0.111111em</td>
  3332. </tr>
  3333. <tr>
  3334. <td>thinmathspace</td>
  3335. <td>number h-unit</td>
  3336. <td>0.166667em</td>
  3337. </tr>
  3338. <tr>
  3339. <td>mediummathspace</td>
  3340. <td>number h-unit</td>
  3341. <td>0.222222em</td>
  3342. </tr>
  3343. <tr>
  3344. <td>thickmathspace</td>
  3345. <td>number h-unit</td>
  3346. <td>0.277778em</td>
  3347. </tr>
  3348. <tr>
  3349. <td>verythickmathspace</td>
  3350. <td>number h-unit</td>
  3351. <td>0.333333em</td>
  3352. </tr>
  3353. <tr>
  3354. <td>veryverythickmathspace</td>
  3355. <td>number h-unit</td>
  3356. <td>0.388889em</td>
  3357. </tr>
  3358. </tbody>
  3359. </table>
  3360. </p>
  3361.  
  3362. <div5><head><kw role="attrib">scriptlevel</kw> and <kw role="attrib">displaystyle</kw></head>
  3363.  
  3364. <p>MathML uses two attributes, <kw role="attrib">displaystyle</kw> and
  3365. <kw role="attrib">scriptlevel</kw>, to control orthogonal presentation features
  3366. that &TeX; encodes into one <kw role="attrib">style</kw> attribute with values
  3367. \displaystyle, \textstyle, \scriptstyle, and \scriptscriptstyle. The
  3368. corresponding values of <kw role="attrib">displaystyle</kw> and
  3369. <kw role="attrib">scriptlevel</kw> for those &TeX; styles would be <kw role="attval">true</kw> and
  3370. <kw role="attval">0</kw>, <kw role="attval">false</kw> and 
  3371. <kw role="attval">0</kw>, <kw role="attval">false</kw> and 
  3372. <kw role="attval">1</kw>, and <kw role="attval">false</kw> and <kw role="attval">2</kw>,
  3373. respectively.</p>
  3374.  
  3375. <p>The main effect of the <kw role="attrib">displaystyle</kw> attribute is that
  3376. it determines the effect of other attributes such as the
  3377. <kw role="attrib">largeop</kw> and <kw role="attrib">movablescripts</kw> attributes of
  3378. <kw role="element">mo</kw>. The main effect of the
  3379. <kw role="attrib">scriptlevel</kw> attribute is to control the font
  3380. size. Typically, the higher the <kw role="attrib">scriptlevel</kw>, the smaller
  3381. the font size.  (Non-visual renderers can respond to the font size in
  3382. an analogous way for their medium.)  More sophisticated renderers may
  3383. also choose to use these attributes in other ways, such as rendering
  3384. expressions with <kw role="attrib">displaystyle</kw>=<kw role="attval">false</kw> in a more
  3385. vertically compressed manner.</p>
  3386.  
  3387. <p>These attributes are given initial values for the outermost
  3388. expression of an instance of MathML based on its rendering
  3389. environment. A short list of layout schemata described below modify
  3390. these values for some of their sub-expressions. Otherwise, values are
  3391. determined by inheritance whenever they are not directly specified on
  3392. a given element's start tag.</p>
  3393.  
  3394. <p>For an instance of MathML embedded in a textual data format (such
  3395. as HTML) in <quote>display</quote> mode, i.e. in place of a paragraph,
  3396. <kw role="attrib">displaystyle</kw> = <kw role="attval">true</kw> and 
  3397. <kw role="attrib">scriptlevel</kw> = <kw role="attval">0</kw> for the 
  3398. outermost expression of the embedded MathML; if the
  3399. MathML is embedded in <quote>inline</quote> mode, i.e. in place of a character,
  3400. <kw role="attrib">displaystyle</kw> = <kw role="attval">false</kw> and 
  3401. <kw role="attrib">scriptlevel</kw> = <kw role="attval">0</kw> for 
  3402. the outermost expression. See <specref ref="interf"/> for further
  3403. discussion of the distinction between <quote>display</quote> and <quote>inline</quote>
  3404. embedding of MathML and how this can be specified in particular
  3405. instances. In general, a MathML renderer may determine these initial
  3406. values in whatever manner is appropriate for the location and context
  3407. of the specific instance of MathML it is rendering, or if it has no
  3408. way to determine this, based on the way it is most likely to be used;
  3409. as a last resort it is suggested that it use the most generic values
  3410. <kw role="attrib">displaystyle</kw> = "<kw role="attval">true</kw>" and 
  3411. <kw role="attrib">scriptlevel</kw> = "<kw role="attval">0</kw>".</p>
  3412.  
  3413. <p>The MathML layout schemata that typically display some of their
  3414. arguments in smaller type or with less vertical spacing, namely the
  3415. elements for scripts, fractions, radicals, and tables or matrices,
  3416. set <kw role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, and in some cases increase
  3417. <kw role="attrib">scriptlevel</kw>, for those arguments. The new values are inherited
  3418. by all sub-expressions within those arguments, unless they are
  3419. overridden.</p>
  3420.  
  3421. <p>The specific rules by which each element modifies
  3422. <kw role="attrib">displaystyle</kw> and/or <kw role="attrib">scriptlevel</kw> are given in the
  3423. specification for each element that does so; the complete list of
  3424. elements that modify either attribute are: the <quote>scripting</quote> elements
  3425. <kw role="element">msub</kw>, <kw role="element">msup</kw>, <kw role="element">msubsup</kw>,
  3426. <kw role="element">munder</kw>, <kw role="element">mover</kw>,
  3427. <kw role="element">munderover</kw>, and <kw role="element">mmultiscripts</kw>; and the
  3428. elements <kw role="element">mfrac</kw>, <kw role="element">mroot</kw>, and
  3429. <kw role="element">mtable</kw>.</p>
  3430.  
  3431. <p>When <kw role="element">mstyle</kw> is given a
  3432. <kw role="attrib">scriptlevel</kw> attribute with no sign, it sets the value of
  3433. <kw role="attrib">scriptlevel</kw> within its contents to the value given, which
  3434. must be a nonnegative integer. When the attribute value consists of a
  3435. sign followed by an integer, the value of <kw role="attrib">scriptlevel</kw> is
  3436. incremented (for '+') or decremented (for '-') by the amount
  3437. given. The incremental syntax for this attribute is an exception to
  3438. the general rules for setting inherited attributes using
  3439. <kw role="element">mstyle</kw>, and is not allowed by any other attribute
  3440. on <kw role="element">mstyle</kw>.</p>
  3441.  
  3442. <p>Whenever the <kw role="attrib">scriptlevel</kw> is changed, either
  3443. automatically or by being explicitly incremented, decremented, or set,
  3444. the current font size is multiplied by the value of
  3445. <kw role="attrib">scriptsizemultiplier</kw> to the power of the change in
  3446. <kw role="attrib">scriptlevel</kw>. For example, if <kw role="attrib">scriptlevel</kw> is
  3447. increased by 2, the font size is multiplied by
  3448. <kw role="attrib">scriptsizemultiplier</kw> twice in succession; if
  3449. <kw role="attrib">scriptlevel</kw> is explicitly set to 2 when it had been 3,
  3450. the font size is divided by <kw
  3451. role="attrib">scriptsizemultiplier</kw>.
  3452. References to <kw role="attrib">fontsize</kw> in this section should be 
  3453. interpreted to mean either the <kw role="attrib">fontsize</kw> attribute
  3454. or the <kw role="attrib">mathsize</kw> attribute.
  3455. </p>
  3456.  
  3457. <p>The default value of <kw role="attrib">scriptsizemultiplier</kw> is less than
  3458. one (in fact, it is approximately the square root of 1/2), resulting
  3459. in a smaller font size with increasing <kw role="attrib">scriptlevel</kw>. To
  3460. prevent scripts from becoming unreadably small, the font size is never
  3461. allowed to go below the value of <kw role="attrib">scriptminsize</kw> as a
  3462. result of a change to <kw role="attrib">scriptlevel</kw>, though it can be set
  3463. to a lower value using the <kw role="attrib">fontsize</kw> attribute (<specref
  3464. ref="presm_commatt"/>) on <kw role="element">mstyle</kw> or on token
  3465. elements. If a change to <kw role="attrib">scriptlevel</kw> would cause the font
  3466. size to become lower than <kw role="attrib">scriptminsize</kw> using the above
  3467. formula, the font size is instead set equal to
  3468. <kw role="attrib">scriptminsize</kw> within the sub-expression for which
  3469. <kw role="attrib">scriptlevel</kw> was changed.</p>
  3470.  
  3471. <p>In the syntax for <kw role="attrib">scriptminsize</kw>, <kw
  3472. role="attrib">v-unit</kw> represents a unit of vertical length (as
  3473. described in <specref ref="fund_units"/>). The most common unit for specifying font sizes
  3474. in typesetting is <code>pt</code> (points).</p>
  3475.  
  3476. <p>Explicit changes to the <kw role="attrib">fontsize</kw> attribute have no
  3477. effect on the value of <kw role="attrib">scriptlevel</kw>.</p>
  3478. </div5>
  3479.  
  3480. <div5><head>Further details on <kw role="attrib">scriptlevel</kw> for renderers</head>
  3481.  
  3482. <p>For MathML renderers that support CSS style sheets, or some other
  3483. analogous style sheet mechanism, absolute or relative changes to
  3484. <kw role="attrib">fontsize</kw> (or other attributes) may occur implicitly on
  3485. any element in response to a style sheet. Changes to
  3486. <kw role="attrib">fontsize</kw> of this kind also have no effect on
  3487. <kw role="attrib">scriptlevel</kw>. A style sheet-induced change to
  3488. <kw role="attrib">fontsize</kw> overrides <kw role="attrib">scriptminsize</kw> in the same
  3489. way as for an explicit change to <kw role="attrib">fontsize</kw> in the
  3490. element's start tag (discussed above), whether it is specified in the
  3491. style sheet as an absolute or a relative change. (However, any
  3492. subsequent <kw role="attrib">scriptlevel</kw>-induced change to
  3493. <kw role="attrib">fontsize</kw> will still be affected by it.) As is required
  3494. for inherited attributes in CSS, the style sheet-modified
  3495. <kw role="attrib">fontsize</kw> is inherited by child elements.</p>
  3496.  
  3497. <p>If the same element is subject to both a style sheet-induced and an
  3498. automatic (<kw role="attrib">scriptlevel</kw>-related) change to its own
  3499. <kw role="attrib">fontsize</kw>, the <kw role="attrib">scriptlevel</kw>-related change is
  3500. done first – in fact, in the simplest implementation of the
  3501. element-specific rules for <kw role="attrib">scriptlevel</kw>, this change would
  3502. be done by the element's parent as part of producing the rendering
  3503. properties it passes to the given element, since it is the parent
  3504. element that knows whether <kw role="attrib">scriptlevel</kw> should be changed
  3505. for each of its child elements.</p>
  3506.  
  3507. <p>If the element's own <kw role="attrib">fontsize</kw> is changed by a style
  3508. sheet and it also changes <kw role="attrib">scriptlevel</kw> (and thus
  3509. <kw role="attrib">fontsize</kw>) for one of its children, the style
  3510. sheet-induced change is done first, followed by the change inherited
  3511. by that child. If more than one child's <kw role="attrib">scriptlevel</kw> is
  3512. changed, the change inherited by each child has no effect on the other
  3513. children. (As a mnemonic rule that applies to a <quote>parse tree</quote> of
  3514. elements and their children, style sheet-induced changes to
  3515. <kw role="attrib">fontsize</kw> can be associated to nodes of the tree, i.e. to
  3516. MathML elements, and <kw role="attrib">scriptlevel</kw>-related changes can be
  3517. associated to the edges between parent and child elements; then the
  3518. order of the associated changes corresponds to the order of nodes and
  3519. edges in each path down the tree.) For general information on the
  3520. relative order of processing of properties set by style sheets versus by
  3521. attributes, see the appropriate subsection of CSS-compatible
  3522. attributes in <specref ref="fund_cssatt"/>.</p>
  3523.  
  3524. <p>If <kw role="attrib">scriptlevel</kw> is changed incrementally by an
  3525. <kw role="element">mstyle</kw> element that also sets certain other
  3526. attributes, the overall effect of the changes may depend on the order
  3527. in which they are processed. In such cases, the attributes in the
  3528. following list should be processed in the following order, regardless
  3529. of the order in which they occur in the XML-format attribute list of
  3530. the <kw role="element">mstyle</kw> start tag:
  3531. <kw role="attrib">scriptsizemultiplier</kw>, <kw role="attrib">scriptminsize</kw>,
  3532. <kw role="attrib">scriptlevel</kw>, <kw role="attrib">fontsize</kw>.</p>
  3533.  
  3534. <p>Note that <kw role="attrib">scriptlevel</kw> can, in principle, attain any
  3535. integral value by being decremented sufficiently, even though it can
  3536. only be explicitly set to nonnegative values. Negative values of
  3537. <kw role="attrib">scriptlevel</kw> generated in this way are legal and should
  3538. work as described, generating font sizes larger than those of the
  3539. surrounding expression. Since <kw role="attrib">scriptlevel</kw> is initially 0
  3540. and never decreases automatically, it will always be nonnegative
  3541. unless it is decremented past 0 using <kw role="element">mstyle</kw>.</p>
  3542.  
  3543. <p>Explicit decrements of <kw role="attrib">scriptlevel</kw> after the font size
  3544. has been limited by <kw role="attrib">scriptminsize</kw> as described above
  3545. would produce undesirable results. This might occur, for example, in a
  3546. representation of a continued fraction, in which the scriptlevel was
  3547. decremented for part of the denominator back to its value for the
  3548. fraction as a whole, if the continued fraction itself was located in a
  3549. place that had a high <kw role="attrib">scriptlevel</kw>. To prevent this
  3550. problem, MathML renderers should, when decrementing
  3551. <kw role="attrib">scriptlevel</kw>, use as the initial font size the value the
  3552. font size would have had if it had never been limited by
  3553. <kw role="attrib">scriptminsize</kw>. They should not, however, ignore the
  3554. effects of explicit settings of <kw role="attrib">fontsize</kw>, even to values
  3555. below <kw role="attrib">scriptminsize</kw>.</p>
  3556.  
  3557. <p>Since MathML renderers may be unable to make use of arbitrary font
  3558. sizes with good results, they may wish to modify the mapping from
  3559. scriptlevel to fontsize to produce better renderings in their
  3560. judgment. In particular, if fontsizes have to be rounded to available
  3561. values, or limited to values within a range, the details of how this
  3562. is done are up to the renderer. Renderers should, however, ensure that
  3563. a series of incremental changes to <kw role="attrib">scriptlevel</kw> resulting in its
  3564. return to the same value for some sub-expression that it had in a
  3565. surrounding expression results in the same fontsize for that
  3566. sub-expression as for the surrounding expression.</p>
  3567. </div5>
  3568.  
  3569. <div5><head>Color and background attributes</head>
  3570.  
  3571. <p>Color and background attributes are discussed in <specref
  3572. ref="presm_color"/>.</p> 
  3573.  
  3574. </div5>
  3575.  
  3576.  
  3577. <div5><head>Precise background region not specified</head>
  3578.  
  3579. <p>The suggested MathML visual rendering rules do not define the
  3580. precise extent of the region whose background is affected by using the
  3581. <kw role="attrib">background</kw> attribute on <kw role="element">mstyle</kw>,
  3582. except that, when <kw role="element">mstyle</kw>'s content does not have
  3583. negative dimensions and its drawing region is not overlapped by other
  3584. drawing due to surrounding negative spacing, this region should lie
  3585. behind all the drawing done to render the content of the
  3586. <kw role="element">mstyle</kw>, but should not lie behind any of the
  3587. drawing done to render surrounding expressions. The effect of overlap
  3588. of drawing regions caused by negative spacing on the extent of the
  3589. region affected by the <kw role="attrib">background</kw> attribute is not
  3590. defined by these rules.</p>
  3591. </div5>
  3592.  
  3593. <div5><head>Meaning of named mathspaces </head>
  3594.  
  3595. <p>The spacing between operators is often one of a small number of
  3596. potential values.  MathML names these values and allows their values to
  3597. be changed.  Because the default values for spacing around operators
  3598. that are given in the operator dictionary <specref ref="oper-dict"/>
  3599. are defined using these named spaces, changing their values will produce
  3600. tighter or looser spacing.  These values can be used anywhere a <kw
  3601. role="attrib">h-unit</kw> or <kw role="attrib">v-unit</kw> unit is
  3602. allowed.  See <specref ref="fund_units"/>.</p>
  3603.  
  3604. <p>
  3605. The predefined <kw role="attrib">namedspace</kw>s are:
  3606. <kw role="attval">veryverythinmathspace</kw>,
  3607. <kw role="attval">verythinmathspace</kw>,
  3608. <kw role="attval">thinmathspace</kw>,
  3609. <kw role="attval">mediummathspace</kw>,
  3610. <kw role="attval">thickmathspace</kw>,
  3611. <kw role="attval">verythickmathspace</kw>, or
  3612. <kw role="attval">veryverythickmathspace</kw>.
  3613. The default values of <kw role="attval">veryverythinmathspace</kw>...
  3614. <kw role="attval">veryverythickmathspace</kw> are 1/18em...7/18em,
  3615. respectively.</p>
  3616. </div5>
  3617.  
  3618. </div4>
  3619.  
  3620. <div4><head>Examples</head>
  3621.  
  3622. <p>The example of limiting the stretchiness of a parenthesis shown in the
  3623. section on <mo>,
  3624. <eg role='mathml'><![CDATA[
  3625. <mrow>
  3626.    <mo maxsize="1"> ( </mo>
  3627.    <mfrac> <mi> a </mi> <mi> b </mi> </mfrac>
  3628.    <mo maxsize="1"> ) </mo>
  3629. </mrow>
  3630. ]]></eg>
  3631. </p>
  3632.  
  3633. <p>can be rewritten using <kw role="element">mstyle</kw> as:
  3634. <eg role='mathml'><![CDATA[
  3635. <mstyle maxsize="1">
  3636.    <mrow>
  3637.       <mo> ( </mo>
  3638.       <mfrac> <mi> a </mi> <mi> b </mi> </mfrac>
  3639.       <mo> ) </mo>
  3640.    </mrow>
  3641. </mstyle>
  3642. ]]></eg>
  3643. </p>
  3644. </div4>
  3645. </div3>
  3646.  
  3647. <div3 id="presm_merror"><head>Error Message (<kw role="element">merror</kw>)</head>
  3648.  
  3649. <div4><head>Description</head>
  3650.  
  3651. <p>The <kw role="element">merror</kw> element displays its contents as an
  3652. <quote>error message</quote>. This might be done, for example, by displaying the
  3653. contents in red, flashing the contents, or changing the background
  3654. color. The contents can be any expression or expression sequence.</p>
  3655.  
  3656. <p><kw role="element">merror</kw> accepts any number of arguments; if
  3657. this number is not 1, its contents are treated as a single <quote>inferred
  3658. <kw role="element">mrow</kw></quote> as described in <specref ref="presm_reqarg"/>.</p>
  3659.  
  3660. <p>The intent of this element is to provide a standard way for
  3661. programs that <emph>generate</emph> MathML from other input to report
  3662. syntax errors in their input. Since it is anticipated that
  3663. preprocessors that parse input syntaxes designed for easy hand entry
  3664. will be developed to generate MathML, it is important that they have
  3665. the ability to indicate that a syntax error occurred at a certain
  3666. point. See <specref ref="interf_error"/>.</p>
  3667.  
  3668. <p>The suggested use of <kw role="element">merror</kw> for reporting
  3669. syntax errors is for a preprocessor to replace the erroneous part of
  3670. its input with an <kw role="element">merror</kw> element containing a
  3671. description of the error, while processing the surrounding expressions
  3672. normally as far as possible. By this means, the error message will be
  3673. rendered where the erroneous input would have appeared, had it been
  3674. correct; this makes it easier for an author to determine from the
  3675. rendered output what portion of the input was in error.</p>
  3676.  
  3677. <p>No specific error message format is suggested here, but as with
  3678. error messages from any program, the format should be designed to make
  3679. as clear as possible (to a human viewer of the rendered error message)
  3680. what was wrong with the input and how it can be fixed. If the
  3681. erroneous input contains correctly formatted subsections, it may be
  3682. useful for these to be preprocessed normally and included in the error
  3683. message (within the contents of the <kw role="element">merror</kw>
  3684. element), taking advantage of the ability of
  3685. <kw role="element">merror</kw> to contain arbitrary MathML expressions
  3686. rather than only text.</p>
  3687. </div4>
  3688.  
  3689. <div4><head>Attributes</head>
  3690.  
  3691. <p>This element only permits <kw role="attrib">id</kw>,
  3692. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  3693. <kw role="attrib">style</kw> attributes,
  3694. as described in <specref ref="fund_globatt"/>.</p>
  3695. </div4>
  3696.  
  3697. <div4><head>Example</head>
  3698.  
  3699. <p>If a MathML syntax-checking preprocessor
  3700. received the input
  3701. <eg role='mathml-error'><![CDATA[
  3702. <mfraction>
  3703.    <mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow>
  3704.    <mn> 2 </mn>
  3705. </mfraction>
  3706. ]]></eg>
  3707. which contains the non-MathML element <kw role="element">mfraction</kw>
  3708. (presumably in place of the MathML element <kw role="element">mfrac</kw>),
  3709. it might generate the error message
  3710. <eg role='mathml'><![CDATA[
  3711. <merror>
  3712.    <mtext> Unrecognized element: mfraction;
  3713.            arguments were:  </mtext>
  3714.    <mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow>
  3715.    <mtext>  and  </mtext>
  3716.    <mn> 2 </mn>
  3717. </merror>
  3718. ]]></eg>
  3719. </p>
  3720.  
  3721. <p>Note that the preprocessor's input is not, in this case, valid MathML,
  3722. but the error message it outputs is valid MathML.</p>
  3723. </div4>
  3724. </div3>
  3725.  
  3726. <div3 id="presm_mpadded"><head>Adjust Space Around Content
  3727.   (<kw role="element">mpadded</kw>)</head>
  3728.  
  3729. <div4><head>Description</head>
  3730.  
  3731. <p>An <kw role="element">mpadded</kw> element renders the same as its
  3732. content, but with its overall size and other dimensions (such as
  3733. baseline position) modified according to its attributes. The
  3734. <kw role="element">mpadded</kw> element does not rescale (stretch or
  3735. shrink) its content; its only effect is to modify the apparent size
  3736. and position of the <quote>bounding box</quote> around its content, so as to
  3737. affect the relative position of the content with respect to the
  3738. surrounding elements. The name of the element reflects the use of
  3739. <kw role="element">mpadded</kw> to effectively add <quote>padding</quote>, or extra
  3740. space, around its content. If the <quote>padding</quote> is negative, it is
  3741. possible for the content of <kw role="element">mpadded</kw> to be
  3742. rendered outside the <kw role="element">mpadded</kw> element's bounding
  3743. box; see below for warnings about several potential pitfalls of this
  3744. effect.</p>
  3745.  
  3746. <p>The <kw role="element">mpadded</kw> element accepts any number of
  3747. arguments; if this number is not 1, its contents are treated as a single
  3748. <quote>inferred <kw role="element">mrow</kw></quote> as described in
  3749. <specref ref="presm_reqarg"/>.</p>
  3750.  
  3751. <p>It is suggested that audio renderers add (or shorten) time delays
  3752. based on the attributes representing horizontal space
  3753. (<kw role="attrib">width</kw> and <kw role="attrib">lspace</kw>).</p>
  3754. </div4>
  3755.  
  3756. <div4><head>Attributes</head>
  3757. <p>In addition to the attributes listed below, this element permits
  3758. <kw role="attrib">id</kw>,
  3759. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  3760. <kw role="attrib">style</kw> attributes,
  3761. as described in <specref ref="fund_globatt"/>.</p>
  3762. <table border="1" id="presm_table-mpadded">
  3763. <thead>
  3764. <tr>
  3765. <td>Name</td>
  3766. <td>values</td>
  3767. <td>default</td>
  3768. </tr>
  3769. </thead>
  3770. <tbody>
  3771. <tr>
  3772. <td>width</td>
  3773. <td>[ + | - ] <emph>unsigned-number</emph>
  3774. ( % [ <emph>pseudo-unit</emph> ] | <emph>pseudo-unit</emph> | <emph>h-unit</emph> | namedspace )</td>
  3775. <td>same as content</td>
  3776. </tr>
  3777. <tr>
  3778. <td>lspace</td>
  3779. <td>[ + | - ] <emph>unsigned-number</emph>
  3780. ( % [ <emph>pseudo-unit</emph> ] | <emph>pseudo-unit</emph> | <emph>h-unit</emph> )</td>
  3781. <td>0</td>
  3782. </tr>
  3783. <tr>
  3784. <td>height</td>
  3785. <td>[ + | - ] <emph>unsigned-number</emph>
  3786. ( % [ <emph>pseudo-unit</emph> ] | <emph>pseudo-unit</emph> | <emph>v-unit</emph> )</td>
  3787. <td>same as content</td>
  3788. </tr>
  3789. <tr>
  3790. <td>depth</td>
  3791. <td>[ + | - ] <emph>unsigned-number</emph>
  3792. ( % [ <emph>pseudo-unit</emph> ] | <emph>pseudo-unit</emph> | <emph>v-unit</emph> )</td>
  3793. <td>same as content</td>
  3794. </tr>
  3795. </tbody>
  3796. </table>
  3797.  
  3798. <p>(The <emph>pseudo-unit</emph> syntax symbol is described below.)</p>
  3799.  
  3800. <p>These attributes modify the dimensions of the <quote>bounding
  3801. box</quote> of the <kw role="element">mpadded</kw> element. The dimensions
  3802. (which have the same names as the attributes) are defined in the next
  3803. subsection.  Depending on the format of the attribute value, a dimension
  3804. may be set to a new value, or to an incremented or decremented version of
  3805. the content's corresponding dimension. Values may be specified as multiples
  3806. or percentages of any of the dimensions of the normal rendering of the
  3807. element's content (using so-called <quote>pseudo-units</quote>), or
  3808. they can be set directly using standard units <specref
  3809. ref="fund_units"/>.</p> 
  3810.  
  3811. <p>If an attribute value begins with a <code>+</code> or
  3812. <code>-</code> sign, it specifies an increment or decrement of the
  3813. corresponding dimension by the following length value (interpreted as
  3814. explained below). Otherwise, the corresponding dimension is set
  3815. directly to the following length value. Note that the <code>+</code>
  3816. and <code>-</code> do not mean that the following value is positive or
  3817. negative, even when an explicit length unit (<emph>h-unit</emph> or
  3818. <emph>v-unit</emph>) is given. In particular, these attributes cannot
  3819. directly set a dimension to a negative value.</p>
  3820.  
  3821. <p>Length values (after the optional sign, which is not part of the
  3822. length value) can be specified in several formats. Each format begins
  3823. with an <emph>unsigned-number</emph>, which may be followed by a
  3824. <code>%</code> sign and an optional <quote>pseudo-unit</quote> (denoted by
  3825. <emph>pseudo-unit</emph> in the attribute syntaxes above), by a
  3826. pseudo-unit alone, or by one of the length units
  3827. (denoted by <emph>h-unit</emph> or <emph>v-unit</emph>) specified in
  3828. <specref ref="fund_units"/>, not including <code>%</code>. The possible
  3829. pseudo-units are the keywords <code>width</code>, <code>lspace</code>,
  3830. <code>height</code>, and <code>depth</code>; they each represent the
  3831. length of the same-named dimension of the <kw role="element">mpadded</kw>
  3832. element's content (not of the <kw role="element">mpadded</kw> element
  3833. itself). The lengths represented by <emph>h-unit</emph> or
  3834. <emph>v-unit</emph> are described in <specref ref="fund_units"/>.</p>
  3835.  
  3836. <p>In any of these formats, the length value specified is the product
  3837. of the specified number and the length represented by the unit or
  3838. pseudo-unit. The result is multiplied by 0.01 if <code>%</code> is given.  If no
  3839. pseudo-unit is given after <code>%</code>, the one with the same name
  3840. as the attribute being specified is assumed.</p>
  3841.  
  3842. <p>Some examples of attribute formats using pseudo-units (explicit or
  3843. default) are as follows: <code>depth="100% height"</code> and
  3844. <code>depth="1.0 height"</code> both set the depth of the
  3845. <kw role="element">mpadded</kw> element to the height of its content.
  3846. <code>depth="105%"</code> sets the depth to 1.05 times the content's
  3847. depth, and either <code>depth="+100%"</code> or
  3848. <code>depth="200%"</code> sets the depth to twice the content's
  3849. depth.</p>
  3850.  
  3851. <p>Dimensions that would be positive if the content was rendered
  3852. normally cannot be made negative using <kw role="element">mpadded</kw>; a
  3853. positive dimension is set to 0 if it would otherwise become negative.
  3854. Dimensions that are initially 0 can be made negative, but this
  3855. should generally be avoided. See the warnings below on the use of
  3856. negative spacing for <quote>tweaking</quote> or conveying meaning.</p>
  3857.  
  3858. <p>The rules given above imply that all of the following attribute
  3859. settings have the same effect, which is to leave the content's
  3860. dimensions unchanged:
  3861. <eg><![CDATA[
  3862. <mpadded width="+0em"> ... </mpadded>
  3863. <mpadded width="+0%"> ... </mpadded>
  3864. <mpadded width="-0em"> ... </mpadded>
  3865. <mpadded width="- 0 height"> ... </mpadded>
  3866. <mpadded width="100%"> ... </mpadded>
  3867. <mpadded width="100% width"> ... </mpadded>
  3868. <mpadded width="1 width"> ... </mpadded>
  3869. <mpadded width="1.0 width"> ... </mpadded>
  3870. <mpadded> ... </mpadded>
  3871. ]]></eg>
  3872. </p>
  3873. </div4>
  3874.  
  3875. <div4><head>Meanings of dimension attributes</head>
  3876.  
  3877. <p>See <specref ref="glossary"/> for further information about some of the
  3878. typesetting terms used here.</p>
  3879.  
  3880. <p>The <kw role="attrib">width</kw> attribute refers to the overall horizontal
  3881. width of a bounding box. By default (i.e. when <kw role="attrib">lspace</kw> is
  3882. not modified), the bounding box of the content of an
  3883. <kw role="element">mpadded</kw> element should be rendered flush with the
  3884. left edge of the <kw role="element">mpadded</kw> element's bounding
  3885. box. Thus, increasing <kw role="attrib">width</kw> alone effectively adds space
  3886. on the right edge of the box.</p>
  3887.  
  3888. <p>The <kw role="attrib">lspace</kw> attribute refers to the amount of space
  3889. between the left edge of a bounding box and the start of the rendering of its
  3890. contents' bounding box. Unlike the other dimensions,
  3891. <kw role="attrib">lspace</kw> does not correspond to a real property of a
  3892. bounding box, but exists only transiently during the computations done
  3893. by each instance of <kw role="element">mpadded</kw>. It is provided so
  3894. that there is a way to add space on the left edge of a bounding
  3895. box.</p>
  3896.  
  3897. <p>The rationale behind using <kw role="attrib">width</kw> and
  3898. <kw role="attrib">lspace</kw> to control horizontal padding instead of more
  3899. symmetric attributes, such as a hypothetical <kw role="attrib">rspace</kw> and
  3900. <kw role="attrib">lspace</kw>, is that it is desirable to have a <quote>width</quote> pseudo
  3901. unit, in part because <quote>width</quote> is an actual property of a bounding
  3902. box.</p>
  3903.  
  3904. <p>The <kw role="attrib">height</kw> attribute refers to the amount of vertical
  3905. space between the baseline (the line along the bottom of most letter
  3906. glyphs in normal text rendering) and the top of the bounding box.</p>
  3907.  
  3908. <p>The <kw role="attrib">depth</kw> attribute refers to the amount of vertical
  3909. space between the bottom of the bounding box and the baseline.</p>
  3910.  
  3911. <p>MathML renderers should ensure that, except for the effects of the
  3912. attributes, relative spacing between the contents of
  3913. <kw role="element">mpadded</kw> and surrounding MathML elements is not
  3914. modified by replacing an <kw role="element">mpadded</kw> element with an
  3915. <kw role="element">mrow</kw> element with the same content. This holds
  3916. even if linebreaking occurs within the <kw role="element">mpadded</kw>
  3917. element. However, if an <kw role="element">mpadded</kw> element with
  3918. non-default attribute values is subjected to linebreaking, MathML does
  3919. not define how its attributes or rendering interact with the
  3920. linebreaking algorithm.</p>
  3921. </div4>
  3922.  
  3923. <div4><head>Warning: nonportability of <quote>tweaking</quote></head>
  3924.  
  3925. <p>A likely temptation for the use of the <kw role="element">mpadded</kw>
  3926. and <kw role="element">mspace</kw> elements (and perhaps also <kw
  3927. role="element">mphantom</kw> and <kw role="element">mtext</kw>) will be
  3928. for an author to improve the spacing generated by a specific renderer by
  3929. slightly modifying it in specific expressions, i.e. to
  3930. <quote>tweak</quote> the rendering.</p>
  3931.  
  3932. <p>Authors are strongly warned that <emph>different MathML renderers
  3933. may use different spacing rules</emph> for computing the relative
  3934. positions of rendered symbols in expressions that have no explicit
  3935. modifications to their spacing; if renderer B improves upon renderer
  3936. A's spacing rules, explicit spacing added to improve the output
  3937. quality of renderer A may produce very poor results in renderer B,
  3938. very likely worse than without any <quote>tweaking</quote> at all.</p>
  3939.  
  3940. <p>Even when a specific choice of renderer can be assumed, its spacing
  3941. rules may be improved in successive versions, so that the effect of
  3942. tweaking in a given MathML document may grow worse with time. Also,
  3943. when style sheet mechanisms are extended to MathML, even one version
  3944. of a renderer may use different spacing rules for users with different
  3945. style sheets.</p>
  3946.  
  3947. <p>Therefore, it is suggested that MathML markup never use
  3948. <kw role="element">mpadded</kw> or <kw role="element">mspace</kw> elements
  3949. to tweak the rendering of specific expressions, unless the MathML is
  3950. generated solely to be viewed using one specific version of one MathML
  3951. renderer, using one specific style sheet (if style sheets are
  3952. available in that renderer).</p>
  3953.  
  3954. <p>In cases where the temptation to improve spacing proves too strong,
  3955. careful use of <kw role="element">mpadded</kw>,
  3956. <kw role="element">mphantom</kw>, or the alignment elements (<specref
  3957. ref="presm_malign"/>) may give more portable results than the
  3958. direct insertion of extra space using <kw role="element">mspace</kw> or
  3959. <kw role="element">mtext</kw>. Advice given to the implementors of MathML
  3960. renderers might be still more productive, in the long run.</p>
  3961. </div4>
  3962.  
  3963. <div4><head>Warning: spacing should not be used to convey meaning</head>
  3964.  
  3965. <p>MathML elements that permit <quote>negative spacing</quote>, namely
  3966. <kw role="element">mspace</kw>, <kw role="element">mpadded</kw>, and
  3967. <kw role="element">mtext</kw>, could in theory be used to simulate new
  3968. notations or <quote>overstruck</quote> characters by the visual overlap of the
  3969. renderings of more than one MathML sub-expression.</p>
  3970.  
  3971. <p>This practice is <emph>strongly discouraged in all situations</emph>,
  3972. for the following reasons:
  3973. <ulist>
  3974. <item><p>it will give different results in different MathML renderers
  3975. (so the warning about <quote>tweaking</quote> applies);</p>
  3976. </item>
  3977.  
  3978. <item><p>it is likely to appear much worse than a more standard construct
  3979. supported by good renderers;</p>
  3980. </item>
  3981.  
  3982. <item><p>such expressions are almost certain to be uninterpretable
  3983. by audio renderers, computer algebra systems,
  3984. text searches for standard symbols,
  3985. or other processors of MathML input.</p>
  3986. </item>
  3987. </ulist>
  3988. </p>
  3989.  
  3990. <p>More generally, any construct that uses spacing to convey
  3991. mathematical meaning, rather than simply as an aid to viewing
  3992. expression structure, is discouraged. That is, the constructs that
  3993. are discouraged are those that would be interpreted differently by a
  3994. human viewer of rendered MathML if all explicit spacing was
  3995. removed.</p>
  3996.  
  3997. <p>If such constructs are used in spite of this warning, they should
  3998. be enclosed in a <kw role="element">semantics</kw> element that also
  3999. provides an additional MathML expression that can be interpreted in a
  4000. standard way.</p>
  4001.  
  4002. <p>For example, the MathML expression
  4003. <eg role='mathml'><![CDATA[
  4004. <mrow>
  4005.   <mpadded width="0"> <mi> C </mi> </mpadded>
  4006.   <mspace width="0.3em"/>
  4007.   <mtext> | </mtext>
  4008. </mrow>
  4009. ]]></eg>
  4010. </p>
  4011.  
  4012. <p>forms an overstruck symbol in violation of the policy stated above;
  4013. it might be intended to represent the set of complex numbers for a
  4014. MathML renderer that lacks support for the standard symbol used for
  4015. this purpose. This kind of construct should always be avoided in
  4016. MathML, for the reasons stated above; indeed, it should never be
  4017. necessary for standard symbols, since a MathML renderer with no better
  4018. method of rendering them is free to use overstriking internally, so
  4019. that it can still support general MathML input.</p>
  4020.  
  4021. <p>However, if for whatever reason such a construct is used in MathML,
  4022. it should always be enclosed in a <kw role="element">semantics</kw> element such as
  4023. <eg role='mathml'><![CDATA[
  4024. <semantics>
  4025.   <mrow>
  4026.     <mpadded width="0"> <mi> C </mi> </mpadded>
  4027.     <mspace width="0.3em"/>
  4028.     <mtext> | </mtext>
  4029.   </mrow>
  4030.   <annotation-xml encoding="MathML-Presentation">
  4031.     <mi> ℂ </mi>
  4032.   </annotation-xml>
  4033. </semantics>
  4034. ]]></eg>
  4035. </p>
  4036.  
  4037. <p>which provides an alternative, standard encoding for the desired
  4038. symbol, which is much more easily interpreted than the construct using
  4039. negative spacing. (The alternative encoding in this example uses
  4040. MathML presentation elements; the content elements described in
  4041. <specref ref="contm"/> should also be considered.)</p>
  4042.  
  4043. <p>(The above warning also applies to most uses of rendering
  4044. attributes to alter the meaning conveyed by an expression, with the
  4045. exception of attributes on <kw role="element">mi</kw> (such as
  4046. <kw role="attrib">fontweight</kw>) used to distinguish one variable from
  4047. another.)</p>
  4048. </div4>
  4049. </div3>
  4050.  
  4051. <div3 id="presm_mphantom"><head>Making Sub-Expressions Invisible (<kw role="element">mphantom</kw>)</head>
  4052.  
  4053. <div4><head>Description</head>
  4054.  
  4055. <p>The <kw role="element">mphantom</kw> element renders invisibly, but
  4056. with the same size and other dimensions, including baseline position,
  4057. that its contents would have if they were rendered
  4058. normally. <kw role="element">mphantom</kw> can be used to align parts of
  4059. an expression by invisibly duplicating sub-expressions.</p>
  4060.  
  4061. <p>The <kw role="element">mphantom</kw> element accepts any number of
  4062. arguments; if this number is not 1, its contents are treated as a single
  4063. <quote>inferred <kw role="element">mrow</kw></quote> formed from all its
  4064. arguments, as described in <specref ref="presm_reqarg"/>.</p>
  4065.  
  4066. </div4>
  4067.  
  4068. <div4><head>Attributes</head>
  4069.  
  4070. <p>This element only permits <kw role="attrib">id</kw>,
  4071. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4072. <kw role="attrib">style</kw> attributes,
  4073. as described in <specref ref="fund_globatt"/>.</p>
  4074.  
  4075. <p>Note that it is possible to wrap both an
  4076. <kw role="element">mphantom</kw> and an <kw role="element">mpadded</kw>
  4077. element around one MathML expression, as in
  4078. <code><mphantom><mpadded attribute-settings>
  4079. ... </mpadded></mphantom></code>, to change its size and make it
  4080. invisible at the same time.</p>
  4081.  
  4082. <p>MathML renderers should ensure that the relative spacing between
  4083. the contents of an <kw role="element">mphantom</kw> element and the
  4084. surrounding MathML elements is the same as it would be if the
  4085. <kw role="element">mphantom</kw> element were replaced by an
  4086. <kw role="element">mrow</kw> element with the same content. This holds
  4087. even if linebreaking occurs within the <kw role="element">mphantom</kw>
  4088. element.</p>
  4089.  
  4090. <p>For the above reason, <kw role="element">mphantom</kw> is
  4091. <emph>not</emph> considered space-like (<specref ref="presm_mspace"/>) unless its
  4092. content is space-like, since the suggested rendering rules for
  4093. operators are affected by whether nearby elements are space-like.  Even
  4094. so, the warning about the legal grouping of space-like elements may
  4095. apply to uses of <kw role="element">mphantom</kw>.</p>
  4096.  
  4097. <p>There is one situation where the preceding rule for rendering an
  4098. <kw role="element">mphantom</kw> may not give the desired effect. When an
  4099. <kw role="element">mphantom</kw> is wrapped around a subsequence of the
  4100. arguments of an <kw role="element">mrow</kw>, the default determination
  4101. of the <kw role="attrib">form</kw> attribute for an <kw role="element">mo</kw>
  4102. element within the subsequence can change. (See the default value of
  4103. the <kw role="attrib">form</kw> attribute described in <specref ref="presm_mo"/>.) It may be
  4104. necessary to add an explicit <kw role="attrib">form</kw> attribute to such an
  4105. <kw role="element">mo</kw> in these cases. This is illustrated in the
  4106. following example.</p>
  4107. </div4>
  4108.  
  4109. <div4><head>Examples</head>
  4110.  
  4111. <p>In this example, <kw role="element">mphantom</kw> is used to ensure
  4112. alignment of corresponding parts of the numerator and denominator of a
  4113. fraction:
  4114. <eg role='mathml'><![CDATA[
  4115. <mfrac>
  4116.   <mrow>
  4117.     <mi> x </mi>
  4118.     <mo> + </mo>
  4119.     <mi> y </mi>
  4120.     <mo> + </mo>
  4121.     <mi> z </mi>
  4122.   </mrow>
  4123.   <mrow>
  4124.     <mi> x </mi>
  4125.     <mphantom>
  4126.       <mo form="infix"> + </mo>
  4127.       <mi> y </mi>
  4128.     </mphantom>
  4129.     <mo> + </mo>
  4130.     <mi> z </mi>
  4131.   </mrow>
  4132. </mfrac>
  4133. ]]></eg>
  4134. </p>
  4135.  
  4136. <p>This would render as something like
  4137. <graphic source="image/f3009.gif" alt="\frac{x+y+z}{x\phantom{+y}\;+z}"/>
  4138. rather than as
  4139. <graphic source="image/f3010.gif" alt="\frac{x+y+z}{x+z}"/>
  4140. </p>
  4141.  
  4142. <p>The explicit attribute setting <kw role="attrib">form</kw>="infix" on the
  4143. <kw role="element">mo</kw> element inside the <kw role="element">mphantom</kw> sets the
  4144. <kw role="attrib">form</kw> attribute to what it would have been in the absence of the
  4145. surrounding <kw role="element">mphantom</kw>. This is necessary since
  4146. otherwise, the <code>+</code> sign would be interpreted as a prefix
  4147. operator, which might have slightly different spacing.</p>
  4148.  
  4149. <p>Alternatively, this problem could be avoided without any explicit
  4150. attribute settings, by wrapping each of the arguments
  4151. <code><mo>+</mo></code> and <code><mi>y</mi></code> in its
  4152. own <kw role="element">mphantom</kw> element, i.e.
  4153. <eg role='mathml'><![CDATA[
  4154. <mfrac>
  4155.    <mrow>
  4156.       <mi> x </mi>
  4157.       <mo> + </mo>
  4158.       <mi> y </mi>
  4159.       <mo> + </mo>
  4160.       <mi> z </mi>
  4161.    </mrow>
  4162.    <mrow>
  4163.       <mi> x </mi>
  4164.       <mphantom>
  4165.          <mo> + </mo>
  4166.       </mphantom>
  4167.       <mphantom>
  4168.          <mi> y </mi>
  4169.       </mphantom>
  4170.       <mo> + </mo>
  4171.       <mi> z </mi>
  4172.    </mrow>
  4173. </mfrac>
  4174. ]]></eg>
  4175. </p>
  4176. </div4>
  4177. </div3>
  4178.  
  4179. <div3 id="presm_mfenced"><head>Expression Inside Pair of Fences
  4180.   (<kw role="element">mfenced</kw>)</head>
  4181.  
  4182. <div4><head>Description</head>
  4183.  
  4184. <p>The <kw role="element">mfenced</kw> element provides a convenient form
  4185. in which to express common constructs involving fences (i.e. braces,
  4186. brackets, and parentheses), possibly including separators (such as
  4187. comma) between the arguments.</p>
  4188.  
  4189. <p>For example, <code><![CDATA[<mfenced> <mi>x</mi> </mfenced>]]></code>
  4190. renders as <quote>(<mi>x</mi>)</quote> and is equivalent to
  4191. <eg role='mathml'><![CDATA[
  4192. <mrow> <mo> ( </mo> <mi>x</mi> <mo> ) </mo> </mrow>
  4193. ]]></eg>
  4194. and
  4195. <code><![CDATA[<mfenced> <mi>x</mi> <mi>y</mi> </mfenced>]]></code>
  4196. renders as <quote>(<mi>x</mi>, <mi>y</mi>)</quote>
  4197. and is equivalent to
  4198. <eg role='mathml'><![CDATA[
  4199. <mrow>
  4200.   <mo> ( </mo>
  4201.   <mrow> <mi>x</mi> <mo>,</mo> <mi>y</mi> </mrow>
  4202.   <mo> ) </mo>
  4203. </mrow>
  4204. ]]></eg>
  4205. </p>
  4206.  
  4207. <p>Individual fences or separators are represented using
  4208. <kw role="element">mo</kw> elements, as described in <specref
  4209. ref="presm_mo"/>. Thus, any <kw role="element">mfenced</kw>
  4210. element is completely equivalent to an expanded form described below;
  4211. either form can be used in MathML, at the convenience of an author or
  4212. of a MathML-generating program. A MathML renderer is required to
  4213. render either of these forms in exactly the same way.</p>
  4214.  
  4215. <p>In general, an <kw role="element">mfenced</kw> element can contain
  4216. zero or more arguments, and will enclose them between fences in an
  4217. <kw role="element">mrow</kw>; if there is more than one argument, it will
  4218. insert separators between adjacent arguments, using an additional
  4219. nested <kw role="element">mrow</kw> around the arguments and separators
  4220. for proper grouping (<specref ref="presm_mrow"/>). The general expanded form is
  4221. shown below. The fences and separators will be parentheses and comma
  4222. by default, but can be changed using attributes, as shown in the
  4223. following table.</p>
  4224. </div4>
  4225.  
  4226. <div4><head>Attributes</head>
  4227. <p>In addition to the attributes listed below, this element permits
  4228. <kw role="attrib">id</kw>,
  4229. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4230. <kw role="attrib">style</kw> attributes,
  4231. as described in <specref ref="fund_globatt"/>.</p>
  4232. <table border="1">
  4233. <thead>
  4234. <tr>
  4235. <td>Name</td>
  4236. <td>values</td>
  4237. <td>default</td>
  4238. </tr>
  4239. </thead>
  4240. <tbody>
  4241. <tr>
  4242. <td>open</td>
  4243. <td>string</td>
  4244. <td>(</td>
  4245. </tr>
  4246. <tr>
  4247. <td>close</td>
  4248. <td>string</td>
  4249. <td>)</td>
  4250. </tr>
  4251. <tr>
  4252. <td>separators</td>
  4253. <td>character *</td>
  4254. <td>,</td>
  4255. </tr>
  4256. </tbody>
  4257. </table>
  4258.  
  4259. <p>A generic <kw role="element">mfenced</kw> element, with all attributes
  4260. explicit, looks as follows:
  4261. <eg><![CDATA[
  4262. <mfenced open="opening-fence"
  4263.          close="closing-fence"
  4264.          separators="sep#1 sep#2 ... sep#(n-1)" >
  4265.    arg#1
  4266.    ...
  4267.    arg#n
  4268. </mfenced>
  4269. ]]></eg>
  4270. </p>
  4271.  
  4272. <p>The <kw role="attrib">opening-fence</kw> and <kw role="attrib">closing-fence</kw> are
  4273. arbitrary strings. (Since they are used as the content of
  4274. <kw role="element">mo</kw> elements, any whitespace they contain will be
  4275. trimmed and collapsed as described in <specref ref="fund_collapse"/>.) </p>
  4276.  
  4277. <p>The value of <kw role="attrib">separators</kw> is a sequence of zero or more
  4278. separator characters (or entity references), optionally separated by
  4279. whitespace. Each <code>sep#i</code> consists of exactly
  4280. one character or entity reference. Thus, <code>separators=",;"</code>
  4281. is equivalent to <code>separators=" , ; "</code>.</p>
  4282.  
  4283. <p>The general <kw role="element">mfenced</kw> element shown above is
  4284. equivalent to the following expanded form:
  4285. <eg><![CDATA[
  4286. <mrow>
  4287.    <mo fence="true"> opening-fence </mo>
  4288.    <mrow>
  4289.       arg#1
  4290.       <mo separator="true"> sep#1 </mo>
  4291.       ...
  4292.       <mo separator="true"> sep#(n-1) </mo>
  4293.       arg#n
  4294.    </mrow>
  4295.    <mo fence="true"> closing-fence </mo>
  4296. </mrow>
  4297. ]]></eg>
  4298. </p>
  4299.  
  4300. <p>Each argument except the last is followed by a separator. The inner
  4301. <kw role="element">mrow</kw> is added for proper grouping, as described in
  4302. <specref ref="presm_mrow"/>.</p>
  4303.  
  4304. <p>When there is only one argument, the above form has no separators;
  4305. since <code><mrow> arg#1 </mrow></code> is equivalent to
  4306. <code>arg#1</code> (as described in <specref
  4307. ref="presm_mrow"/>), this case is also equivalent to:
  4308. <eg><![CDATA[
  4309. <mrow>
  4310.    <mo fence="true"> opening-fence </mo>
  4311.    arg#1
  4312.    <mo fence="true"> closing-fence </mo>
  4313. </mrow>
  4314. ]]></eg>
  4315. </p>
  4316.  
  4317. <p>If there are too many separator characters, the extra ones are
  4318. ignored. If separator characters are given, but there are too few, the
  4319. last one is repeated as necessary. Thus, the default value of
  4320. <kw role="attrib">separators</kw>="," is equivalent to
  4321. <kw role="attrib">separators</kw>=",,", <kw role="attrib">separators</kw>=",,,", etc. If
  4322. there are no separator characters provided but some are needed, for
  4323. example if <kw role="attrib">separators</kw>=" " or "" and there is more than
  4324. one argument, then no separator elements are inserted at all – that
  4325. is, the elements <code><mo separator="true"> sep#i
  4326. </mo></code> are left out entirely. Note that this is different
  4327. from inserting separators consisting of <kw role="element">mo</kw>
  4328. elements with empty content.</p>
  4329.  
  4330. <p>Finally, for the case with no arguments, i.e.
  4331. <eg><![CDATA[
  4332. <mfenced open="opening-fence"
  4333.          close="closing-fence"
  4334.          separators="anything" >
  4335. </mfenced>
  4336. ]]></eg>
  4337. the equivalent expanded form is defined to include just
  4338. the fences within an <kw role="element">mrow</kw>:
  4339. <eg><![CDATA[
  4340. <mrow>
  4341.    <mo fence="true"> opening-fence </mo>
  4342.    <mo fence="true"> closing-fence </mo>
  4343. </mrow>
  4344. ]]></eg>
  4345. </p>
  4346.  
  4347. <p>Note that not all <quote>fenced expressions</quote> can be encoded by an
  4348. <kw role="element">mfenced</kw> element. Such exceptional expressions
  4349. include those with an <quote>embellished</quote> separator or fence or one
  4350. enclosed in an <kw role="element">mstyle</kw> element, a missing or extra
  4351. separator or fence, or a separator with multiple content
  4352. characters. In these cases, it is necessary to encode the expression
  4353. using an appropriately modified version of an expanded form. As
  4354. discussed above, it is always permissible to use the expanded form
  4355. directly, even when it is not necessary. In particular, authors cannot
  4356. be guaranteed that MathML preprocessors won't replace occurrences of
  4357. <kw role="element">mfenced</kw> with equivalent expanded forms.</p>
  4358.  
  4359. <p>Note that the equivalent expanded forms shown above include
  4360. attributes on the <kw role="element">mo</kw> elements that identify them
  4361. as fences or separators. Since the most common choices of fences and
  4362. separators already occur in the operator dictionary with those
  4363. attributes, authors would not normally need to specify those
  4364. attributes explicitly when using the expanded form directly. Also, the
  4365. rules for the default <kw role="attrib">form</kw> attribute (<specref ref="presm_mo"/>)
  4366. cause the opening and closing fences to be effectively given the
  4367. values <kw role="attrib">form</kw>="prefix" and <kw role="attrib">form</kw>="postfix"
  4368. respectively, and the separators to be given the value
  4369. <kw role="attrib">form</kw>="infix".</p>
  4370.  
  4371. <p>Note that it would be incorrect to use <kw role="element">mfenced</kw>
  4372. with a separator of, for instance, <quote>+</quote>, as an abbreviation for an
  4373. expression using <quote>+</quote> as an ordinary operator, e.g.
  4374. <eg role='mathml'><![CDATA[
  4375. <mrow>
  4376.   <mi>x</mi> <mo>+</mo> <mi>y</mi> <mo>+</mo> <mi>z</mi>
  4377. </mrow>
  4378. ]]></eg>
  4379. This is because the <code>+</code> signs would be treated as separators,
  4380. not infix operators. That is, it would render as if they were marked up as
  4381. <code><![CDATA[<mo separator="true">+</mo>]]></code>, which might therefore
  4382. render inappropriately.</p>
  4383. </div4>
  4384.  
  4385. <div4><head>Examples</head>
  4386.  
  4387. <p>(<mi>a</mi>+<mi>b</mi>)
  4388. <eg role='mathml'><![CDATA[
  4389. <mfenced>
  4390.   <mrow>
  4391.     <mi> a </mi>
  4392.     <mo> + </mo>
  4393.     <mi> b </mi>
  4394.   </mrow>
  4395. </mfenced>
  4396. ]]></eg>
  4397. </p>
  4398.  
  4399. <p>Note that the above <kw role="element">mrow</kw> is necessary so that
  4400. the <kw role="element">mfenced</kw> has just one argument. Without it, this
  4401. would render incorrectly as <quote>(<mi>a</mi>, +,
  4402. <mi>b</mi>)</quote>.</p>
  4403.  
  4404. <p>[0,1)
  4405. <eg role='mathml'><![CDATA[
  4406. <mfenced open="[">
  4407.   <mn> 0 </mn>
  4408.   <mn> 1 </mn>
  4409. </mfenced>
  4410. ]]></eg>
  4411. </p>
  4412.  
  4413. <p><mi>f</mi>(<mi>x</mi>,<mi>y</mi>)
  4414. <eg role='mathml'><![CDATA[
  4415. <mrow>
  4416.   <mi> f </mi>
  4417.   <mo> ⁡ </mo>
  4418.   <mfenced>
  4419.     <mi> x </mi>
  4420.     <mi> y </mi>
  4421.   </mfenced>
  4422. </mrow>
  4423. ]]></eg>
  4424. </p>
  4425. </div4>
  4426. </div3>
  4427.  
  4428. <div3 id="presm_menclose"><head>Enclose Expression Inside Notation
  4429.   (<kw role="element">menclose</kw>)</head>
  4430.  
  4431. <div4><head>Description</head>
  4432.  
  4433. <p>The <kw role="element">menclose</kw> element renders its content
  4434. inside the enclosing notation specified by its <kw
  4435. role="attrib">notation</kw> attribute. 
  4436. <kw role="element">menclose</kw> accepts any number of arguments; if
  4437. this number is not 1, its contents are treated as a single <quote>inferred
  4438. <kw role="element">mrow</kw></quote> containing its arguments,
  4439.  as described in <specref ref="presm_reqarg"/>. </p>
  4440. </div4>
  4441.  
  4442. <div4><head>Attributes</head>
  4443. <p>In addition to the attributes listed below, this element permits
  4444. <kw role="attrib">id</kw>,
  4445. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4446. <kw role="attrib">style</kw> attributes,
  4447. as described in <specref ref="fund_globatt"/>.</p>
  4448.  
  4449. <table border="1">
  4450. <thead>
  4451. <tr>
  4452. <td>Name</td>
  4453. <td>values</td>
  4454. <td>default</td>
  4455. </tr>
  4456. </thead>
  4457. <tbody>
  4458. <tr>
  4459. <td>notation</td>
  4460. <td>longdiv | actuarial | radical </td>
  4461. <td>longdiv</td>
  4462. </tr>
  4463. </tbody>
  4464. </table>
  4465.  
  4466. <p>When <kw role="attrib">notation</kw> has the value <kw
  4467. role="attval">longdiv</kw>, the contents are drawn enclosed by a long
  4468. division symbol.  A complete example of long division is accomplished
  4469. by also using <kw role="element">mtable</kw> and <kw
  4470. role="element">malign</kw>.  When <kw role="attrib">notation</kw> is
  4471. specified as <kw role="attval">actuarial</kw>, the contents are drawn
  4472. enclosed by an actuarial symbol. The case of <kw
  4473. role="attrib">notation</kw>=<kw role="attval">radical</kw> is
  4474. equivalent to the <kw role="element">msqrt</kw> schema.</p>
  4475. </div4>
  4476.  
  4477. <div4><head>Examples</head>
  4478.  
  4479. <p>The following markup might be used to encode an elementary US-style
  4480. long division problem.</p>
  4481.  
  4482. <p><eg role='mathml'><![CDATA[
  4483. <mtable columnspacing='0' rowspacing='0'>
  4484. <mtr>
  4485.   <mtd></mtd>
  4486.   <mtd columnalign='right'><mn>10</mn></mtd>
  4487. </mtr>
  4488. <mtr>
  4489.   <mtd columnalign='right'><mn>131</mn></mtd>
  4490.   <mtd columnalign='right'>
  4491.     <menclose notation='longdiv'><mn>1413</mn></menclose>
  4492.   </mtd>
  4493. </mtr>
  4494. <mtr>
  4495.   <mtd></mtd>
  4496.   <mtd columnalign='right'>
  4497.     <mrow>
  4498.     <munder>
  4499.       <mn>131</mn>
  4500.       <mo> _ </mo>
  4501.     </munder>
  4502.     <mphantom><mn>3</mn></mphantom>
  4503.     </mrow>
  4504.   </mtd>
  4505. </mtr>
  4506. <mtr>
  4507.   <mtd></mtd>
  4508.   <mtd columnalign='right'><mn>103</mn></mtd>
  4509. </mtr>
  4510. </mtable>
  4511. ]]></eg></p>
  4512.  
  4513. <p>This might be rendered roughly as: 
  4514. <graphic role="display" source="image/f3011.gif"
  4515.   alt="\begin{array}{rl}
  4516.            & \phantom{)14}10                       \\
  4517.        131 & \overline{)1413\,}                    \\
  4518.            & \phantom{)}\underline{131\phantom{g}} \\
  4519.            & \phantom{)1}103
  4520.        \end{array}"/> 
  4521. </p>
  4522.  
  4523. <p>An example of using <kw role="element">menclose</kw> for actuarial
  4524. notation is
  4525. <eg role='mathml'><![CDATA[
  4526. <msub>
  4527.   <mi>a</mi>
  4528.   <mrow>
  4529.     <menclose notation='actuarial'>
  4530.       <mi>n</mi>
  4531.     </menclose>
  4532.     <mo>⁢</mo>
  4533.     <mi>i</mi>
  4534.   </mrow>
  4535. </msub>
  4536. ]]></eg>
  4537. which renders roughly as
  4538. <graphic role="display" source="image/f3012.gif"
  4539.   alt="\begin{array}{l@{}l}
  4540.          \phantom{x}a                        & \\
  4541.          \overline{\phantom{x}n\phantom{|}}| & i 
  4542.        \end{array}"/> 
  4543. </p>
  4544.  
  4545. </div4>
  4546. </div3>
  4547. </div2>
  4548.  
  4549. <div2 id="presm_scrlim"><head>Script and Limit Schemata</head>
  4550.  
  4551. <p>The elements described in this section position one or more scripts
  4552. around a base. Attaching various kinds of scripts and embellishments to
  4553. symbols is a very common notational device in mathematics. For purely
  4554. visual layout, a single general-purpose element could suffice for
  4555. positioning scripts and embellishments in any of the traditional script
  4556. locations around a given base. However, in order to capture the abstract
  4557. structure of common notation better, MathML provides several more
  4558. specialized scripting elements.</p>
  4559.  
  4560. <p>In addition to sub/superscript elements, MathML has overscript
  4561. and underscript elements that place scripts above and below the base. These
  4562. elements can be used to place limits on large operators, or for placing
  4563. accents and lines above or below the base. The rules for rendering accents
  4564. differ from those for overscripts and underscripts, and this difference can
  4565. be controlled with the <kw role="attrib">accent</kw> and <kw
  4566. role="attrib">accentunder</kw> attributes, as described in the appropriate
  4567. sections below.</p>
  4568.  
  4569. <p>Rendering of scripts is affected by the <kw
  4570. role="attrib">scriptlevel</kw> and <kw role="attrib">displaystyle</kw>
  4571. attributes, which are part of the environment inherited by the rendering
  4572. process of every MathML expression, and are described under <kw
  4573. role="element">mstyle</kw> (<specref ref="presm_mstyle"/>). These
  4574. attributes cannot be given explicitly on a scripting element, but can be
  4575. specified on the start tag of a surrounding <kw role="element">mstyle</kw>
  4576. element if desired.</p>
  4577.  
  4578. <p>MathML also provides an element for attachment of tensor indices.
  4579. Tensor indices are distinct from ordinary subscripts and superscripts in
  4580. that they must align in vertical columns. Tensor indices can also occur in
  4581. prescript positions.</p>
  4582.  
  4583. <p>Because presentation elements should be used to describe the abstract
  4584. notational structure of expressions, it is important that the base
  4585. expression in all <quote>scripting</quote> elements (i.e. the first
  4586. argument expression) should be the entire expression that is being
  4587. scripted, not just the rightmost character. For example,
  4588. (<mi>x</mi>+<mi>y</mi>)<sup>2</sup> should be written as:
  4589. <eg role='mathml'><![CDATA[
  4590. <msup>
  4591.   <mrow>
  4592.     <mo> ( </mo>
  4593.     <mrow>
  4594.       <mi> x </mi>
  4595.       <mo> + </mo>
  4596.       <mi> y </mi>
  4597.     </mrow>
  4598.     <mo> ) </mo>
  4599.   </mrow>
  4600.   <mn> 2 </mn>
  4601. </msup>
  4602. ]]></eg>
  4603. </p>
  4604.  
  4605. <div3 id="presm_msub"><head>Subscript (<kw role="element">msub</kw>)</head>
  4606.  
  4607. <div4><head>Description</head>
  4608.  
  4609. <p>The syntax for the <kw role="element">msub</kw> element is:
  4610. <eg>
  4611. <msub> <emph>base</emph> <emph>subscript</emph> </msub>
  4612. </eg></p>
  4613. </div4>
  4614.  
  4615. <div4><head>Attributes</head>
  4616. <p>In addition to the attributes listed below, this element permits
  4617. <kw role="attrib">id</kw>,
  4618. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4619. <kw role="attrib">style</kw> attributes,
  4620. as described in <specref ref="fund_globatt"/>.</p>
  4621. <table border="1">
  4622. <thead>
  4623. <tr>
  4624. <td>Name</td>
  4625. <td>values</td>
  4626. <td>default</td>
  4627. </tr>
  4628. </thead>
  4629. <tbody>
  4630. <tr>
  4631. <td>subscriptshift</td>
  4632. <td>number v-unit</td>
  4633. <td>automatic (typical unit is ex)</td>
  4634. </tr>
  4635. </tbody>
  4636. </table>
  4637.  
  4638. <p>The <kw role="attrib">subscriptshift</kw> attribute specifies the minimum
  4639. amount to shift the baseline of <emph>subscript</emph> down.</p>
  4640.  
  4641. <p><emph>v-unit</emph> represents a unit of vertical length (see
  4642. <specref ref="fund_units"/>).</p>
  4643.  
  4644. <p>The <kw role="element">msub</kw> element increments
  4645. <kw role="attrib">scriptlevel</kw> by 1, and sets <kw role="attrib">displaystyle</kw> to
  4646. <kw role="attval">false</kw>, within <emph>subscript</emph>, but leaves both attributes
  4647. unchanged within <emph>base</emph>. (These attributes are inherited by
  4648. every element through its rendering environment, but can be set
  4649. explicitly only on <kw role="element">mstyle</kw>; see <specref
  4650. ref="presm_mstyle"/>.)</p>
  4651. </div4>
  4652. </div3>
  4653.  
  4654. <div3 id="presm_msup"><head>Superscript (<kw role="element">msup</kw>)</head>
  4655.  
  4656. <div4><head>Description</head>
  4657.  
  4658. <p>The syntax for the <kw role="element">msup</kw> element is:
  4659. <eg>
  4660. <msup> <emph>base</emph> <emph>superscript</emph> </msup>
  4661. </eg></p>
  4662.  
  4663. </div4>
  4664.  
  4665. <div4><head>Attributes</head>
  4666. <p>In addition to the attributes listed below, this element permits
  4667. <kw role="attrib">id</kw>,
  4668. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4669. <kw role="attrib">style</kw> attributes,
  4670. as described in <specref ref="fund_globatt"/>.</p>
  4671. <table border="1">
  4672. <thead>
  4673. <tr>
  4674. <td>Name</td>
  4675. <td>values</td>
  4676. <td>default</td>
  4677. </tr>
  4678. </thead>
  4679. <tbody>
  4680. <tr>
  4681. <td>superscriptshift</td>
  4682. <td>number v-unit</td>
  4683. <td>automatic (typical unit is ex)</td>
  4684. </tr>
  4685. </tbody>
  4686. </table>
  4687.  
  4688. <p>The <kw role="attrib">superscriptshift</kw> attribute specifies the
  4689. minimum amount to shift the baseline of <emph>superscript</emph> up.</p>
  4690.  
  4691. <p><emph>v-unit</emph> represents a unit of vertical length (see <specref
  4692. ref="fund_units"/>).</p>
  4693.  
  4694. <p>The <kw role="element">msup</kw> element increments <kw
  4695. role="attrib">scriptlevel</kw> by 1, and sets <kw
  4696. role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, within
  4697. <emph>superscript</emph>, but leaves both attributes unchanged within
  4698. <emph>base</emph>. (These attributes are inherited by every element through
  4699. its rendering environment, but can be set explicitly only on <kw
  4700. role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>.) </p>
  4701. </div4>
  4702. </div3>
  4703.  
  4704. <div3 id="presm_msubsup"><head>Subscript-superscript Pair (<kw role="element">msubsup</kw>)</head>
  4705.  
  4706. <div4><head>Description</head>
  4707. <p>The <kw role="element">msubsup</kw> element is used to attach both a subscript and
  4708. superscript to a base expression.  Note that both scripts are
  4709. positioned tight against the base: 
  4710. <graphic role="inline" source="image/f3013.gif" alt="x_1{}^2"/>
  4711. versus
  4712. <graphic role="inline" source="image/f3014.gif" alt="x_1^2"/>.</p>
  4713.  
  4714. <p>The syntax for the <kw role="element">msubsup</kw> element is:
  4715.  
  4716. <eg>
  4717. <msubsup> <emph>base</emph> <emph>subscript</emph> <emph>superscript</emph> </msubsup>
  4718. </eg>
  4719. </p>
  4720. </div4>
  4721.  
  4722. <div4><head>Attributes</head>
  4723. <p>In addition to the attributes listed below, this element permits
  4724. <kw role="attrib">id</kw>,
  4725. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4726. <kw role="attrib">style</kw> attributes,
  4727. as described in <specref ref="fund_globatt"/>.</p>
  4728. <table border="1">
  4729. <thead>
  4730. <tr>
  4731. <td>Name</td>
  4732. <td>values</td>
  4733. <td>default</td>
  4734. </tr>
  4735. </thead>
  4736. <tbody>
  4737. <tr>
  4738. <td>subscriptshift</td>
  4739. <td>number v-unit</td>
  4740. <td>automatic (typical unit is ex)</td>
  4741. </tr>
  4742. <tr>
  4743. <td>superscriptshift</td>
  4744. <td>number v-unit</td>
  4745. <td>automatic (typical unit is ex)</td>
  4746. </tr>
  4747. </tbody>
  4748. </table>
  4749.  
  4750. <p>The <kw role="attrib">subscriptshift</kw> attribute specifies the minimum
  4751. amount to shift the baseline of <emph>subscript</emph> down. The
  4752. <kw role="attrib">superscriptshift</kw> attribute specifies the minimum amount
  4753. to shift the baseline of <emph>superscript</emph> up.</p>
  4754.  
  4755. <p><emph>v-unit</emph> represents a unit of vertical length (see <specref
  4756. ref="fund_units"/>).</p>
  4757.  
  4758. <p>The <kw role="element">msubsup</kw> element increments
  4759. <kw role="attrib">scriptlevel</kw> by 1, and sets <kw role="attrib">displaystyle</kw> to
  4760. <kw role="attval">false</kw>, within <emph>subscript</emph> and <emph>superscript</emph>,
  4761. but leaves both attributes unchanged within <emph>base</emph>. (These
  4762. attributes are inherited by every element through its rendering
  4763. environment, but can be set explicitly only on
  4764. <kw role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>.) 
  4765. </p>
  4766. </div4>
  4767.  
  4768. <div4><head>Examples</head>
  4769.  
  4770. <p>The <kw role="element">msubsup</kw> is most commonly used for adding
  4771. sub/superscript pairs to identifiers as illustrated above. However,
  4772. another important use is placing limits on certain large operators
  4773. whose limits are traditionally displayed in the script positions even
  4774. when rendered in display style. The most common of these is the
  4775. integral. For example,</p>
  4776.  
  4777. <p><graphic role="display" source="image/f3015.gif" alt="\int\nolimits_0^1 \eulere^x \,\diffd x"/>
  4778. would be represented as
  4779. <eg role='mathml'><![CDATA[
  4780. <mrow>
  4781.   <msubsup>
  4782.     <mo> ∫ </mo>
  4783.     <mn> 0 </mn>
  4784.     <mn> 1 </mn>
  4785.   </msubsup>
  4786.   <mrow>
  4787.     <msup>
  4788.       <mi> ⅇ </mi>
  4789.       <mi> x </mi>
  4790.     </msup>
  4791.     <mo> ⁢ </mo>
  4792.     <mrow>
  4793.       <mo> ⅆ </mo>
  4794.       <mi> x </mi>
  4795.     </mrow>
  4796.   </mrow>
  4797. </mrow>
  4798. ]]></eg>
  4799. </p>
  4800. </div4>
  4801. </div3>
  4802.  
  4803. <div3 id="presm_munder"><head>Underscript (<kw role="element">munder</kw>)</head>
  4804.  
  4805. <div4><head>Description</head>
  4806.  
  4807. <p>The syntax for the <kw role="element">munder</kw> element is:
  4808. <eg>
  4809. <munder> <emph>base</emph> <emph>underscript</emph> </munder>
  4810. </eg></p>
  4811. </div4>
  4812.  
  4813. <div4><head>Attributes</head>
  4814. <p>In addition to the attributes listed below, this element permits
  4815. <kw role="attrib">id</kw>,
  4816. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4817. <kw role="attrib">style</kw> attributes,
  4818. as described in <specref ref="fund_globatt"/>.</p>
  4819. <table border="1">
  4820. <thead>
  4821. <tr>
  4822. <td>Name</td>
  4823. <td>values</td>
  4824. <td>default</td>
  4825. </tr>
  4826. </thead>
  4827. <tbody>
  4828. <tr>
  4829. <td>accentunder</td>
  4830. <td>true | false</td>
  4831. <td>automatic</td>
  4832. </tr>
  4833. </tbody>
  4834. </table>
  4835.  
  4836. <p>The <kw role="attrib">accentunder</kw> attribute controls whether
  4837. <emph>underscript</emph> is drawn as an <quote>accent</quote> or as a limit. The
  4838. main difference between an accent and a limit is that the limit is
  4839. reduced in size whereas an accent is the same size as the base. A
  4840. second difference is that the accent is drawn closer to the base.</p>
  4841.  
  4842. <p>The default value of <kw role="attrib">accentunder</kw> is false, unless
  4843. <emph>underscript</emph> is an <kw role="element">mo</kw> element or an
  4844. embellished operator (see <specref ref="presm_mo"/>). If
  4845. <emph>underscript</emph> is an <kw role="element">mo</kw> element, the
  4846. value of its <kw role="attrib">accent</kw> attribute is used as the default
  4847. value of <kw role="attrib">accentunder</kw>. If <emph>underscript</emph> is an
  4848. embellished operator, the <kw role="attrib">accent</kw> attribute of the
  4849. <kw role="element">mo</kw> element at its core is used as the default
  4850. value.  As with all attributes, an explicitly given value overrides
  4851. the default.</p>
  4852.  
  4853. <p>Here is an example (accent versus underscript):
  4854. <graphic role="inline" source="image/f3016.gif" alt="\underbrace{x+y+z}"/> versus
  4855. <graphic role="inline" source="image/f3017.gif" alt="\underbrace{\strut x+y+z}"/>.
  4856. The MathML representation for this example is shown below.</p>
  4857.  
  4858. <p>If the base is an operator with <kw role="attrib">movablelimits</kw>=<kw
  4859. role="attval">true</kw> (or an embellished operator whose <kw
  4860. role="element">mo</kw> element core has <kw
  4861. role="attrib">movablelimits</kw>=<kw role="attval">true</kw>), and <kw
  4862. role="attrib">displaystyle</kw>=<kw role="attval">false</kw>, then
  4863. <emph>underscript</emph> is drawn in a subscript position. In this case,
  4864. the <kw role="attrib">accentunder</kw> attribute is ignored. This is often
  4865. used for limits on symbols such as <kw role="entity">sum</kw>.</p>
  4866.  
  4867. <p>Within <emph>underscript</emph>, <kw role="element">munder</kw> always
  4868. sets <kw role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, but increments
  4869. <kw role="attrib">scriptlevel</kw> by 1 only when <kw role="attrib">accentunder</kw> is
  4870. <kw role="attval">false</kw>. Within <emph>base</emph>, it always leaves both attributes
  4871. unchanged. (These attributes are inherited by every element through
  4872. its rendering environment, but can be set explicitly only on
  4873. <kw role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>.) 
  4874. </p>
  4875. </div4>
  4876.  
  4877. <div4><head>Examples</head>
  4878.  
  4879. <p>The MathML representation for the example shown above is:
  4880. <eg role='mathml'><![CDATA[
  4881. <mrow>
  4882.   <munder accentunder="true">
  4883.     <mrow>
  4884.       <mi> x </mi>
  4885.       <mo> + </mo>
  4886.       <mi> y </mi>
  4887.       <mo> + </mo>
  4888.       <mi> z </mi>
  4889.     </mrow>
  4890.     <mo> ⏟ </mo>
  4891.   </munder>
  4892.   <mtext> versus </mtext>
  4893.   <munder accentunder="false">
  4894.     <mrow>
  4895.       <mi> x </mi>
  4896.       <mo> + </mo>
  4897.       <mi> y </mi>
  4898.       <mo> + </mo>
  4899.       <mi> z </mi>
  4900.     </mrow>
  4901.     <mo> ⏟ </mo>
  4902.   </munder>
  4903. </mrow>
  4904. ]]></eg>
  4905. </p>
  4906. </div4>
  4907. </div3>
  4908.  
  4909. <div3 id="presm_mover"><head>Overscript (<kw role="element">mover</kw>)</head>
  4910.  
  4911. <div4><head>Description</head>
  4912. <p>The syntax for the <kw role="element">mover</kw> element is:
  4913. <eg>
  4914. <mover> <emph>base</emph> <emph>overscript</emph> </mover>
  4915. </eg></p>
  4916. </div4>
  4917.  
  4918. <div4><head>Attributes</head>
  4919. <p>In addition to the attributes listed below, this element permits
  4920. <kw role="attrib">id</kw>,
  4921. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  4922. <kw role="attrib">style</kw> attributes,
  4923. as described in <specref ref="fund_globatt"/>.</p>
  4924. <p>
  4925. <table border="1">
  4926. <thead>
  4927. <tr>
  4928. <td>Name</td>
  4929. <td>values</td>
  4930. <td>default</td>
  4931. </tr>
  4932. </thead>
  4933. <tbody>
  4934. <tr>
  4935. <td>accent</td>
  4936. <td>true | false</td>
  4937. <td>automatic</td>
  4938. </tr>
  4939. </tbody>
  4940. </table>
  4941. </p>
  4942.  
  4943. <p>The <kw role="attrib">accent</kw> attribute controls whether
  4944. <emph>overscript</emph> is drawn as an <quote>accent</quote> (diacritical mark) or
  4945. as a limit. The main difference between an accent and a limit is that
  4946. the limit is reduced in size whereas an accent is the same size as the
  4947. base. A second difference is that the accent is drawn closer to the
  4948. base. This is shown below (accent versus limit):
  4949. <graphic role="inline" source="image/f3018.gif" alt="\hat{x}"/> versus
  4950. <graphic role="inline" source="image/f3019.gif" alt="\hat{\strut x}"/>.</p>
  4951.  
  4952. <p>These differences also apply to <quote>mathematical accents</quote> such as
  4953. bars over expressions:
  4954. <graphic role="inline" source="image/f3020.gif" alt="\overbrace{x+y+z}"/> versus
  4955. <graphic role="inline" source="image/f3021.gif" alt="\overbrace{\strut x+y+z}"/>.
  4956. The MathML representation for each of these examples is shown below.</p>
  4957.  
  4958. <p>The default value of <emph>accent</emph> is false, unless
  4959. <emph>overscript</emph> is an <kw role="element">mo</kw> element or an
  4960. embellished operator (see <specref ref="presm_mo"/>). If
  4961. <emph>overscript</emph> is an <kw role="element">mo</kw> element, the value
  4962. of its <kw role="attrib">accent</kw> attribute is used as the default value
  4963. of <kw role="attrib">accent</kw> for <kw role="element">mover</kw>.  If
  4964. <emph>overscript</emph> is an embellished operator, the <kw
  4965. role="attrib">accent</kw> attribute of the <kw role="element">mo</kw>
  4966. element at its core is used as the default value.</p>
  4967.  
  4968. <p>If the base is an operator with <kw role="attrib">movablelimits</kw>=<kw
  4969. role="attval">true</kw> (or an embellished operator whose <kw
  4970. role="element">mo</kw> element core has <kw
  4971. role="attrib">movablelimits</kw>=<kw role="attval">true</kw>), and <kw
  4972. role="attrib">displaystyle</kw>=<kw role="attval">false</kw>, then
  4973. <emph>overscript</emph> is drawn in a superscript position. In this case,
  4974. the <kw role="attrib">accent</kw> attribute is ignored. This is often used
  4975. for limits on symbols such as <kw role="entity">sum</kw>.</p>
  4976.  
  4977. <p>Within <emph>overscript</emph>, <kw role="element">mover</kw> always
  4978. sets <kw role="attrib">displaystyle</kw> to <kw role="attval">false</kw>,
  4979. but increments <kw role="attrib">scriptlevel</kw> by 1 only when <kw
  4980. role="attrib">accent</kw> is <kw role="attval">false</kw>. Within
  4981. <emph>base</emph>, it always leaves both attributes unchanged. (These
  4982. attributes are inherited by every element through its rendering
  4983. environment, but can be set explicitly only on <kw
  4984. role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>.)
  4985. </p>
  4986. </div4>
  4987.  
  4988. <div4><head>Examples</head>
  4989.  
  4990. <p>The MathML representation for the examples shown above is:
  4991. <eg role='mathml'><![CDATA[
  4992. <mrow>
  4993.   <mover accent="true">
  4994.     <mi> x </mi>
  4995.     <mo> ^ </mo>
  4996.   </mover>
  4997.   <mtext> versus </mtext>
  4998.   <mover accent="false">
  4999.     <mi> x </mi>
  5000.     <mo> ^ </mo>
  5001.   </mover>
  5002. </mrow>
  5003. ]]></eg>
  5004. <eg role='mathml'><![CDATA[
  5005. <mrow>
  5006.   <mover accent="true">
  5007.     <mrow>
  5008.       <mi> x </mi>
  5009.       <mo> + </mo>
  5010.       <mi> y </mi>
  5011.       <mo> + </mo>
  5012.       <mi> z </mi>
  5013.     </mrow>
  5014.     <mo> ‾ </mo>
  5015.   </mover>
  5016.   <mtext> versus </mtext>
  5017.   <mover accent="false">
  5018.     <mrow>
  5019.       <mi> x </mi>
  5020.       <mo> + </mo>
  5021.       <mi> y </mi>
  5022.       <mo> + </mo>
  5023.       <mi> z </mi>
  5024.     </mrow>
  5025.     <mo> ‾ </mo>
  5026.   </mover>
  5027. </mrow>
  5028. ]]></eg>
  5029. </p>
  5030. </div4>
  5031. </div3>
  5032.  
  5033. <div3 id="presm_munderover"><head>Underscript-overscript Pair
  5034.   (<kw role="element">munderover</kw>)</head>
  5035.  
  5036. <div4><head>Description</head>
  5037. <p>The syntax for the <kw role="element">munderover</kw> element is:
  5038. <eg>
  5039. <munderover> <emph>base</emph> <emph>underscript</emph> <emph>overscript</emph> </munderover>
  5040. </eg></p>
  5041. </div4>
  5042.  
  5043. <div4><head>Attributes</head>
  5044. <p>In addition to the attributes listed below, this element permits
  5045. <kw role="attrib">id</kw>,
  5046. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  5047. <kw role="attrib">style</kw> attributes,
  5048. as described in <specref ref="fund_globatt"/>.</p>
  5049. <table border="1">
  5050. <thead>
  5051. <tr>
  5052. <td>Name</td>
  5053. <td>values</td>
  5054. <td>default</td>
  5055. </tr>
  5056. </thead>
  5057. <tbody>
  5058. <tr>
  5059. <td>accent</td>
  5060. <td>true | false</td>
  5061. <td>automatic</td>
  5062. </tr>
  5063. <tr>
  5064. <td>accentunder</td>
  5065. <td>true | false</td>
  5066. <td>automatic</td>
  5067. </tr>
  5068. </tbody>
  5069. </table>
  5070.  
  5071. <p>The <kw role="element">munderover</kw> element is used so that the
  5072. underscript and overscript are vertically spaced equally in relation
  5073. to the base and so that they follow the slant of the base as in the
  5074. second expression shown below:</p>
  5075.  
  5076. <p><graphic role="display" source="image/f3022.gif" alt="\int_0^{\!\!\!\infty}"/>
  5077. versus
  5078. <graphic role="display" source="image/f3023.gif" alt="\int_0^{\infty}"/>
  5079. The MathML representation for this example is shown below.</p>
  5080.  
  5081. <p>The difference in the vertical spacing is too small to be noticed on a
  5082. low resolution display at a normal font size, but is noticeable on a higher
  5083. resolution device such as a printer and when using large font sizes.  In
  5084. addition to the visual differences, attaching both the underscript and
  5085. overscript to the same base more accurately reflects the semantics of the
  5086. expression.</p>
  5087.  
  5088. <p>The <kw role="attrib">accent</kw> and <kw role="attrib">accentunder</kw>
  5089. attributes have the same effect as the attributes with the same names on
  5090. <kw role="element">mover</kw> (<specref ref="presm_mover"/>) and <kw
  5091. role="element">munder</kw> (<specref ref="presm_munder"/>),
  5092. respectively. Their default values are also computed in the same manner as
  5093. described for those elements, with the default value of <kw
  5094. role="attrib">accent</kw> depending on <emph>overscript</emph> and the
  5095. default value of <kw role="attrib">accentunder</kw> depending on
  5096. <emph>underscript</emph>.</p>
  5097.  
  5098. <p>If the base is an operator with <kw role="attrib">movablelimits</kw>=<kw
  5099. role="attval">true</kw> (or an embellished operator whose <kw
  5100. role="element">mo</kw> element core has <kw
  5101. role="attrib">movablelimits</kw>=<kw role="attval">true</kw>), and <kw
  5102. role="attrib">displaystyle</kw>=<kw role="attval">false</kw>, then
  5103. <emph>underscript</emph> and <emph>overscript</emph> are drawn in a 
  5104. subscript and superscript position, respectively. In this case, the <kw
  5105. role="attrib">accent</kw> and <kw role="attrib">accentunder</kw> attributes
  5106. are ignored. This is often used for limits on symbols such as <kw
  5107. role="entity">sum</kw>.</p>
  5108.  
  5109. <p>Within <emph>underscript</emph>, <kw role="element">munderover</kw>
  5110. always sets <kw role="attrib">displaystyle</kw> to <kw
  5111. role="attval">false</kw>, but increments <kw role="attrib">scriptlevel</kw>
  5112. by 1 only when <kw role="attrib">accentunder</kw> is <kw
  5113. role="attval">false</kw>. Within <emph>overscript</emph>, <kw
  5114. role="element">munderover</kw> always sets <kw
  5115. role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, but
  5116. increments <kw role="attrib">scriptlevel</kw> by 1 only when <kw
  5117. role="attrib">accent</kw> is <kw role="attval">false</kw>. Within
  5118. <emph>base</emph>, it always leaves both attributes unchanged. (These
  5119. attributes are inherited by every element through its rendering
  5120. environment, but can be set explicitly only on <kw
  5121. role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>).</p>
  5122. </div4>
  5123.  
  5124. <div4><head>Examples</head>
  5125.  
  5126. <p>The MathML representation for the example shown above with the first
  5127. expression made using separate <kw role="element">munder</kw> and
  5128. <kw role="element">mover</kw> elements, and the second one using an
  5129. <kw role="element">munderover</kw> element, is:
  5130. <eg role='mathml'><![CDATA[
  5131. <mrow>
  5132.   <mover>
  5133.     <munder>
  5134.       <mo> ∫ </mo>
  5135.       <mn> 0 </mn>
  5136.     </munder>
  5137.     <mi> ∞ </mi>
  5138.   </mover>
  5139.   <mtext> versus </mtext>
  5140.   <munderover>
  5141.     <mo> ∫ </mo>
  5142.     <mn> 0 </mn>
  5143.     <mi> ∞ </mi>
  5144.   </munderover>
  5145. </mrow>
  5146. ]]></eg>
  5147. </p>
  5148. </div4>
  5149. </div3>
  5150.  
  5151. <div3 id="presm_mmultiscripts"><head>Prescripts and Tensor Indices
  5152.   (<kw role="element">mmultiscripts</kw>)</head>
  5153.  
  5154. <div4><head>Description</head>
  5155.  
  5156. <p>The syntax for the <kw role="element">mmultiscripts</kw> element is:
  5157. <eg>
  5158. <mmultiscripts>
  5159.     <emph>base</emph>
  5160.      (<emph>subscript superscript</emph>)*
  5161.      [ <mprescripts/> (<emph>presubscript presuperscript</emph>)* ]
  5162. </mmultiscripts>
  5163. </eg>
  5164. </p>
  5165. <p>Presubscripts and tensor notations are represented by a single
  5166. element, <kw role="element">mmultiscripts</kw>. This element allows the
  5167. representation of any number of vertically-aligned pairs of subscripts
  5168. and superscripts, attached to one base expression. It supports both
  5169. postscripts (to the right of the base in visual notation) and
  5170. prescripts (to the left of the base in visual notation). Missing
  5171. scripts can be represented by the empty element
  5172. <kw role="element">none</kw>.</p>
  5173.  
  5174. <p>The prescripts are optional, and when present are given
  5175. <emph>after</emph> the postscripts, because prescripts are relatively
  5176. rare compared to tensor notation.</p>
  5177.  
  5178. <p>The argument sequence consists of the base followed by zero or more
  5179. pairs of vertically-aligned subscripts and superscripts (in that
  5180. order) that represent all of the postscripts. This list is optionally
  5181. followed by an empty element <kw role="element">mprescripts</kw> and a
  5182. list of zero or more pairs of vertically-aligned presubscripts and
  5183. presuperscripts that represent all of the prescripts. The pair lists
  5184. for postscripts and prescripts are given in a left-to-right order. If
  5185. no subscript or superscript should be rendered in a given position,
  5186. then the empty element <kw role="element">none</kw> should be used in
  5187. that position.</p>
  5188.  
  5189. <p>The base, subscripts, superscripts, the optional separator element
  5190. <kw role="element">mprescripts</kw>, the presubscripts, and the
  5191. presuperscripts, are all direct sub-expressions of the
  5192. <kw role="element">mmultiscripts</kw> element, i.e. they are all at the
  5193. same level of the expression tree. Whether a script argument is a
  5194. subscript or a superscript, or whether it is a presubscript or a
  5195. presuperscript is determined by whether it occurs in an even-numbered
  5196. or odd-numbered argument position, respectively, ignoring the empty
  5197. element <kw role="element">mprescripts</kw> itself when determining the
  5198. position. The first argument, the base, is considered to be in
  5199. position 1. The total number of arguments must be odd, if
  5200. <kw role="element">mprescripts</kw> is not given, or even, if it is.</p>
  5201.  
  5202. <p>The empty elements <kw role="element">mprescripts</kw> and
  5203. <kw role="element">none</kw> are only allowed as direct sub-expressions
  5204. of <kw role="element">mmultiscripts</kw>.</p>
  5205. </div4>
  5206.  
  5207. <div4><head>Attributes</head>
  5208. <p>Same as the attributes of <kw role="element">msubsup</kw>.</p>
  5209.  
  5210. <p>The <kw role="element">mmultiscripts</kw> element increments <kw
  5211. role="attrib">scriptlevel</kw> by 1, and sets <kw
  5212. role="attrib">displaystyle</kw> to <kw role="attval">false</kw>, within
  5213. each of its arguments except <emph>base</emph>, but leaves both attributes
  5214. unchanged within <emph>base</emph>. (These attributes are inherited by
  5215. every element through its rendering environment, but can be set explicitly
  5216. only on <kw role="element">mstyle</kw>; see <specref ref="presm_mstyle"/>.)
  5217. </p>
  5218. </div4>
  5219.  
  5220. <div4><head>Examples</head>
  5221.  
  5222. <p>Two examples of the use of <kw role="element">mmultiscripts</kw> are:</p>
  5223. <p><sub>0</sub><mi>F</mi><sub>1</sub>(;<mi>a</mi>;<mi>z</mi>).
  5224. <eg role='mathml'><![CDATA[
  5225. <mrow>
  5226.   <mmultiscripts>
  5227.     <mi> F </mi>
  5228.     <mn> 1 </mn>
  5229.     <none/>
  5230.     <mprescripts/>
  5231.     <mn> 0 </mn>
  5232.     <none/>
  5233.   </mmultiscripts>
  5234.   <mo> ⁡ </mo>
  5235.   <mrow>
  5236.     <mo> ( </mo>
  5237.     <mrow> 
  5238.       <mo> ; </mo>
  5239.       <mi> a </mi>
  5240.       <mo> ; </mo>
  5241.       <mi> z </mi>
  5242.     </mrow> 
  5243.     <mo> ) </mo>
  5244.   </mrow>
  5245. </mrow>
  5246. ]]></eg>
  5247. </p>
  5248.  
  5249. <p><graphic role="inline" source="image/f3024.gif" alt="R_i{}^j_{kl}"/>
  5250. (where <mi>k</mi> and <mi>l</mi> are different indices)
  5251. <eg role='mathml'><![CDATA[
  5252. <mmultiscripts>
  5253.   <mi> R </mi>
  5254.   <mi> i </mi>
  5255.   <none/>
  5256.   <none/>
  5257.   <mi> j </mi>
  5258.   <mi> k </mi>
  5259.   <none/>
  5260.   <mi> l </mi>
  5261.   <none/>
  5262. </mmultiscripts>
  5263. ]]></eg>
  5264. </p>
  5265. </div4>
  5266. </div3>
  5267. </div2>
  5268.  
  5269. <div2 id="presm_tabmat"><head>Tables and Matrices</head>
  5270.  
  5271. <p>Matrices, arrays and other table-like mathematical notation are marked
  5272. up using <kw role="element">mtable</kw>,
  5273. <kw role="element">mtr</kw>, <kw role="element">mlabeledtr</kw> and
  5274. <kw role="element">mtd</kw> elements. These elements are similar to the
  5275. <kw role="element">TABLE</kw>, <kw role="element">TR</kw> and <kw
  5276. role="element">TD</kw> elements of HTML, except that they provide
  5277. specialized attributes for the fine layout control
  5278. necessary for commutative diagrams, block matrices and so on.</p>
  5279.  
  5280. <p>The <kw role="element">mlabeledtr</kw> element represents a labeled
  5281. row of a table and can be used for numbered equations.
  5282. The first child of <kw role="element">mlabeledtr</kw> is the label.
  5283. A label is somewhat special in that it is not considered an expression
  5284. in the matrix and is not counted when determining the number of columns
  5285. in that row.</p>
  5286.  
  5287. <div3 id="presm_mtable"><head>Table or Matrix
  5288.   (<kw role="element">mtable</kw>)</head>
  5289.  
  5290. <div4><head>Description</head>
  5291.  
  5292. <p>A matrix or table is specified using the <kw
  5293. role="element">mtable</kw> element. Inside of the <kw
  5294. role="element">mtable</kw> element, only <kw role="element">mtr</kw>
  5295. or <kw role="element">mlabeledtr</kw> elements may appear.</p>
  5296.  
  5297. <p>In MathML 1.x, the <kw role="element">mtable</kw> element could
  5298. infer <kw role="element">mtr</kw> elements around its arguments, and
  5299. the <kw role="element">mtr</kw> element could infer <kw
  5300. role="element">mtd</kw> elements.  In other words, if some argument to
  5301. an <kw role="element">mtable</kw> was not an <kw
  5302. role="element">mtr</kw> element, a MathML application was to assume a
  5303. row with a single column (i.e. the argument was effectively wrapped
  5304. with an inferred <kw role="element">mtr</kw>). Similarly, if some
  5305. argument to a (possibly inferred) <kw role="element">mtr</kw> element
  5306. was not an <kw role="element">mtd</kw> element, that argument was to
  5307. be treated as a table entry by wrapping it with an inferred <kw
  5308. role="element">mtd</kw> element.
  5309. MathML 2.0 <intref ref="interf_deprec">deprecates</intref> the inference
  5310. of <kw role="element">mtr</kw> and <kw role="element">mtd</kw> elements;
  5311. <kw role="element">mtr</kw> and <kw role="element">mtd</kw> elements
  5312. must be used inside of <kw role="element">mtable</kw> and
  5313. <kw role="element">mtr</kw> respectively.</p>
  5314.  
  5315. <p>Table rows that have fewer columns than other rows of the same
  5316. table (whether the other rows precede or follow them) are effectively
  5317. padded on the right with empty <kw role="element">mtd</kw> elements so
  5318. that the number of columns in each row equals the maximum number of
  5319. columns in any row of the table. Note that the use of
  5320. <kw role="element">mtd</kw> elements with non-default values of the
  5321. <kw role="attrib">rowspan</kw> or <kw role="attrib">columnspan</kw>
  5322. attributes may affect
  5323. the number of <kw role="element">mtd</kw> elements that should be given
  5324. in subsequent <kw role="element">mtr</kw> elements to cover a given
  5325. number of columns.
  5326. Note also that the label in an <kw role="element">mlabeledtr</kw> element
  5327. is not considered a column in the table.</p>
  5328. </div4>
  5329.  
  5330. <div4><head>Attributes</head>
  5331. <p>In addition to the attributes listed below, this element permits
  5332. <kw role="attrib">id</kw>,
  5333. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  5334. <kw role="attrib">style</kw> attributes,
  5335. as described in <specref ref="fund_globatt"/>.</p>
  5336. <table border="1">
  5337. <thead>
  5338. <tr>
  5339. <td>Name</td>
  5340. <td>values</td>
  5341. <td>default</td>
  5342. </tr>
  5343. </thead>
  5344. <tbody>
  5345. <tr>
  5346. <td>align</td>
  5347. <td>(top | bottom | center | baseline | axis) [ rownumber ]</td>
  5348. <td>axis</td>
  5349. </tr>
  5350. <tr>
  5351. <td>rowalign</td>
  5352. <td>(top | bottom | center | baseline | axis) +</td>
  5353. <td>baseline</td>
  5354. </tr>
  5355. <tr>
  5356. <td>columnalign</td>
  5357. <td>(left | center | right) +</td>
  5358. <td>center</td>
  5359. </tr>
  5360. <tr>
  5361. <td>groupalign</td>
  5362. <td>group-alignment-list-list</td>
  5363. <td>{left}</td>
  5364. </tr>
  5365. <tr>
  5366. <td>alignmentscope</td>
  5367. <td>(true | false) +</td>
  5368. <td>true</td>
  5369. </tr>
  5370. <tr>
  5371. <td>columnwidth</td>
  5372. <td>( auto | number h-unit | namedspace | fit ) +</td>
  5373. <td>auto</td>
  5374. </tr>
  5375. <tr>
  5376. <td>width</td>
  5377. <td>auto | number h-unit</td>
  5378. <td>auto</td>
  5379. </tr>
  5380. <tr>
  5381. <td>rowspacing</td>
  5382. <td>( number v-unit ) +</td>
  5383. <td>1.0ex</td>
  5384. </tr>
  5385. <tr>
  5386. <td>columnspacing</td>
  5387. <td>( number h-unit | namedspace ) +</td>
  5388. <td>0.8em</td>
  5389. </tr>
  5390. <tr>
  5391. <td>rowlines</td>
  5392. <td>(none | solid | dashed) +</td>
  5393. <td>none</td>
  5394. </tr>
  5395. <tr>
  5396. <td>columnlines</td>
  5397. <td>(none | solid | dashed) +</td>
  5398. <td>none</td>
  5399. </tr>
  5400. <tr>
  5401. <td>frame</td>
  5402. <td>none | solid | dashed</td>
  5403. <td>none</td>
  5404. </tr>
  5405. <tr>
  5406. <td>framespacing</td>
  5407. <td>(number h-unit | namedspace) (number v-unit | namedspace)</td>
  5408. <td>0.4em 0.5ex</td>
  5409. </tr>
  5410. <tr>
  5411. <td>equalrows</td>
  5412. <td>true | false</td>
  5413. <td>false</td>
  5414. </tr>
  5415. <tr>
  5416. <td>equalcolumns</td>
  5417. <td>true | false</td>
  5418. <td>false</td>
  5419. </tr>
  5420. <tr>
  5421. <td>displaystyle</td>
  5422. <td>true | false</td>
  5423. <td>false</td>
  5424. </tr>
  5425. <tr>
  5426. <td>side</td>
  5427. <td>left | right | leftoverlap | rightoverlap</td>
  5428. <td>right</td>
  5429. </tr>
  5430. <tr>
  5431. <td>minlabelspacing</td>
  5432. <td>number h-unit</td>
  5433. <td>0.8em</td>
  5434. </tr>
  5435. </tbody>
  5436. </table>
  5437.  
  5438. <p>Note that the default value for each of <kw
  5439. role="attrib">rowlines</kw>, <kw role="attrib">columnlines</kw> and
  5440. <kw role="attrib">frame</kw> is the literal string
  5441. <quote>none</quote>, meaning that the default is to render no lines,
  5442. rather than that there is no default.</p>
  5443.  
  5444. <p>As described in <specref ref="fund_attval"/>, the notation <code>(x
  5445. | y)+</code> means one or more occurrences of either <code>x</code> or
  5446. <code>y</code>, separated by whitespace. For example, possible values
  5447. for <kw role="attrib">columnalign</kw> are <kw
  5448. role="attval">left</kw>, <kw role="attval">left left</kw>, and <kw
  5449. role="attval">left right center center</kw>.  If there are more
  5450. entries than are necessary (e.g. more entries than columns for <kw
  5451. role="attrib">columnalign</kw>), then only the first entries will be
  5452. used. If there are fewer entries, then the last entry is repeated as
  5453. often as necessary. For example, if <kw
  5454. role="attrib">columnalign</kw>="right center" and the table has three
  5455. columns, the first column will be right aligned and the second and
  5456. third columns will be centered.  The label in a <kw
  5457. role="element">mlabeledtr</kw> is not considered as a column in the
  5458. table and the attribute values that apply to columns do not apply to
  5459. labels.</p>
  5460.  
  5461. <p>The <kw role="attrib">align</kw> attribute specifies where to align the
  5462. table with respect to its environment. <kw role="attval">axis</kw> means to align
  5463. the center of the table on the environment's axis. (The axis of an equation
  5464. is an alignment line used by typesetters. It is the line on which a minus
  5465. sign typically lies.  The center of the table is the midpoint of the
  5466. table's vertical extent.) <kw role="attval">center</kw> and <kw role="attval">baseline</kw>
  5467. both mean to align the center of the table on the environment's
  5468. baseline. <kw role="attval">top</kw> or <kw role="attval">bottom</kw> aligns the top or
  5469. bottom of the table on the environment's baseline.</p>
  5470.  
  5471. <p>If the <kw role="attrib">align</kw> attribute value ends with a 
  5472. <kw role="attval">rownumber</kw> between 1 and <mi>n</mi> (for a table with
  5473. <mi>n</mi> rows), the specified row is aligned in the way described above,
  5474. rather than the table as a whole; the top (first) row is numbered 1, and
  5475. the bottom (last) row is numbered <mi>n</mi>. The same is true if the
  5476. row number is negative, between -1 and -<mi>n</mi>,
  5477. except that the bottom row is referred to as -1 and the top row as
  5478. -<mi>n</mi>. Other values of <kw role="attval">rownumber</kw> are
  5479. illegal.</p>
  5480.  
  5481. <p>The <kw role="attrib">rowalign</kw> attribute specifies how the entries in
  5482. each row should be aligned. For example, <kw role="attval">top</kw> means that the tops of
  5483. each entry in each row should be aligned with the tops of the other
  5484. entries in that row. The <kw role="attrib">columnalign</kw> attribute specifies
  5485. how the entries in each column should be aligned.</p>
  5486.  
  5487. <p>The <kw role="attrib">groupalign</kw> and <kw role="attrib">alignmentscope</kw>
  5488. attributes are described with the alignment elements,
  5489. <kw role="element">maligngroup</kw> and
  5490. <kw role="element">malignmark</kw>, in <specref
  5491. ref="presm_malign"/>.</p>
  5492.  
  5493. <p>The <kw role="attrib">columnwidth</kw> attribute specifies how wide
  5494. a column should be.  The <kw role="attval">auto</kw> value means that
  5495. the column should be as wide as needed, which is the default.  If an
  5496. explicit value is given, then the column is exactly that wide and the
  5497. contents of that column are made to fit in that width.  The contents
  5498. are linewrapped or clipped at the discretion of the renderer.  If <kw
  5499. role="attval">fit</kw> is given as a value, the remaining page width
  5500. after subtracting the widths for columns specified as <kw
  5501. role="attval">auto</kw> and/or specific widths is divided equally
  5502. among the <kw role="attval">fit</kw> columns and this value is used
  5503. for the column width.  If insufficient room remains to hold the
  5504. contents of the <kw role="attval">fit</kw> columns, renderers may
  5505. linewrap or clip the contents of the <kw role="attval">fit</kw>
  5506. columns.  When the <kw role="attrib">columnwidth</kw> is specified as
  5507. a percentage, the value is relative to the width of the table.  That
  5508. is, a renderer should try to adjust the width of the column so that it
  5509. covers the specified percentage of the entire table width.</p>
  5510.  
  5511. <p>The <kw role="attrib">width</kw> attribute specifies the desired
  5512. width of the entire table and is intended for visual user agents. When
  5513. the value is a percentage value, the value is relative to the
  5514. horizontal space a MathML renderer has available for the table
  5515. element.  When the value is <kw role="attval">auto</kw>, the MathML
  5516. renderer should calculate the table width from its contents using
  5517. whatever layout algorithm it chooses.</p>
  5518.  
  5519. <p>MathML 2.0 does not specify a table layout algorithm.  In
  5520. particular, it is the responsibility of a MathML renderer to resolve
  5521. conflicts between the <kw role="attrib">width</kw> attribute and other
  5522. constraints on the width of a table, such as explicit values for <kw
  5523. role="attrib">columnwidth</kw> attributes, and minimum sizes for table
  5524. cell contents.  For a discussion of table layout algorithms, see
  5525. <loc
  5526. href="http://www.w3.org/TR/CSS2/tables.html#width-layout">Cascading
  5527. Style Sheets, level 2</loc>.</p>
  5528.  
  5529. <p>The <kw role="attrib">rowspacing</kw> and <kw role="attrib">columnspacing</kw>
  5530. attributes specify how much space should be added between each row and
  5531. column. However, spacing before the first row and after the last row
  5532. (i.e. at the top and bottom of the table) is given by the second
  5533. number in the value of the <kw role="attrib">framespacing</kw> attribute, and
  5534. spacing before the first column and after the last column (i.e. on the
  5535. left and on the right of the table) is given by the first number in
  5536. the value of the <kw role="attrib">framespacing</kw> attribute.</p>
  5537.  
  5538. <p>In those attributes' syntaxes, <emph>h-unit</emph> or
  5539. <emph>v-unit</emph> represents a unit of horizontal or vertical
  5540. length, respectively (see <specref ref="fund_units"/>).  The units shown in the
  5541. attributes' default values (<code>em</code> or <code>ex</code>) are
  5542. typically used.</p>
  5543.  
  5544. <p>The <kw role="attrib">rowlines</kw> and <kw role="attrib">columnlines</kw> attributes
  5545. specify whether and what kind of lines should be added between each
  5546. row and column. Lines before the first row or column and after the
  5547. last row or column are given using the <kw role="attrib">frame</kw>
  5548. attribute.</p>
  5549.  
  5550. <p>If a frame is desired around the table, the <kw role="attrib">frame</kw>
  5551. attribute is used. If the attribute value is not <quote>none</quote>, then
  5552. <kw role="attrib">framespacing</kw> is used to add spacing between the lines of
  5553. the frame and the first and last rows and columns of the table. If
  5554. <kw role="attrib">frame</kw>="none", then the <kw role="attrib">framespacing</kw>
  5555. attribute is ignored. The <kw role="attrib">frame</kw> and
  5556. <kw role="attrib">framespacing</kw> attributes are not part of the
  5557. <kw role="attrib">rowlines</kw>/<kw role="attrib">columnlines</kw>,
  5558. <kw role="attrib">rowspacing</kw>/<kw role="attrib">columnspacing</kw> options because
  5559. having them be so would often require that <kw role="attrib">rowlines</kw> and
  5560. <kw role="attrib">columnlines</kw> would need to be fully specified instead of
  5561. just giving a single value.
  5562. For example, if a table had five columns and it was desired to have
  5563. no frame around the table but to have lines between the columns, then
  5564. <code>columnlines="none solid solid solid solid none"</code>
  5565. would be necessary. If the frame is separated from the internal
  5566. lines, only <code>columnlines="solid"</code> is needed.</p>
  5567.  
  5568. <p>The <kw role="attrib">equalrows</kw> attribute forces the rows all to be
  5569. the same total height when set to <kw role="attval">true</kw>. The <kw
  5570. role="attrib">equalcolumns</kw> attribute forces the columns all to be the
  5571. same width when set to <kw role="attval">true</kw>.</p>
  5572.  
  5573. <p>The <kw role="attrib">displaystyle</kw> attribute specifies the
  5574. value of <kw role="attrib">displaystyle</kw> (described under <kw
  5575. role="element">mstyle</kw> in <specref ref="presm_mstyle"/>) within
  5576. each cell (<kw role="element">mtd</kw> element) of the table. Setting
  5577. <kw role="attrib">displaystyle</kw>=<kw role="attval">true</kw> can be
  5578. useful for tables whose elements are whole mathematical expressions;
  5579. the default value of <kw role="attval">false</kw> is appropriate when
  5580. the table is part of an expression, for example, when it represents a
  5581. matrix. In either case, <kw role="attrib">scriptlevel</kw> (<specref
  5582. ref="presm_mstyle"/>) is not changed for the table cells.</p>
  5583.  
  5584. <p>The <kw role="attrib">side</kw> attribute
  5585. specifies what side of a table a label for a table row should should be 
  5586. placed.  This attribute is intended to be used for labeled expressions.
  5587. If <kw role="attval">left</kw> or <kw role="attval">right</kw> is specified,
  5588. the label is placed on the left or right side of the table row respectively.
  5589. The other two attribute values are variations on
  5590. <kw role="attval">left</kw> and <kw role="attval">right</kw>:
  5591. if the labeled row fits within the width allowed for the table without
  5592. the label,
  5593. but does not fit within the width if the label is included, then the
  5594. label overlaps the row and is displayed above the row if
  5595. <kw role="attrib">rowalign</kw> for that row is <kw role="attval">top</kw>;
  5596. otherwise the label is displayed below the row.</p>
  5597.  
  5598. <p>
  5599. If there are multiple labels in a table, the alignment of the labels within
  5600. the virtual column that they form is left-aligned for labels on the left
  5601. side of the table, and right-aligned for labels on the right side of the
  5602. table.  The alignment can be overridden by specifying
  5603. <kw role="attrib">columnalignment</kw> for a <kw role="element">mlabeledtr</kw>
  5604. element.
  5605. </p>
  5606.  
  5607.  
  5608. <p>The <kw role="attrib">minlabelspacing</kw> attribute
  5609. specifies the minimum space allowed between a label and the adjacent
  5610. entry in the row.
  5611. </p>
  5612.  
  5613. </div4>
  5614.  
  5615. <div4><head>Examples</head>
  5616.  
  5617. <p>A 3 by 3 identity matrix could be represented as follows:
  5618. <eg role='mathml'><![CDATA[
  5619. <mrow>
  5620.   <mo> ( </mo>
  5621.   <mtable>
  5622.     <mtr>
  5623.       <mtd> <mn>1</mn> </mtd>
  5624.       <mtd> <mn>0</mn> </mtd>
  5625.       <mtd> <mn>0</mn> </mtd>
  5626.     </mtr>
  5627.     <mtr>
  5628.       <mtd> <mn>0</mn> </mtd>
  5629.       <mtd> <mn>1</mn> </mtd>
  5630.       <mtd> <mn>0</mn> </mtd>
  5631.     </mtr>
  5632.     <mtr>
  5633.       <mtd> <mn>0</mn> </mtd>
  5634.       <mtd> <mn>0</mn> </mtd>
  5635.       <mtd> <mn>1</mn> </mtd>
  5636.     </mtr>
  5637.   </mtable>
  5638.   <mo> ) </mo>
  5639. </mrow>
  5640. ]]></eg>
  5641. </p>
  5642.  
  5643. <p>This might be rendered as:
  5644. <graphic source="image/f3025.gif"
  5645.   alt="\left(\begin{array}{ccc}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{array}\right)"/>
  5646. Note that the parentheses must be represented explicitly; they are not
  5647. part of the <kw role="element">mtable</kw> element's rendering. This allows
  5648. use of other surrounding fences, such as brackets, or none at all.</p>
  5649. </div4>
  5650. </div3>
  5651.  
  5652. <div3 id="presm_mtr"><head>Row in Table or Matrix (<kw role="element">mtr</kw>)</head>
  5653.  
  5654. <div4><head>Description</head>
  5655.  
  5656. <p>An <kw role="element">mtr</kw> element represents one row in a table
  5657. or matrix. An <kw role="element">mtr</kw> element is only allowed as a
  5658. direct sub-expression of an <kw role="element">mtable</kw> element, and
  5659. specifies that its contents should form one row of the table. Each
  5660. argument of <kw role="element">mtr</kw> is placed in a different column
  5661. of the table, starting at the leftmost column.</p>
  5662.  
  5663. <p>As described in <specref ref="presm_mtable"/>,
  5664. <kw role="element">mtr</kw> elements are
  5665. effectively padded on the right with <kw role="element">mtd</kw>
  5666. elements when they are shorter than other rows in a table.
  5667. </p>
  5668. </div4>
  5669.  
  5670. <div4><head>Attributes</head>
  5671. <p>In addition to the attributes listed below, this element permits
  5672. <kw role="attrib">id</kw>,
  5673. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  5674. <kw role="attrib">style</kw> attributes,
  5675. as described in <specref ref="fund_globatt"/>.</p>
  5676. <table border="1">
  5677. <thead>
  5678. <tr>
  5679. <td>Name</td>
  5680. <td>values</td>
  5681. <td>default</td>
  5682. </tr>
  5683. </thead>
  5684. <tbody>
  5685. <tr>
  5686. <td>rowalign</td>
  5687. <td>top | bottom | center | baseline | axis</td>
  5688. <td>inherited</td>
  5689. </tr>
  5690. <tr>
  5691. <td>columnalign</td>
  5692. <td>(left | center | right) +</td>
  5693. <td>inherited</td>
  5694. </tr>
  5695. <tr>
  5696. <td>groupalign</td>
  5697. <td>group-alignment-list-list</td>
  5698. <td>inherited</td>
  5699. </tr>
  5700. </tbody>
  5701. </table>
  5702.  
  5703. <p>The <kw role="attrib">rowalign</kw> and <kw
  5704. role="attrib">columnalign</kw> attributes allow a specific row to
  5705. override the alignment specified by the same attributes in the
  5706. surrounding <kw role="element">mtable</kw> element.</p>
  5707.  
  5708. <p>As with <kw role="element">mtable</kw>, if there are more entries than
  5709. necessary in the value of <kw role="attrib">columnalign</kw> (i.e. more entries
  5710. than columns in the row), then the extra entries will be ignored. If
  5711. there are fewer entries than columns, then the last entry will be
  5712. repeated as many times as needed.</p>
  5713.  
  5714. <p>The <kw role="attrib">groupalign</kw> attribute is described with the alignment
  5715. elements, <kw role="element">maligngroup</kw> and <kw role="element">malignmark</kw>,
  5716. in <specref ref="presm_malign"/>.</p>
  5717. </div4>
  5718. </div3>
  5719.  
  5720. <div3 id="presm_mlabeledtr"><head>Labeled Row in Table or Matrix
  5721.   (<kw role="element">mlabeledtr</kw>)</head>
  5722.  
  5723. <div4><head>Description</head>
  5724.  
  5725. <p>An <kw role="element">mlabeledtr</kw> element represents one row in
  5726. a table that has a label on either the left or right side, as
  5727. determined by the <kw role="attrib">side</kw> attribute.  The label is
  5728. the first child of <kw role="element">mlabeledtr</kw>.  The rest of
  5729. the children represent the contents of the row and are identical to
  5730. those used for <kw role="element">mtr</kw>; all of the children except
  5731. the first must be <kw role="element">mtd</kw> elements.
  5732. </p>
  5733.  
  5734. <p>
  5735. An <kw role="element">mlabeledtr</kw> element is only allowed as a
  5736. direct sub-expression of an <kw role="element">mtable</kw> element.
  5737. Each argument of <kw role="element">mlabeledtr</kw> except for the first
  5738. argument (the label) is placed in a different column
  5739. of the table, starting at the leftmost column.</p>
  5740.  
  5741. <p>Note that the label element is not considered to be a cell in the
  5742. table row.  In particular, the label element is not taken into
  5743. consideration in the table layout for purposes of width and alignment
  5744. calculations.  For example, in the case of an <kw
  5745. role="element">mlabeledtr</kw> with a label and a single centered <kw
  5746. role="element">mtd</kw> child, the child is first centered in the
  5747. enclosing <kw role="element">mtable</kw>, and then the label is
  5748. placed.  Specifically, the child is <emph>not</emph> centered in the
  5749. space that remains in the table after placing the label.</p>
  5750.  
  5751. <p>While MathML 2.0 does not specify an algorithm for placing labels,
  5752. implementors of visual renderers may find the following formatting
  5753. model useful.  To place a label, an implementor might think in terms
  5754. of creating a larger table, with an extra column on both ends.  The
  5755. <kw role="attrib">columnwidth</kw> attributes of both these border
  5756. columns would be set to <kw role="attval">fit</kw> so that they expand
  5757. to fill whatever space remains after the inner columns have been laid
  5758. out.  Finally, depending on the values of <kw role="attrib">side</kw>
  5759. and <kw role="attrib">minlabelspacing</kw>, the label is placed
  5760. in whatever border column is appropriate, possibly shifted down if
  5761. necessary.</p>
  5762. </div4>
  5763.  
  5764. <div4><head>Attributes</head>
  5765.  
  5766. <p>
  5767. The attributes for <kw role="element">mlabeledtr</kw> are the same
  5768. as for <kw role="element">mtr</kw>.  Unlike the attributes for the
  5769. <kw role="element">mtable</kw> element, attributes of
  5770. <kw role="element">mlabeledtr</kw> that apply to column elements
  5771. also apply to the label.  For example, in a one column table,
  5772. <eg role="mathml-fragment">
  5773. <![CDATA[
  5774. <mlabeledtr rowalign='top'>
  5775. ]]>
  5776. </eg>
  5777. means that the label and other entries in the row are vertically aligned
  5778. along their top.  To force a particular alignment on the label,
  5779. the appropriate attribute would normally be set on the
  5780. <kw role="element">mtd</kw> start tag that surrounds the label content.
  5781. </p>
  5782. </div4>
  5783.  
  5784. <div4><head>Equation Numbering</head>
  5785.  
  5786. <p>One of the important uses of <kw role="element">mlabeledtr</kw> is
  5787. for numbered equations.  In a <kw role="element">mlabeledtr</kw>, the
  5788. label represents the equation number and the elements in the row are
  5789. the equation being numbered.  The <kw role="attrib">side</kw> and <kw
  5790. role="attrib">minlabelspacing</kw> attributes of <kw
  5791. role="element">mtable</kw> determine the placement of the equation
  5792. number.</p>
  5793.  
  5794. <p>In larger documents with many numbered equations, automatic
  5795. numbering becomes important. While automatic equation numbering and
  5796. automatically resolving references to equation numbers is outside the
  5797. scope of MathML, these problems can be addressed by the use of style
  5798. sheets or other means. The mlabeledtr construction provides support
  5799. for both of these functions in a way that is intended to facilitate
  5800. XSLT processing.  The <kw role="element">mlabeledtr</kw> element can be
  5801. used to indicate the presence of a numbered equation, and the first
  5802. child can be changed to the current equation number, along with
  5803. incrementing the global equation number.  For cross references, an
  5804. id on either the mlabeledtr element or on the first element
  5805. itself could be used as a target of any link.</p>
  5806.  
  5807. <eg role='mathml'><![CDATA[
  5808. <mtable>
  5809.   <mlabeledtr id='e-is-m-c-square'>
  5810.     <mtd>
  5811.       <mtext> (2.1) </mtext>
  5812.     </mtd>
  5813.     <mtd>
  5814.      <mrow>
  5815.        <mi>E</mi>
  5816.        <mo>=</mo>
  5817.        <mrow>
  5818.         <mi>m</mi>
  5819.         <mo>⁢</mo>
  5820.         <msup>
  5821.          <mi>c</mi>
  5822.          <mn>2</mn>
  5823.         </msup>
  5824.        </mrow>
  5825.      </mrow>
  5826.     </mtd>
  5827.   </mlabeledtr>
  5828. </mtable>
  5829. ]]></eg>
  5830.  
  5831. <p>This should be rendered as:
  5832. <table width="100%">
  5833. <tbody>
  5834. <tr>
  5835. <td id="eqnoc1">     </td>
  5836. <td id="eqnoc2"><mi>E</mi> = <mi>m</mi><mi>c</mi><sup>2</sup></td> 
  5837. <td id="eqnoc3">(2.1)</td>
  5838. </tr>
  5839. </tbody>
  5840. </table>
  5841. </p>
  5842. </div4>
  5843. </div3>
  5844.  
  5845. <div3 id="presm_mtd"><head>Entry in Table or Matrix (<kw role="element">mtd</kw>)</head> 
  5846.  
  5847. <div4><head>Description</head>
  5848.  
  5849. <p>An <kw role="element">mtd</kw> element represents one entry, or cell, in a
  5850. table or matrix. An <kw role="element">mtd</kw> element is only
  5851. allowed as a direct sub-expression of an <kw role="element">mtr</kw>
  5852. or an <kw role="element">mlabeledtr</kw> element.</p>
  5853.  
  5854. <p>The <kw role="element">mtd</kw> element accepts any number of
  5855. arguments; if this number is not 1, its contents are treated as a single
  5856. <quote>inferred <kw role="element">mrow</kw></quote> formed from all its
  5857. arguments, as described in <specref ref="presm_reqarg"/>.</p>
  5858. </div4>
  5859.  
  5860. <div4 id="presm_mtdatts"><head>Attributes</head>
  5861. <table border="1">
  5862. <thead>
  5863. <tr>
  5864. <td>Name</td>
  5865. <td>values</td>
  5866. <td>default</td>
  5867. </tr>
  5868. </thead>
  5869. <tbody>
  5870. <tr>
  5871. <td>rowspan</td>
  5872. <td>number</td>
  5873. <td>1</td>
  5874. </tr>
  5875. <tr>
  5876. <td>columnspan</td>
  5877. <td>number</td>
  5878. <td>1</td>
  5879. </tr>
  5880. <tr>
  5881. <td>rowalign</td>
  5882. <td>top | bottom | center | baseline | axis</td>
  5883. <td>inherited</td>
  5884. </tr>
  5885. <tr>
  5886. <td>columnalign</td>
  5887. <td>left | center | right</td>
  5888. <td>inherited</td>
  5889. </tr>
  5890. <tr>
  5891. <td>groupalign</td>
  5892. <td>group-alignment-list</td>
  5893. <td>inherited</td>
  5894. </tr>
  5895. </tbody>
  5896. </table>
  5897.  
  5898. <p>The <kw role="attrib">rowspan</kw> and <kw role="attrib">columnspan</kw> attributes
  5899. allow a specific matrix element to be treated as if it occupied the
  5900. number of rows or columns specified. The interpretation of how this
  5901. larger element affects specifying subsequent rows and columns is meant
  5902. to correspond with the similar attributes for HTML 4.01 tables.</p>
  5903.  
  5904. <p>The <kw role="attrib">rowspan</kw> and <kw role="attrib">columnspan</kw> attributes
  5905. can be used around an <kw role="element">mtd</kw> element that represents
  5906. the label in a <kw role="element">mlabeledtr</kw> element.
  5907. Also, the label of a <kw role="element">mlabeledtr</kw> element is not
  5908. considered to be part of a previous <kw role="attrib">rowspan</kw> and
  5909. <kw role="attrib">columnspan</kw>.
  5910. </p>
  5911.  
  5912. <p>The <kw role="attrib">rowalign</kw> and <kw role="attrib">columnalign</kw> attributes
  5913. allow a specific matrix element to override the alignment specified by
  5914. a surrounding <kw role="element">mtable</kw> or <kw role="element">mtr</kw>
  5915. element.</p>
  5916.  
  5917. <p>The <kw role="attrib">groupalign</kw> attribute is described with the alignment
  5918. elements, <kw role="element">maligngroup</kw> and <kw role="element">malignmark</kw>,
  5919. in <specref ref="presm_malign"/>.</p>
  5920. </div4>
  5921. </div3>
  5922.  
  5923. <div3 id="presm_malign"><head>Alignment Markers</head>
  5924.  
  5925. <div4><head>Description</head>
  5926.  
  5927. <p>Alignment markers are space-like elements (see <specref
  5928. ref="presm_mspace"/>) that can be used 
  5929. to vertically align specified points within a column of MathML
  5930. expressions by the automatic insertion of the necessary amount of
  5931. horizontal space between specified sub-expressions.</p>
  5932.  
  5933. <p>The discussion that follows will use the example of a set of
  5934. simultaneous equations that should be rendered with vertical
  5935. alignment of the coefficients and variables of each term, by
  5936. inserting spacing somewhat like that shown here:
  5937. <eg><![CDATA[
  5938.     8.44x + 55  y =  0
  5939.     3.1 x -  0.7y = -1.1
  5940. ]]></eg>
  5941. If the example expressions shown above were arranged in a column
  5942. but not aligned, they would appear as:
  5943. <eg><![CDATA[
  5944.     8.44x + 55y = 0
  5945.     3.1x - 0.7y = -1.1
  5946. ]]></eg>
  5947. (For audio renderers, it is suggested that the alignment elements
  5948. produce the analogous behavior of altering the rhythm of pronunciation
  5949. so that it is the same for several sub-expressions in a column, by the
  5950. insertion of the appropriate time delays in place of the extra
  5951. horizontal spacing described here.)</p>
  5952.  
  5953. <p>The expressions whose parts are to be aligned (each equation, in the
  5954. example above) must be given as the table elements (i.e. as the <kw
  5955. role="element">mtd</kw> elements) of one column of an
  5956. <kw role="element">mtable</kw>. To avoid confusion, the term <quote>table
  5957. cell</quote> rather than <quote>table element</quote> will be used in the
  5958. remainder of this section.</p>
  5959.  
  5960. <p>All interactions between alignment elements are limited to the
  5961. <kw role="element">mtable</kw> column they arise in. That is, every
  5962. column of a table specified by an <kw role="element">mtable</kw> element
  5963. acts as an <quote>alignment scope</quote> that contains within it all alignment
  5964. effects arising from its contents. It also excludes any interaction
  5965. between its own alignment elements and the alignment elements inside
  5966. any nested alignment scopes it might contain.</p>
  5967.  
  5968. <p>The reason <kw role="element">mtable</kw> columns are used as
  5969. alignment scopes is that they are the only general way in MathML to
  5970. arrange expressions into vertical columns. Future versions of MathML
  5971. may provide an <kw role="element">malignscope</kw> element that allows
  5972. an alignment scope to be created around any MathML element, but even
  5973. then, table columns would still sometimes need to act as alignment
  5974. scopes, and since they are not elements themselves, but rather are
  5975. made from corresponding parts of the content of several
  5976. <kw role="element">mtr</kw> elements, they could not individually be the
  5977. content of an alignment scope element.</p>
  5978.  
  5979. <p>An <kw role="element">mtable</kw> element can be given the attribute
  5980. <kw role="attrib">alignmentscope</kw>=<kw role="attval">false</kw> to cause 
  5981. its columns not to act as alignment scopes. This is discussed further at
  5982. the end of this section. Otherwise, the discussion in this section assumes
  5983. that this attribute has its default value of <kw
  5984. role="attval">true</kw>.</p>
  5985. </div4>
  5986.  
  5987. <div4><head>Specifying alignment groups</head>
  5988.  
  5989. <p>To cause alignment, it is necessary to specify, within each
  5990. expression to be aligned, the points to be aligned with corresponding
  5991. points in other expressions, and the beginning of each <emph>alignment
  5992. group</emph> of sub-expressions that can be horizontally shifted as a
  5993. unit to effect the alignment. Each alignment group must contain one
  5994. alignment point. It is also necessary to specify which expressions in
  5995. the column have no alignment groups at all, but are affected only by
  5996. the ordinary column alignment for that column of the table, i.e. by
  5997. the <kw role="attrib">columnalign</kw> attribute, described elsewhere.</p>
  5998.  
  5999. <p>The alignment groups start at the locations of invisible
  6000. <kw role="element">maligngroup</kw> elements, which are rendered with
  6001. zero width when they occur outside of an alignment scope, but within
  6002. an alignment scope are rendered with just enough horizontal space to
  6003. cause the desired alignment of the alignment group that follows
  6004. them. A simple algorithm by which a MathML application can achieve this is given
  6005. later. In the example above, each equation would have one
  6006. <kw role="element">maligngroup</kw> element before each coefficient,
  6007. variable, and operator on the left-hand side, one before the
  6008. <code>=</code> sign, and one before the constant on the right-hand
  6009. side.</p>
  6010.  
  6011. <p>In general, a table cell containing <mi>n</mi>
  6012. <kw role="element">maligngroup</kw> elements contains <mi>n</mi>
  6013. alignment groups, with the <mi>i</mi>th group consisting of the
  6014. elements entirely after the <mi>i</mi>th
  6015. <kw role="element">maligngroup</kw> element and before the
  6016. (<mi>i</mi>+1)-th; no element within the table cell's content
  6017. should occur entirely before its first
  6018. <kw role="element">maligngroup</kw> element.</p>
  6019.  
  6020. <p>Note that the division into alignment groups does <emph>not</emph>
  6021. necessarily fit the nested expression structure of the MathML
  6022. expression containing the groups – that is, it is permissible for one
  6023. alignment group to consist of the end of one
  6024. <kw role="element">mrow</kw>, all of another one, and the beginning of a
  6025. third one, for example. This can be seen in the MathML markup for the
  6026. present example, given at the end of this section.</p>
  6027.  
  6028. <p>The nested expression structure formed by <kw role="element">mrow</kw>s
  6029. and other layout schemata should reflect the mathematical structure of the
  6030. expression, not the alignment-group structure, to make possible optimal
  6031. renderings and better automatic interpretations; see the discussion of
  6032. proper grouping in section <specref ref="presm_mrow"/>. Insertion of
  6033. alignment elements (or other space-like elements) should not alter the
  6034. correspondence between the structure of a MathML expression and the
  6035. structure of the mathematical expression it represents.</p>
  6036.  
  6037. <p>Although alignment groups need to coincide with the nested
  6038. expression structure of layout schemata, there are nonetheless
  6039. restrictions on where an <kw role="element">maligngroup</kw> element is
  6040. allowed within a table cell. The <kw role="element">maligngroup</kw>
  6041. element may only be contained within elements of the following types
  6042. (which are themselves contained in the table cell):
  6043. <ulist>
  6044. <item><p>an <kw role="element">mrow</kw> element, including an inferred
  6045. <kw role="element">mrow</kw> such as the one formed by a multi-argument
  6046. <kw role="element">mtd</kw> element;</p>
  6047. </item>
  6048.  
  6049. <item><p>an <kw role="element">mstyle</kw> element;</p>
  6050. </item>
  6051.  
  6052. <item><p>an <kw role="element">mphantom</kw> element;</p>
  6053. </item>
  6054.  
  6055. <item><p>an <kw role="element">mfenced</kw> element;</p>
  6056. </item>
  6057.  
  6058. <item><p>an <kw role="element">maction</kw> element, though only its
  6059. selected sub-expression is checked;</p>
  6060. </item>
  6061.  
  6062. <item><p>a <kw role="element">semantics</kw> element.</p>
  6063. </item> 
  6064. </ulist>
  6065. </p>
  6066.  
  6067. <p>These restrictions are intended to ensure that alignment can be
  6068. unambiguously specified, while avoiding complexities involving things
  6069. like overscripts, radical signs and fraction bars. They also ensure
  6070. that a simple algorithm suffices to accomplish the desired
  6071. alignment.</p>
  6072.  
  6073. <p>Note that some positions for an <kw role="element">maligngroup</kw>
  6074. element, although legal, are not useful, such as for an
  6075. <kw role="element">maligngroup</kw> element to be an argument of an
  6076. <kw role="element">mfenced</kw> element. When inserting an
  6077. <kw role="element">maligngroup</kw> element before a given element in
  6078. pre-existing MathML, it will often be necessary, and always
  6079. acceptable, to form a new <kw role="element">mrow</kw> element to contain
  6080. just the <kw role="element">maligngroup</kw> element and the element it
  6081. is inserted before. In general, this will be necessary except when the
  6082. <kw role="element">maligngroup</kw> element is inserted directly into an
  6083. <kw role="element">mrow</kw> or into an element that can form an
  6084. inferred <kw role="element">mrow</kw> from its contents. See the warning
  6085. about the legal grouping of <quote>space-like elements</quote> in 
  6086. <specref ref="presm_mspace"/>.</p>
  6087.  
  6088. <p>For the table cells that are divided into alignment groups, every
  6089. element in their content must be part of exactly one alignment group,
  6090. except the elements from the above list that contain
  6091. <kw role="element">maligngroup</kw> elements inside them, and the
  6092. <kw role="element">maligngroup</kw> elements themselves. This means
  6093. that, within any table cell containing alignment groups, the first
  6094. complete element must be an <kw role="element">maligngroup</kw> element,
  6095. though this may be preceded by the start tags of other elements.</p>
  6096.  
  6097. <p>This requirement removes a potential confusion about how to align
  6098. elements before the first <kw role="element">maligngroup</kw> element,
  6099. and makes it easy to identify table cells that are left out of their
  6100. column's alignment process entirely.</p>
  6101.  
  6102. <p>Note that it is not required that the table cells in a column that
  6103. are divided into alignment groups each contain the same number of
  6104. groups. If they don't, zero-width alignment groups are effectively
  6105. added on the right side of each table cell that has fewer groups than
  6106. other table cells in the same column.</p>
  6107. </div4>
  6108.  
  6109. <div4><head>Table cells that are not divided into alignment groups</head>
  6110.  
  6111. <p>Expressions in a column that are to have no alignment groups
  6112. should contain no <kw role="element">maligngroup</kw>
  6113. elements. Expressions with no alignment groups are aligned using only
  6114. the <kw role="attrib">columnalign</kw> attribute that applies to the table
  6115. column as a whole, and are not affected by the <kw role="attrib">groupalign</kw>
  6116. attribute described below. If such an expression is wider than the
  6117. column width needed for the table cells containing alignment groups,
  6118. all the table cells containing alignment groups will be shifted as a
  6119. unit within the column as described by the <kw role="attrib">columnalign</kw>
  6120. attribute for that column. For example, a column heading with no
  6121. internal alignment could be added to the column of two equations given
  6122. above by preceding them with another table row containing an
  6123. <kw role="element">mtext</kw> element for the heading, and using the
  6124. default <kw role="attrib">columnalign</kw>="center" for the table, to
  6125. produce:
  6126. <eg><![CDATA[
  6127. equations with aligned variables
  6128.       8.44x + 55  y =  0
  6129.       3.1 x -  0.7y = -1.1
  6130. ]]></eg>
  6131. or, with a shorter heading,
  6132. <eg><![CDATA[
  6133.    some equations
  6134. 8.44x + 55  y =  0
  6135. 3.1 x -  0.7y = -1.1
  6136. ]]></eg>
  6137. </p>
  6138. </div4>
  6139.  
  6140. <div4><head>Specifying alignment points using <kw role="element">malignmark</kw></head>
  6141.  
  6142. <p>Each alignment group's alignment point can either be specified by
  6143. an <kw role="element">malignmark</kw> element anywhere within the
  6144. alignment group (except within another alignment scope wholly
  6145. contained inside it), or it is determined automatically from the
  6146. <kw role="attrib">groupalign</kw> attribute. The <kw role="attrib">groupalign</kw>
  6147. attribute can be specified on the group's preceding
  6148. <kw role="element">maligngroup</kw> element or on its surrounding
  6149. <kw role="element">mtd</kw>, <kw role="element">mtr</kw>, or
  6150. <kw role="element">mtable</kw> elements. In typical cases, using the
  6151. <kw role="attrib">groupalign</kw> attribute is sufficient to describe the
  6152. desired alignment points, so no <kw role="element">malignmark</kw>
  6153. elements need to be provided.</p>
  6154.  
  6155. <p>The <kw role="element">malignmark</kw> element indicates that the
  6156. alignment point should occur on the right edge of the preceding
  6157. element, or the left edge of the following element or character,
  6158. depending on the <kw role="attrib">edge</kw> attribute of
  6159. <kw role="element">malignmark</kw>. Note that it may be necessary to
  6160. introduce an <kw role="element">mrow</kw> to group an
  6161. <kw role="element">malignmark</kw> element with a neighboring element,
  6162. in order not to alter the argument count of the containing
  6163. element. (See the warning about the legal grouping of <quote>space-like
  6164. elements</quote> in <specref ref="presm_mspace"/>).</p>
  6165.  
  6166. <p>When an <kw role="element">malignmark</kw> element is provided within an
  6167. alignment group, it can occur in an arbitrarily deeply nested element
  6168. within the group, as long as it is not within a nested alignment scope. It
  6169. is not subject to the same restrictions on location as <kw
  6170. role="element">maligngroup</kw> elements. However, its immediate
  6171. surroundings need to be such that the element to its immediate right or
  6172. left (depending on its <kw role="attrib">edge</kw> attribute) can be
  6173. unambiguously identified. If no such element is present, renderers should
  6174. behave as if a zero-width element had been inserted there.</p>
  6175.  
  6176. <p>For the purposes of alignment, an element X is considered to be to the
  6177. immediate left of an element Y, and Y to the immediate right of X, whenever
  6178. X and Y are successive arguments of one (possibly inferred) <kw
  6179. role="element">mrow</kw> element, with X coming before Y. In the case of
  6180. <kw role="element">mfenced</kw> elements, MathML applications should evaluate this
  6181. relation as if the <kw role="element">mfenced</kw> element had been
  6182. replaced by the equivalent expanded form involving <kw
  6183. role="element">mrow</kw>. Similarly, an <kw role="element">maction</kw>
  6184. element should be treated as if it were replaced by its currently selected
  6185. sub-expression. In all other cases, no relation of <quote>to the immediate
  6186. left or right</quote> is defined for two elements X and Y. However, in the
  6187. case of content elements interspersed in presentation markup, MathML applications
  6188. should attempt to evaluate this relation in a sensible way. For example, if
  6189. a renderer maintains an internal presentation structure for rendering
  6190. content elements, the relation could be evaluated with respect to
  6191. that. (See <specref ref="contm"/> and <specref ref="mixing"/> for further
  6192. details about mixing presentation and content markup.)</p>
  6193.  
  6194. <p>Unlike all other elements in MathML,
  6195. <kw role="element">malignmark</kw> elements are allowed to occur within
  6196. the content of token elements, such as <kw role="element">mn</kw>,
  6197. <kw role="element">mi</kw>, or <kw role="element">mtext</kw>. When this
  6198. occurs, the character immediately before or after the
  6199. <kw role="element">malignmark</kw> element will carry the alignment
  6200. point; in all other cases, the element to its immediate left or right
  6201. will carry the alignment point. The rationale for this is that it is
  6202. sometimes desirable to align on the edges of specific characters
  6203. within multi-character token elements.</p>
  6204.  
  6205. <p>If there is more than one <kw role="element">malignmark</kw> element
  6206. in an alignment group, all but the first one will be ignored. MathML
  6207. applications may wish to provide a mode in which they will warn about
  6208. this situation, but it is not an error, and should trigger no warnings
  6209. by default. (Rationale: it would be inconvenient to have to remove all
  6210. unnecessary <kw role="element">malignmark</kw> elements from
  6211. automatically generated data, in certain cases, such as when they are
  6212. used to specify alignment on <quote>decimal points</quote> other than the '.' 
  6213. character.)</p>
  6214. </div4>
  6215.  
  6216. <div4><head>Attributes</head>
  6217. <p>In addition to the attributes listed below, the <kw
  6218. role="element">malignmark</kw> element permits
  6219. <kw role="attrib">id</kw>,
  6220. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  6221. <kw role="attrib">style</kw> attributes,
  6222. as described in <specref ref="fund_globatt"/>.</p>
  6223. <table border="1">
  6224. <thead>
  6225. <tr>
  6226. <td>Name</td>
  6227. <td>values</td>
  6228. <td>default</td>
  6229. </tr>
  6230. </thead>
  6231. <tbody>
  6232. <tr>
  6233. <td>edge</td>
  6234. <td>left | right</td>
  6235. <td>left</td>
  6236. </tr>
  6237. </tbody>
  6238. </table>
  6239.  
  6240. <p><kw role="element">malignmark</kw> has one attribute,
  6241. <kw role="attrib">edge</kw>, which specifies whether the alignment point will be
  6242. found on the left or right edge of some element or character. The
  6243. precise location meant by <quote>left edge</quote> or <quote>right edge</quote> is discussed
  6244. below. If <kw role="attrib">edge</kw>="right", the alignment point is the right
  6245. edge of the element or character to the immediate left of the
  6246. <kw role="element">malignmark</kw> element. If <kw role="attrib">edge</kw>="left",
  6247. the alignment point is the left edge of the element or character to
  6248. the immediate right of the <kw role="element">malignmark</kw>
  6249. element. Note that the attribute refers to the choice of edge rather
  6250. than to the direction in which to look for the element whose edge will
  6251. be used.</p>
  6252.  
  6253. <p>For <kw role="element">malignmark</kw> elements that occur within
  6254. the content of MathML token elements, the preceding or following
  6255. character in the token element's content is used; if there is no such
  6256. character, a zero-width character is effectively inserted for the
  6257. purpose of carrying the alignment point on its edge. For all other
  6258. <kw role="element">malignmark</kw> elements, the preceding or following
  6259. element is used; if there is no such element, a zero-width element is
  6260. effectively inserted to carry the alignment point.</p>
  6261.  
  6262. <p>The precise definition of the <quote>left edge</quote> or <quote>right edge</quote> of a
  6263. character or glyph (e.g. whether it should coincide with an edge of
  6264. the character's bounding box) is not specified by MathML, but is at
  6265. the discretion of the renderer; the renderer is allowed to let the
  6266. edge position depend on the character's context as well as on the
  6267. character itself.</p>
  6268.  
  6269. <p>For proper alignment of columns of numbers (using <kw
  6270. role="attrib">groupalign</kw> values of <kw role="attval">left</kw>, <kw
  6271. role="attval">right</kw>, or <kw role="attval">decimalpoint</kw>), it is
  6272. likely to be desirable for the effective width (i.e. the distance between
  6273. the left and right edges) of decimal digits to be constant, even if their
  6274. bounding box widths are not constant (e.g. if <quote>1</quote> is narrower
  6275. than other digits). For other characters, such as letters and operators, it
  6276. may be desirable for the aligned edges to coincide with the bounding
  6277. box.</p>
  6278.  
  6279. <p>The <quote>left edge</quote> of a MathML element or alignment group
  6280. refers to the left edge of the leftmost glyph drawn to render the element
  6281. or group, except that explicit space represented by <kw
  6282. role="element">mspace</kw> or <kw role="element">mtext</kw> elements
  6283. should also count as <quote>glyphs</quote> in this context, as should
  6284. glyphs that would be drawn if not for <kw role="element">mphantom</kw>
  6285. elements around them. The <quote>right edge</quote> of an element or
  6286. alignment group is defined similarly.</p>
  6287. </div4>
  6288.  
  6289. <div4><head>Attributes</head>
  6290. <p>In addition to the attributes listed below, the <kw
  6291. role="element">malignmark</kw> element permits
  6292. <kw role="attrib">id</kw>,
  6293. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  6294. <kw role="attrib">style</kw> attributes,
  6295. as described in <specref ref="fund_globatt"/>.</p>
  6296. <table border="1">
  6297. <thead>
  6298. <tr>
  6299. <td>Name</td>
  6300. <td>values</td>
  6301. <td>default</td>
  6302. </tr>
  6303. </thead>
  6304. <tbody>
  6305. <tr>
  6306. <td>groupalign</td>
  6307. <td>left | center | right | decimalpoint</td>
  6308. <td>inherited</td>
  6309. </tr>
  6310. </tbody>
  6311. </table>
  6312.  
  6313. <p><kw role="element">maligngroup</kw> has one attribute,
  6314. <kw role="attrib">groupalign</kw>, which is used to determine the position of
  6315. its group's alignment point when no <kw role="element">malignmark</kw>
  6316. element is present. The following discussion assumes that no
  6317. <kw role="element">malignmark</kw> element is found within a group.</p>
  6318.  
  6319. <p>In the example given at the beginning of this section, there is one
  6320. column of 2 table cells, with 7 alignment groups in each table cell;
  6321. thus there are 7 columns of alignment groups, with 2 groups, one above
  6322. the other, in each column. These columns of alignment groups should be
  6323. given the 7 <kw role="attrib">groupalign</kw> values <quote>decimalpoint left left
  6324. decimalpoint left left decimalpoint</quote>, in that order. How to specify
  6325. this list of values for a table cell or table column as a whole, using
  6326. attributes on elements surrounding the
  6327. <kw role="element">maligngroup</kw> element is described later.</p>
  6328.  
  6329. <p>If <kw role="attrib">groupalign</kw> is <quote>left</quote>,
  6330. <quote>right</quote>, or <quote>center</quote>, the alignment point is
  6331. defined to be at the group's left edge, at its right edge, or halfway
  6332. between these edges, respectively. The meanings of <quote>left edge</quote>
  6333. and <quote>right edge</quote> are as discussed above in relation to <kw
  6334. role="element">malignmark</kw>.</p>
  6335.  
  6336. <p>If <kw role="attrib">groupalign</kw> is <quote>decimalpoint</quote>, 
  6337. the alignment point is the right edge of the last character before the
  6338. decimal point. The decimal point is the first <quote>.</quote> character
  6339. (ASCII 0x2e) in the first <kw role="element">mn</kw> element found along
  6340. the alignment group's baseline. More precisely, the alignment group is
  6341. scanned recursively, depth-first, for the first <kw role="element">mn</kw>
  6342. element, descending into all arguments of each element of the types
  6343. <kw role="element">mrow</kw> (including inferred
  6344. <kw role="element">mrow</kw>s), <kw role="element">mstyle</kw>,
  6345. <kw role="element">mpadded</kw>, <kw role="element">mphantom</kw>,
  6346. <kw role="element">mfenced</kw>, or <kw role="element">msqrt</kw>,
  6347. descending into only the first argument of each <quote>scripting</quote> element
  6348. (<kw role="element">msub</kw>, <kw role="element">msup</kw>,
  6349. <kw role="element">msubsup</kw>, <kw role="element">munder</kw>,
  6350. <kw role="element">mover</kw>, <kw role="element">munderover</kw>,
  6351. <kw role="element">mmultiscripts</kw>) or of each
  6352. <kw role="element">mroot</kw> or <kw role="element">semantics</kw> element,
  6353. descending into only the selected sub-expression of each
  6354. <kw role="element">maction</kw> element, and skipping the content of all
  6355. other elements. The first <kw role="element">mn</kw> so found always
  6356. contains the alignment point, which is the right edge of the last
  6357. character before the first decimal point in the content of the
  6358. <kw role="element">mn</kw> element. If there is no decimal point in the
  6359. <kw role="element">mn</kw> element, the alignment point is the right edge
  6360. of the last character in the content. If the decimal point is the
  6361. first character of the <kw role="element">mn</kw> element's content, the
  6362. right edge of a zero-width character inserted before the decimal point
  6363. is used. If no <kw role="element">mn</kw> element is found, the right
  6364. edge of the entire alignment group is used (as for
  6365. <kw role="attrib">groupalign</kw>="right").</p>
  6366.  
  6367. <p>In order to permit alignment on decimal points in
  6368. <kw role="element">cn</kw> elements, a MathML application can convert a
  6369. content expression into a presentation expression that renders the
  6370. same way before searching for decimal points as described above.</p>
  6371.  
  6372. <p>If characters other than <quote>.</quote> should be used as
  6373. <quote>decimal points</quote> for alignment, they should be preceded by <kw
  6374. role="element">malignmark</kw> elements within the <kw
  6375. role="element">mn</kw> token's content itself.</p>
  6376.  
  6377. <p>For any of the <kw role="attrib">groupalign</kw> values, if an explicit
  6378. <kw role="element">malignmark</kw> element is present anywhere within
  6379. the group, the position it specifies (described earlier) overrides the
  6380. automatic determination of alignment point from the
  6381. <kw role="attrib">groupalign</kw> value.</p>
  6382. </div4>
  6383.  
  6384. <div4><head>Inheritance of <kw role="attrib">groupalign</kw> values</head>
  6385.  
  6386. <p>It is not usually necessary to put a <kw role="attrib">groupalign</kw>
  6387. attribute on every <kw role="element">maligngroup</kw> element. Since
  6388. this attribute is usually the same for every group in a column of
  6389. alignment groups to be aligned, it can be inherited from an attribute
  6390. on the <kw role="element">mtable</kw> that was used to set up the
  6391. alignment scope as a whole, or from the <kw role="element">mtr</kw> or
  6392. <kw role="element">mtd</kw> elements surrounding the alignment group. It
  6393. is inherited via an <quote>inheritance path</quote> that proceeds from
  6394. <kw role="element">mtable</kw> through successively contained
  6395. <kw role="element">mtr</kw>, <kw role="element">mtd</kw>, and
  6396. <kw role="element">maligngroup</kw> elements. There is exactly one
  6397. element of each of these kinds in this path from an
  6398. <kw role="element">mtable</kw> to any alignment group inside it.  In
  6399. general, the value of <kw role="attrib">groupalign</kw> will be 
  6400. inherited by any given alignment group from the innermost element
  6401. that surrounds the alignment group and provides an explicit
  6402. setting for this attribute.</p>
  6403.  
  6404. <p>Note, however, that each <kw role="element">mtd</kw> element needs, in
  6405. general, a list of <kw role="attrib">groupalign</kw> values, one for each
  6406. <kw role="element">maligngroup</kw> element inside it, rather than just
  6407. a single value. Furthermore, an <kw role="element">mtr</kw> or
  6408. <kw role="element">mtable</kw> element needs, in general, a list of lists
  6409. of <kw role="attrib">groupalign</kw> values, since it spans multiple
  6410. <kw role="element">mtable</kw> columns, each potentially acting as an
  6411. alignment scope. Such lists of group-alignment values are specified
  6412. using the following syntax rules:
  6413. <!-- TODO: use appropriate element for syntax rules here -->
  6414. <eg>
  6415. group-alignment            := left | right | center | decimalpoint
  6416. group-alignment-list       := group-alignment +
  6417. group-alignment-list-list := ( '{' group-alignment-list '}' ) +
  6418. </eg>
  6419. </p>
  6420.  
  6421. <p>As described in <specref ref="fund_attval"/>, <code>|</code> separates
  6422. alternatives; <code>+</code> represents optional repetition (i.e. 1 or
  6423. more copies of what precedes it), with extra values ignored and the
  6424. last value repeated if necessary to cover additional table columns or
  6425. alignment group columns; <code>'{'</code> and <code>'}'</code>
  6426. represent literal braces; and <code>(</code> and <code>)</code> are
  6427. used for grouping, but do not literally appear in the attribute
  6428. value.</p>
  6429.  
  6430. <p>The permissible values of the <kw role="attrib">groupalign</kw> attribute of the
  6431. elements that have this attribute are specified using the above
  6432. syntax definitions as follows:
  6433. <table border="1">
  6434. <thead>
  6435. <tr>
  6436. <td>Element type</td>
  6437. <td>groupalign attribute syntax</td>
  6438. <td>default value</td>
  6439. </tr>
  6440. </thead>
  6441. <tbody>
  6442. <tr>
  6443. <td><kw role="element">mtable</kw></td>
  6444. <td>group-alignment-list-list</td>
  6445. <td>{left}</td>
  6446. </tr>
  6447. <tr>
  6448. <td><kw role="element">mtr</kw></td>
  6449. <td>group-alignment-list-list</td>
  6450. <td>inherited from <kw role="element">mtable</kw> attribute</td>
  6451. </tr>
  6452. <tr>
  6453. <td><kw role="element">mtd</kw></td>
  6454. <td>group-alignment-list</td>
  6455. <td>inherited from within <kw role="element">mtr</kw> attribute</td>
  6456. </tr>
  6457. <tr>
  6458. <td><kw role="element">maligngroup</kw></td>
  6459. <td>group-alignment</td>
  6460. <td>inherited from within <kw role="element">mtd</kw> attribute</td>
  6461. </tr>
  6462. </tbody>
  6463. </table>
  6464. </p>
  6465.  
  6466. <p>In the example near the beginning of this section, the group
  6467. alignment values could be specified on every <kw role="element">mtd</kw>
  6468. element using <kw role="attrib">groupalign</kw> = <quote>decimalpoint left left
  6469. decimalpoint left left decimalpoint</quote>, or on every
  6470. <kw role="element">mtr</kw> element using <kw role="attrib">groupalign</kw> =
  6471. <quote>{decimalpoint left left decimalpoint left left decimalpoint}</quote>, or
  6472. (most conveniently) on the <kw role="element">mtable</kw> as a whole
  6473. using <kw role="attrib">groupalign</kw> = <quote>{decimalpoint left left decimalpoint
  6474. left left decimalpoint}</quote>, which provides a single braced list of
  6475. group-alignment values for the single column of expressions to be
  6476. aligned.</p>
  6477. </div4>
  6478.  
  6479. <div4><head>MathML representation of an alignment example</head>
  6480.  
  6481. <p>The above rules are sufficient to explain the MathML representation
  6482. of the example given near the start of this section. 
  6483. To repeat the example, the desired rendering is:
  6484. <eg><![CDATA[
  6485.     8.44x + 55  y =  0
  6486.     3.1 x -  0.7y = -1.1
  6487. ]]></eg>
  6488. </p>
  6489.  
  6490. <p>One way to represent that in MathML is:
  6491. <eg role='mathml'><![CDATA[
  6492. <mtable groupalign="decimalpoint left left decimalpoint left left decimalpoint">
  6493.   <mtr>
  6494.     <mtd>
  6495.       <mrow>
  6496.         <mrow>
  6497.           <mrow>
  6498.             <maligngroup/>
  6499.             <mn> 8.44 </mn>
  6500.             <mo> ⁢ </mo>
  6501.             <maligngroup/>
  6502.             <mi> x </mi>
  6503.           </mrow>
  6504.           <maligngroup/>
  6505.           <mo> + </mo>
  6506.           <mrow>
  6507.             <maligngroup/>
  6508.             <mn> 55 </mn>
  6509.             <mo> ⁢ </mo>
  6510.             <maligngroup/>
  6511.             <mi> y </mi>
  6512.           </mrow>
  6513.         </mrow>
  6514.       <maligngroup/>
  6515.       <mo> = </mo>
  6516.       <maligngroup/>
  6517.       <mn> 0 </mn>
  6518.     </mrow>
  6519.     </mtd>
  6520.     <mtd>
  6521.       <mrow>
  6522.         <mrow>
  6523.           <mrow>
  6524.             <maligngroup/>
  6525.             <mn> 3.1 </mn>
  6526.             <mo> ⁢ </mo>
  6527.             <maligngroup/>
  6528.             <mi> x </mi>
  6529.           </mrow>
  6530.           <maligngroup/>
  6531.           <mo> - </mo>
  6532.           <mrow>
  6533.             <maligngroup/>
  6534.             <mn> 0.7 </mn>
  6535.             <mo> ⁢ </mo>
  6536.             <maligngroup/>
  6537.             <mi> y </mi>
  6538.           </mrow>
  6539.         </mrow>
  6540.         <maligngroup/>
  6541.         <mo> = </mo>
  6542.         <maligngroup/>
  6543.         <mrow>
  6544.           <mo> - </mo>
  6545.           <mn> 1.1 </mn>
  6546.         </mrow>
  6547.       </mrow>
  6548.     </mtd>
  6549.   </mtr>
  6550. </mtable>
  6551. ]]></eg>
  6552. </p>
  6553. </div4>
  6554.  
  6555. <div4><head>Further details of alignment elements</head>
  6556.  
  6557. <p>The alignment elements <kw role="element">maligngroup</kw> and
  6558. <kw role="element">malignmark</kw> can occur outside of alignment
  6559. scopes, where they are ignored. The rationale behind this is that in
  6560. situations in which MathML is generated, or copied from another
  6561. document, without knowing whether it will be placed inside an
  6562. alignment scope, it would be inconvenient for this to be an error.</p>
  6563.  
  6564. <p>An <kw role="element">mtable</kw> element can be given the attribute <kw
  6565. role="attrib">alignmentscope</kw>=<kw role="attval">false</kw> to cause its
  6566. columns not to act as alignment scopes. In general, this attribute has the
  6567. syntax <code>(true | false) +</code>; if its value is a list of boolean
  6568. values, each boolean value applies to one column, with the last value
  6569. repeated if necessary to cover additional columns, or with extra values
  6570. ignored. Columns that are not alignment scopes are part of the alignment
  6571. scope surrounding the <kw role="element">mtable</kw> element, if there is
  6572. one. Use of <kw role="attrib">alignmentscope</kw>=<kw
  6573. role="attval">false</kw> allows nested tables to contain <kw
  6574. role="element">malignmark</kw> elements for aligning the inner table in the
  6575. surrounding alignment scope.</p>
  6576.  
  6577. <p>As discussed above, processing of alignment for content elements is
  6578. not well-defined, since MathML does not specify how content elements
  6579. should be rendered. However, many MathML applications are likely to find it
  6580. convenient to internally convert content elements to presentation
  6581. elements that render the same way. Thus, as a general rule, even if a
  6582. renderer does not perform such conversions internally, it is
  6583. recommended that the alignment elements should be processed as if it
  6584. did perform them.</p>
  6585.  
  6586. <p>A particularly important case for renderers to handle gracefully is the
  6587. interaction of alignment elements with the <kw role="element">matrix</kw>
  6588. content element, since this element may or may not be internally converted
  6589. to an expression containing an <kw role="element">mtable</kw> element for
  6590. rendering. To partially resolve this ambiguity, it is suggested, but not
  6591. required, that if the <kw role="element">matrix</kw> element is converted
  6592. to an expression involving an <kw role="element">mtable</kw> element, that
  6593. the <kw role="element">mtable</kw> element be given the attribute <kw
  6594. role="attrib">alignmentscope</kw>=<kw role="attval">false</kw>, which will
  6595. make the interaction of the <kw role="element">matrix</kw> element with the
  6596. alignment elements no different than that of a generic presentation element
  6597. (in particular, it will allow it to contain <kw
  6598. role="element">malignmark</kw> elements that operate within the alignment
  6599. scopes created by the columns of an <kw role="element">mtable</kw> that
  6600. contains the <kw role="element">matrix</kw> element in one of its table
  6601. cells).</p>
  6602.  
  6603. <p>The effect of alignment elements within table cells that have
  6604. non-default values of the <kw role="attrib">columnspan</kw> or <kw
  6605. role="attrib">rowspan</kw> attributes is not specified, except that such
  6606. use of alignment elements is not an error. Future versions of MathML may
  6607. specify the behavior of alignment elements in such table cells.</p>
  6608.  
  6609. <p>The effect of possible linebreaking of an <kw role="element">mtable</kw>
  6610. element on the alignment elements is not specified.</p>
  6611. </div4>
  6612.  
  6613. <div4><head>A simple alignment algorithm</head>
  6614.  
  6615. <p>A simple algorithm by which a MathML application can perform the
  6616. alignment specified in this section is given here. Since the alignment
  6617. specification is deterministic (except for the definition of the left
  6618. and right edges of a character), any correct MathML alignment
  6619. algorithm will have the same behavior as this one. Each
  6620. <kw role="element">mtable</kw> column (alignment scope) can be treated
  6621. independently; the algorithm given here applies to one
  6622. <kw role="element">mtable</kw> column, and takes into account the
  6623. alignment elements, the <kw role="attrib">groupalign</kw> attribute described in
  6624. this section, and the <kw role="attrib">columnalign</kw> attribute described
  6625. under <kw role="element">mtable</kw> (<specref
  6626. ref="presm_mtable"/>).</p>
  6627.  
  6628. <p>First, a rendering is computed for the contents of each table cell
  6629. in the column, using zero width for all
  6630. <kw role="element">maligngroup</kw> and <kw role="element">malignmark</kw>
  6631. elements. The final rendering will be identical except for horizontal
  6632. shifts applied to each alignment group and/or table cell. The
  6633. positions of alignment points specified by any
  6634. <kw role="element">malignmark</kw> elements are noted, and the remaining
  6635. alignment points are determined using <kw role="attrib">groupalign</kw>
  6636. values.</p>
  6637.  
  6638. <p>For each alignment group, the horizontal positions of the left
  6639. edge, alignment point, and right edge are noted, allowing the width of
  6640. the group on each side of the alignment point (left and right) to be
  6641. determined. The sum of these two <quote>side-widths</quote>, i.e. the sum of the
  6642. widths to the left and right of the alignment point, will equal the
  6643. width of the alignment group.</p>
  6644.  
  6645. <p>Second, each column of alignment groups, from left to right, is
  6646. scanned. The <mi>i</mi>th scan covers the <mi>i</mi>th
  6647. alignment group in each table cell containing any alignment
  6648. groups. Table cells with no alignment groups, or with fewer than
  6649. <mi>i</mi> alignment groups, are ignored. Each scan computes two
  6650. maximums over the alignment groups scanned: the maximum width to the
  6651. left of the alignment point, and the maximum width to the right of the
  6652. alignment point, of any alignment group scanned.</p>
  6653.  
  6654. <p>The sum of all the maximum widths computed (two for each column of
  6655. alignment groups) gives one total width, which will be the width of
  6656. each table cell containing alignment groups. Call the maximum number
  6657. of alignment groups in one cell <mi>n</mi>; each such cell's width
  6658. is divided into 2<mi>n</mi> adjacent sections, called
  6659. L(<mi>i</mi>) and R(<mi>i</mi>) for <mi>i</mi> from 1 to
  6660. <mi>n</mi>, using the 2<mi>n</mi> maximum side-widths computed
  6661. above; for each <mi>i</mi>, the width of all sections called
  6662. L(<mi>i</mi>) is the maximum width of any cell's <mi>i</mi>th
  6663. alignment group to the left of its alignment point, and the width of
  6664. all sections called R(<mi>i</mi>) is the maximum width of any
  6665. cell's <mi>i</mi>th alignment group to the right of its alignment
  6666. point.</p>
  6667.  
  6668. <p>The alignment groups are then positioned in the unique way that
  6669. places the part of each <mi>i</mi>th group to the left of its
  6670. alignment point in a section called L(<mi>i</mi>), and places the
  6671. part of each <mi>i</mi>th group to the right of its alignment
  6672. point in a section called R(<mi>i</mi>). This results in the
  6673. alignment point of each <mi>i</mi>th group being on the boundary
  6674. between adjacent sections L(<mi>i</mi>) and R(<mi>i</mi>), so
  6675. that all alignment points of <mi>i</mi>th groups have the same
  6676. horizontal position.</p>
  6677.  
  6678. <p>The widths of the table cells that contain no alignment groups
  6679. were computed as part of the initial rendering, and may be different
  6680. for each cell, and different from the single width used for cells
  6681. containing alignment groups. The maximum of all the cell widths (for
  6682. both kinds of cells) gives the width of the table column as a
  6683. whole.</p>
  6684.  
  6685. <p>The position of each cell in the column is determined by the
  6686. applicable part of the value of the <kw role="attrib">columnalign</kw> attribute
  6687. of the innermost surrounding <kw role="element">mtable</kw>,
  6688. <kw role="element">mtr</kw>, or <kw role="element">mtd</kw> element that
  6689. has an explicit value for it, as described in the sections on those
  6690. elements. This may mean that the cells containing alignment groups
  6691. will be shifted within their column, in addition to their alignment
  6692. groups having been shifted within the cells as described above, but
  6693. since each such cell has the same width, it will be shifted the same
  6694. amount within the column, thus maintaining the vertical alignment of
  6695. the alignment points of the corresponding alignment groups in each
  6696. cell.</p>
  6697. </div4>
  6698. </div3>
  6699.  
  6700. </div2>
  6701.  
  6702. <div2 id="presm_enliven"><head>Enlivening Expressions</head>
  6703.  
  6704. <div3 id="presm_maction"><head>Bind Action to Sub-Expression (<kw role="element">maction</kw>)</head>
  6705.  
  6706. <p>There are many ways in which it might be desirable to make
  6707. mathematical content active.  Adding a link to a MathML sub-expression
  6708. is one basic kind of interactivity.  See <specref ref="interf_link"/>.
  6709. However, many other kinds of interactivity cannot be easily
  6710. accommodated by generic linking mechanisms.  For example, in lengthy
  6711. mathematical expressions, the ability to <quote>fold</quote>
  6712. expressions might be provided, i.e. a renderer might allow a reader to
  6713. toggle between an ellipsis and a much longer expression that it
  6714. represents.</p>
  6715.  
  6716. <p>To provide a mechanism for binding actions to expressions, MathML
  6717. provides the <kw role="element">maction</kw> element. This element accepts any
  6718. number of sub-expressions as arguments.</p>
  6719. <div4><head>Attributes</head>
  6720. <p>In addition to the attributes listed below, this element permits
  6721. <kw role="attrib">id</kw>,
  6722. <kw role="attrib">xref</kw>, <kw role="attrib">class</kw> and
  6723. <kw role="attrib">style</kw> attributes,
  6724. as described in <specref ref="fund_globatt"/>.
  6725. <table border="1">
  6726. <thead>
  6727. <tr>
  6728. <td>Name</td>
  6729. <td>values</td>
  6730. <td>default</td>
  6731. </tr>
  6732. </thead>
  6733. <tbody>
  6734. <tr>
  6735. <td>actiontype</td>
  6736. <td>(described below)</td>
  6737. <td>(required attribute, no default value)</td>
  6738. </tr>
  6739. <tr>
  6740. <td>selection</td>
  6741. <td>positive-integer</td>
  6742. <td>1</td>
  6743. </tr>
  6744. </tbody>
  6745. </table>
  6746. </p>
  6747.  
  6748. <p>By default, MathML applications that do not recognize the specified
  6749. <kw role="attrib">actiontype</kw> should render the selected sub-expression as
  6750. defined below. If no selected sub-expression exists, it is a MathML
  6751. error; the appropriate rendering in that case is as described in
  6752. <specref ref="interf_error"/>.</p>
  6753.  
  6754. <p>Since a MathML-compliant application is not required to recognize any
  6755. particular <kw role="attrib">actiontype</kw>s, an application can be fully MathML
  6756. compliant just by implementing the above-described default behavior.</p>
  6757.  
  6758. <p>The <kw role="attrib">selection</kw> attribute is provided for those
  6759. <kw role="attrib">actiontype</kw>s that permit someone viewing a document to select one of
  6760. several sub-expressions for viewing. Its value should be a positive
  6761. integer that indicates one of the sub-expressions of the
  6762. <kw role="element">maction</kw> element, numbered from 1 to the number of
  6763. children of the element. When this is the case, the sub-expression so
  6764. indicated is defined to be the <quote>selected sub-expression</quote> of the
  6765. <kw role="element">maction</kw> element; otherwise the <quote>selected
  6766. sub-expression</quote> does not exist, which is an error. When the
  6767. <kw role="attrib">selection</kw> attribute is not specified (including for
  6768. actiontypes for which it makes no sense), its default value is 1, so
  6769. the selected sub-expression will be the first sub-expression.</p>
  6770.  
  6771. <!-- 
  6772. <p>Note that the <kw role="attrib">selection</kw> attribute of an
  6773. <kw role="element">maction</kw> element affects not only the rendering of
  6774. the element itself, but potentially the rendering of elements
  6775. containing it; this can be due either to the reference to an
  6776. <kw role="element">maction</kw>'s selected sub-expression in the
  6777. definition of embellished operator in <specref ref="presm_mo"/>, or to alignment
  6778. elements contained in the selected sub-expression (<specref
  6779. ref="presm_malign"/>). This means that a change of the selection
  6780. by the viewer may require a rerendering of the surroundings, not just
  6781. their repositioning due to a change in size of the
  6782. <kw role="element">maction</kw> element itself.</p>
  6783. -->
  6784.  
  6785. <p>Furthermore, as described in <specref ref="interf"/>, if a MathML
  6786. application responds to a user command to copy a MathML sub-expression to
  6787. the environment's <quote>clipboard</quote>, any <kw
  6788. role="element">maction</kw> elements present in what is copied should
  6789. be given selection attributes that correspond to their selection
  6790. state in the MathML rendering at the time of the copy command.</p>
  6791.  
  6792. <p>A suggested list of <kw role="attrib">actiontype</kw>s and their associated
  6793. actions is given below. Keep in mind, however, that this list is
  6794. mainly for illustration, and recognized values and behaviors will vary
  6795. from application to application.
  6796. <glist>
  6797. <gitem>
  6798. <label><maction actiontype="toggle" selection="positive-integer" > (first expression) (second expression)... </maction></label>
  6799. <def><p>For this action type, a renderer would alternately display the
  6800. given expressions, cycling through them when a reader clicked on the
  6801. active expression, starting with the selected expression and updating
  6802. the <kw role="attrib">selection</kw> attribute value as described above.
  6803. Typical uses would be for exercises in education, ellipses in long
  6804. computer algebra output, or to illustrate alternate notations. Note
  6805. that the expressions may be of significantly different size, so that
  6806. size negotiation with the browser may be desirable. If size
  6807. negotiation is not available, scrolling, elision, panning, or some
  6808. other method may be necessary to allow full viewing.</p></def>
  6809. </gitem>
  6810.  
  6811. <gitem><label><maction actiontype="statusline"> (expression) (message) </maction></label>
  6812. <def><p>In this case, the renderer would display the expression in
  6813. context on the screen. When a reader clicked on the expression or
  6814. moved the mouse over it, the renderer would send a rendering of the
  6815. message to the browser statusline. Since most browsers in the
  6816. foreseeable future are likely to be limited to displaying text on their
  6817. statusline, authors would presumably use plain text in an 
  6818. <kw role="element">mtext</kw> element for the message in most circumstances. 
  6819. For non-<kw role="element">mtext</kw> messages, renderers might provide a
  6820. natural language translation of the markup, but this is not
  6821. required.</p></def>
  6822. </gitem>
  6823.  
  6824. <gitem><label><maction actiontype="tooltip"> (expression) (message) </maction></label>
  6825. <def><p>Here the renderer would also display the expression in context
  6826. on the screen. When the mouse pauses over the expression for a long
  6827. enough delay time, the renderer displays a rendering of the message in
  6828. a pop-up <quote>tooltip</quote> box near the expression. These message boxes are
  6829. also sometimes called <quote>balloon help</quote> boxes. Presumably authors would
  6830. use plain text in an <kw role="element">mtext</kw> element for the message
  6831. in most circumstances. For non-<kw role="element">mtext</kw> messages,
  6832. renderers may provide a natural language translation of the markup if
  6833. full MathML rendering is not practical, but this is not
  6834. required.</p></def>
  6835. </gitem>
  6836.  
  6837. <gitem>
  6838. <label><maction actiontype="highlight" my:color="red" my:background="yellow"> expression </maction></label>
  6839. <def><p>In this case, a renderer might highlight the enclosed expression on
  6840. a <quote>mouse-over</quote> event. In the example given above,
  6841. non-standard attributes from another namespace are being used to pass
  6842. additional information to renderers that support them, without violating the MathML DTD (see
  6843. <specref ref="interf_unspecified"/>). The <kw role="attrib">my:color</kw> attribute
  6844. changes the color of the characters in the presentation, while the
  6845. <kw role="attrib">my:background</kw> attribute changes the color of the background
  6846. behind the characters.</p></def>
  6847. </gitem>
  6848.  
  6849. <gitem><label><maction actiontype="menu" selection="1" > (menu item 1) (menu item 2) ... </maction></label>
  6850.  
  6851. <def><p>This action type instructs a renderer to provide a pop up
  6852. menu. This allows a one-to-many linking capability. Note that the menu
  6853. items may be other <maction
  6854. actiontype="menu">...</maction> expressions, thereby allowing
  6855. nested menus.  It is assumed that the user choosing a menu item would
  6856. invoke some kind of action associated with that item. Such action
  6857. might be completely handled by the renderer itself or it might trigger
  6858. some kind of event within the browser that could be linked to other
  6859. programming logic.  </p></def>
  6860.  
  6861. </gitem>
  6862. </glist>
  6863. </p>
  6864. </div4>
  6865. </div3>
  6866. </div2>
  6867. </div1>
  6868.