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 / mathml-css-sample.xml < prev    next >
Text File  |  2001-01-29  |  7KB  |  305 lines

  1. <inform-div1 id="stylesheet" role="appendixg" ><head>Sample CSS Style Sheet for MathML</head>
  2. <!-- $Id: mathml-css-sample.xml,v 1.9 2001/01/29 10:55:15 davidc Exp $-->
  3.  
  4. <p>The Cascading Style Sheet sample given here is <emph>not normative</emph>. It is provided 
  5. as a guide to illustrate the sort of CSS style sheet rules which a MathML renderer should 
  6. include in its default style sheet in order to comply with both the CSS and MathML 
  7. specifications. In particular, there is a need to provide rules to prevent the descent of
  8. CSS font rules into MathML expressions embedded in ambient text, and to provide support for
  9. the <kw role="attrib">mathfamily</kw>, <kw role="attrib">mathslant</kw>, <kw role="attrib">mathweight</kw>, <kw role="attrib">mathsize</kw>, 
  10. <kw role="attrib">mathcolor</kw> and <kw role="attrib">mathbackground</kw> attributes.
  11. </p>
  12. <p>We expect that implementation experience will allow us to provide a more authoritative
  13. default MathML style sheet in the future. In the interim, it is hoped that this illustrative
  14. sample will be helpful.</p>
  15. <p>
  16. <eg>
  17. <![CDATA[
  18.  
  19. math, math[mode="inline"] {
  20.   display: inline;
  21.   font-family: CMSY10, CMEX10, Symbol, Times;
  22.   font-style: normal;
  23. }
  24.  
  25. math[mode="display"] {
  26.   display: block;
  27.   text-align: center;
  28.   font-family: CMSY10, CMEX10, Symbol, Times;
  29.   font-style: normal;
  30. }
  31.  
  32. @media screen {  /* hide from old browsers */
  33.  
  34.  
  35. /* Rules dealing with the various values of the "mathvariant" attribute: */
  36.  
  37. math *.[mathvariant="normal"] {
  38.   font-family: "Times New Roman", Courier, Garamond, serif;
  39.   font-weight: normal;
  40.   font-style: normal;
  41. }
  42.  
  43. math *.[mathvariant="bold"] {
  44.   font-family: "Times New Roman", Courier, Garamond, serif;
  45.   font-weight: bold;
  46.   font-style: normal;
  47. }
  48.  
  49. math *.[mathvariant="italic"] {
  50.   font-family: "Times New Roman", Courier, Garamond, serif;
  51.   font-weight: normal;
  52.   font-style: italic;
  53. }
  54.  
  55. math *.[mathvariant="bold-italic"] {
  56.   font-family: "Times New Roman", Courier, Garamond, serif;
  57.   font-weight: bold;
  58.   font-style: italic;
  59. }
  60.  
  61. math *.[mathvariant="double-struck"] {
  62.   font-family: msbm;
  63.   font-weight: normal;
  64.   font-style: normal;
  65. }
  66.  
  67. math *.[mathvariant="script"] {
  68.   font-family: eusb;
  69.   font-weight: normal;
  70.   font-style: normal;
  71. }
  72.  
  73. math *.[mathvariant="bold-script"] {
  74.   font-family: eusb;
  75.   font-weight: bold;
  76.   font-style: normal;
  77. }
  78.  
  79. math *.[mathvariant="fraktur"] {
  80.   font-family: eufm;
  81.   font-weight: normal;
  82.   font-style: normal;
  83. }
  84.  
  85. math *.[mathvariant="bold-fraktur"] {
  86.   font-family: eufm;
  87.   font-weight: bold;
  88.   font-style: italic;
  89. }
  90.  
  91. math *.[mathvariant="sans-serif"] {
  92.   font-family: Arial, "Lucida Sans Unicode", Verdana, sans-serif;
  93.   font-weight: normal;
  94.   font-style: normal;
  95. }
  96.  
  97. math *.[mathvariant="bold-sans-serif"] {
  98.   font-family: Arial, "Lucida Sans Unicode", Verdana, sans-serif;
  99.   font-weight: bold;
  100.   font-style: normal;
  101. }
  102.  
  103. math *.[mathvariant="sans-serif-italic"] {
  104.   font-family: Arial, "Lucida Sans Unicode", Verdana, sans-serif;
  105.   font-weight: normal;
  106.   font-style: italic;
  107. }
  108.  
  109. math *.[mathvariant="sans-serif-bold-italic"] {
  110.   font-family: Arial, "Lucida Sans Unicode", Verdana, sans-serif;
  111.   font-weight: bold;
  112.   font-style: italic;
  113. }
  114.  
  115. math *.[mathvariant="monospace"] {
  116.   font-family: monospace
  117. }
  118.  
  119.  
  120. /* Rules dealing with "mathsize" attribute */
  121.  
  122. math *.[mathsize="small"] {
  123.   font-size: 80%
  124. }
  125.  
  126. math *.[mathsize="normal"] {
  127. /*  font-size: 100%  - which is unnecessary */
  128. }
  129.  
  130. math *.[mathsize="big"] {
  131.   font-size:  125%
  132. }
  133.  
  134. /*Set size values for the "base" children of script and limit schema to 
  135.   distinguish them from the script or limit children:
  136. */
  137.  
  138. msub>*:first-child[mathsize="big"],
  139. msup>*:first-child[mathsize="big"],
  140. msubsup>*:first-child[mathsize="big"],
  141. munder>*:first-child[mathsize="big"],
  142. mover>*:first-child[mathsize="big"],
  143. munderover>*:first-child[mathsize="big"],
  144. mmultiscripts>*:first-child[mathsize="big"],
  145. mroot>*:first-child[mathsize="big"] {
  146.   font-size: 125%
  147. }
  148.  
  149. msub>*:first-child[mathsize="small"],
  150. msup>*:first-child[mathsize="small"],
  151. msubsup>*:first-child[mathsize="small"],
  152. munder>*:first-child[mathsize="small"],
  153. mover>*:first-child[mathsize="small"],
  154. munderover>*:first-child[mathsize="small"],
  155. mmultiscripts>*:first-child[mathsize="small"],
  156. mroot>*:first-child[mathsize="small"] {
  157.   font-size: 80%
  158. }
  159.  
  160. msub>*:first-child,
  161. msup>*:first-child,
  162. msubsup>*:first-child,
  163. munder>*:first-child,
  164. mover>*:first-child,
  165. munderover>*:first-child,
  166. mmultiscripts>*:first-child,
  167. mroot>*:first-child {
  168.   font-size: 100%
  169. }
  170.  
  171. /*Set size values for the other children of script and limit schema (the 
  172.   script and limit children) - include scriptlevel increment attribute?
  173. */
  174.  
  175. msub>*[mathsize="big"],
  176. msup>*[mathsize="big"],
  177. msubsup>*[mathsize="big"],
  178. munder>*[mathsize="big"],
  179. mover>*[mathsize="big"],
  180. munderover>*[mathsize="big"],
  181. mmultiscripts>*[mathsize="big"],
  182. math[display="inline"] mfrac>*[mathsize="big"],
  183. math *[scriptlevel="+1"][mathsize="big"] {
  184.   font-size: 89%  /* (.71 times 1.25) */
  185. }
  186.  
  187. msub>* [mathsize="small"],
  188. msup>*[mathsize="small"],
  189. msubsup>*[mathsize="small"],
  190. munder>*[mathsize="small"],
  191. mover>*[mathsize="small"],
  192. munderover>*[mathsize="small"],
  193. mmultiscripts>*[mathsize="small"],
  194. math[display="inline"] mfrac>*[mathsize="small"],
  195. math *[scriptlevel="+1"][mathsize="small"] {
  196.   font-size: 57% /* (.71 times .80) */
  197. }
  198.  
  199. msub>*,
  200. msup>*,
  201. msubsup>*,
  202. munder>*,
  203. mover>*,
  204. munderover>*,
  205. mmultiscripts>*,
  206. math[display="inline"] mfrac>*,
  207. math *[scriptlevel="+1"] {
  208.   font-size: 71%
  209. }
  210.  
  211. mroot>*[mathsize="big"] {
  212.   font-size: 62%  /* (.50 times 1.25) */
  213. }
  214.  
  215. mroot>*[mathsize="small"] {
  216.   font-size: 40% /* (.50 times .80) */
  217. }
  218.  
  219. mroot>* {
  220.   font-size: 50%
  221. }
  222.  
  223. /* Set size values for other scriptlevel increment attributes  */
  224.  
  225. math *[scriptlevel="+2"][mathsize="big"] {
  226.   font-size: 63%  /* (.71 times .71 times 1.25) */
  227. }
  228.  
  229. math *[scriptlevel="+2"][mathsize="small"] {
  230.   font-size: 36% /* (.71 times .71 times .71) */
  231. }
  232.  
  233. math *[scriptlevel="+2"] {
  234.   font-size: 50%   /* .71 times .71 */
  235. }
  236.  
  237. math *.[mathcolor="green"] {
  238.   color: green
  239. }
  240.  
  241. math *.[mathcolor="black"] {
  242.   color: black
  243. }
  244.  
  245. math *.[mathcolor="red"] {
  246.   color: red
  247. }
  248.  
  249. math *.[mathcolor="blue"] {
  250.   color: blue
  251. }
  252.  
  253. math *.[mathcolor="olive"] {
  254.    color: olive
  255. }
  256.  
  257. math *.[mathcolor="purple"] {
  258.    color: purple
  259. }
  260.  
  261. math *.[mathcolor="teal"] {
  262.    color: teal
  263. }
  264.  
  265. math *.[mathcolor="aqua"] {
  266.    color: aqua
  267. }
  268.  
  269. math *.[mathcolor="gray"] {
  270.    color: gray
  271. }
  272.  
  273. math *.[mathbackground="blue"] {
  274.    background-color: blue
  275. }
  276.  
  277. math *.[mathbackground="green"] {
  278.    background-color: green
  279. }
  280.  
  281. math *.[mathbackground="white"] {
  282.    background-color: white
  283. }
  284.  
  285. math *.[mathbackground="yellow"] {
  286.    background-color: yellow
  287. }
  288.  
  289. math *.[mathbackground="aqua"] {
  290.    background-color: aqua
  291. }
  292.  
  293. } /* Close "@media screen" scope */
  294.  
  295. @media aural {  
  296. }
  297.  
  298. ]]>
  299. </eg>
  300. </p>
  301. </inform-div1>
  302.  
  303.  
  304.  
  305.