# MathML 4 (legacy) # ################ # Copyright 1998-2022 W3C (MIT, ERCIM, Keio) # # Use and distribution of this code are permitted under the terms # W3C Software Notice and License # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 default namespace m = "http://www.w3.org/1998/Math/MathML" # MathML 4 include "mathml4.rnc" { # unitless lengths length-percentage = xsd:string { pattern = '\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*' } } # Removed MathML 1/2/3 elements ContExp |= reln | fn | declare reln = element reln {ContExp*} fn = element fn {ContExp} declare = element declare {attribute type {xsd:string}?, attribute scope {xsd:string}?, attribute nargs {xsd:nonNegativeInteger}?, attribute occurrence {"prefix"|"infix"|"function-model"}?, DefEncAtt, ContExp+} # legacy attributes mglyph.deprecatedattributes = attribute fontfamily {text}?, attribute index {integer}?, attribute mathvariant {"normal" | "bold" | "italic" | "bold-italic" | "double-struck" | "bold-fraktur" | "script" | "bold-script" | "fraktur" | "sans-serif" | "bold-sans-serif" | "sans-serif-italic" | "sans-serif-bold-italic" | "monospace" | "initial" | "tailed" | "looped" | "stretched"}?, attribute mathsize {"small" | "normal" | "big" | length-percentage}? mglyph.attributes &= mglyph.deprecatedattributes mstyle.deprecatedattributes = attribute veryverythinmathspace {length-percentage}?, attribute verythinmathspace {length-percentage}?, attribute thinmathspace {length-percentage}?, attribute mediummathspace {length-percentage}?, attribute thickmathspace {length-percentage}?, attribute verythickmathspace {length-percentage}?, attribute veryverythickmathspace {length-percentage}? mstyle.attributes &= mstyle.deprecatedattributes math.deprecatedattributes = attribute mode {xsd:string}?, attribute macros {xsd:string}? math.attributes &= math.deprecatedattributes DeprecatedTokenAtt = attribute fontfamily {text}?, attribute fontweight {"normal" | "bold"}?, attribute fontstyle {"normal" | "italic"}?, attribute fontsize {length-percentage}?, attribute color {color}?, attribute background {color}?, attribute mathsize {"small" | "normal" | "big" }? mstyle.attributes &= DeprecatedTokenAtt mglyph.attributes &= DeprecatedTokenAtt mn.attributes &= DeprecatedTokenAtt mi.attributes &= DeprecatedTokenAtt mo.attributes &= DeprecatedTokenAtt mtext.attributes &= DeprecatedTokenAtt mspace.attributes &= DeprecatedTokenAtt ms.attributes &= DeprecatedTokenAtt semantics.attributes &= DefEncAtt # malignmark in tokens token.content |= malignmark # malignmark in mfrac etc MathExpression |= MalignExpression maligngroup.attributes &= attribute groupalign {"left" | "center" | "right" | "decimalpoint"}? malignmark.attributes &= attribute edge {"left" | "right"}? mstyle.generalattributes &= attribute edge {"left" | "right"}? # groupalign group-alignment = "left" | "center" | "right" | "decimalpoint" group-alignment-list = list {group-alignment+} group-alignment-list-list = xsd:string { pattern = '(\s*\{\s*(left|center|right|decimalpoint)(\s+(left|center|right|decimalpoint))*\})*\s*' } mstyle.generalattributes &= attribute groupalign {group-alignment-list-list}? mtable.attributes &= attribute groupalign {group-alignment-list-list}? mtr.attributes &= attribute groupalign {group-alignment-list-list}? mtd.attributes &= attribute groupalign {group-alignment-list}?