From 7b3e78106311d908d9c4b3564bf9d0b7a57b6f42 Mon Sep 17 00:00:00 2001 From: David Carlisle Date: Sat, 28 Sep 2024 18:25:57 +0100 Subject: [PATCH 1/2] mlabeledtr --- src/changes.html | 6 +- src/presentation-markup.html | 206 ++++------------------------------- src/respec.rnc | 3 +- 3 files changed, 29 insertions(+), 186 deletions(-) diff --git a/src/changes.html b/src/changes.html index 70ff7f1..e672127 100644 --- a/src/changes.html +++ b/src/changes.html @@ -99,7 +99,11 @@

Changes to

but invalid in the default schema.
  • The deprecated element none is replaced by an empty mrow throughout, - to match [[MathML-Core]]. + to match [[MathML-Core]].
  • +
  • The element mlabeledtr and the associacted attributes + side and minlabelspacing + are no longer specified. They are removed from the default schema but valid in + the Legacy Schema.
  • diff --git a/src/presentation-markup.html b/src/presentation-markup.html index d6aa168..57b0839 100644 --- a/src/presentation-markup.html +++ b/src/presentation-markup.html @@ -324,13 +324,7 @@
    Table of argument requirements
    mtable 0 or more rows - 0 or more mtr or mlabeledtr elements - - - - mlabeledtr - 1 or more - a label and 0 or more mtd elements + 0 or more mtr elements @@ -922,11 +916,6 @@
    Tables and Matrices
    table or matrix - - mlabeledtr - row in a table or matrix with a label or equation number - - mtr row in a table or matrix @@ -4060,7 +4049,7 @@
    Description
    mglyph, mpadded, or mtable. Similarly, when rowalign or columnalign are specified on an mstyle element, they apply only to the - mtable element, and not the mtr, mlabeledtr, + mtable element, and not the mtr, mtd, and maligngroup elements. When the lspace attribute is set with mstyle, it applies only to the mo element and not to mpadded. @@ -6349,7 +6338,7 @@

    Tabular Math

    Matrices, arrays and other table-like mathematical notation are marked up using mtable, - mtr, mlabeledtr and + mtr and mtd elements. These elements are similar to the table, tr and td elements of HTML, except that they provide specialized attributes for the fine layout control @@ -6360,13 +6349,7 @@

    Tabular Math

    For layout and for accessibility reasons, the mstack and mlongdiv elements discussed in should be used for elementary math notations.

    -

    In addition to the table elements mentioned above, the mlabeledtr element is used for labeling rows - of a table. This is useful for numbered equations. - The first child of mlabeledtr is the label. - A label is somewhat special in that it is not considered an expression - in the matrix and is not counted when determining the number of columns - in that row.

    - +

    Table or Matrix <mtable>

    @@ -6374,8 +6357,7 @@

    Table or Matrix
    Description
    -

    A matrix or table is specified using the mtable element. Inside of the mtable element, only mtr - or mlabeledtr elements may appear. +

    A matrix or table is specified using the mtable element. Inside of the mtable element, only mtr elements may appear.

    Table rows that have fewer columns than other rows of the same @@ -6388,9 +6370,8 @@

    Description
    attributes may affect the number of mtd elements that should be given in subsequent mtr elements to cover a given - number of columns. - Note also that the label in an mlabeledtr element - is not considered a column in the table.

    + number of columns.

    +

    MathML does not specify a table layout algorithm. In particular, it is the responsibility of a MathML renderer to resolve @@ -6683,35 +6664,6 @@

    Attributes
    - - side - "left" | "right" | "leftoverlap" | "rightoverlap" - right - - - - - specifies on what side of the table labels from enclosed mlabeledtr (if any) should be placed. - The variants leftoverlap and rightoverlap - are useful when the table fits with the allowed width - when the labels are omitted, but not when they are included: - in such cases, the labels will overlap the row placed above it - if the rowalign for that row is top, - otherwise it is placed below it. - - - - - minlabelspacing - length - 0.8em - - - - - specifies the minimum space allowed between a label and the adjacent cell in the row. - - @@ -6730,8 +6682,7 @@
    Attributes

    Note that none of the areas occupied by lines frame, rowlines and columnlines, - nor the spacing framespacing, rowspacing or columnspacing, - nor the label in mlabeledtr are counted as rows or columns.

    + nor the spacing framespacing, rowspacing or columnspacing are counted as rows or columns.

    The displaystyle attribute is allowed on the mtable element to set the inherited value of the attribute. If the attribute is @@ -6848,100 +6799,25 @@

    Attributes
    -

    - -
    -

    Labeled Row in Table or Matrix - <mlabeledtr>

    - -
    -
    Description
    - -

    An mlabeledtr element represents one row in - a table that has a label on either the left or right side, as - determined by the side attribute. The label is - the first child of mlabeledtr, and should be enclosed in an mtd. - The rest of the children represent the contents of the row and are treated identically - to the children of mtr; consequently all of the children - must be mtd elements. -

    - -

    - An mlabeledtr element is only allowed as a - direct sub-expression of an mtable element. - Each argument of mlabeledtr except for the first - argument (the label) is placed in a different column - of the table, starting at the leftmost column.

    - -

    Note that the label element is not considered to be a cell in the - table row. In particular, the label element is not taken into - consideration in the table layout for purposes of width and alignment - calculations. For example, in the case of an mlabeledtr with a label and a single centered mtd child, the child is first centered in the - enclosing mtable, and then the label is - placed. Specifically, the child is not centered in the - space that remains in the table after placing the label.

    - -

    While MathML does not specify an algorithm for placing labels, - implementers of visual renderers may find the following formatting - model useful. To place a label, an implementor might think in terms - of creating a larger table, with an extra column on both ends. The - columnwidth attributes of both these border - columns would be set to fit so that they expand - to fill whatever space remains after the inner columns have been laid - out. Finally, depending on the values of side - and minlabelspacing, the label is placed - in whatever border column is appropriate, possibly shifted down if - necessary, and aligned according to columnalignment.

    -
    - -
    -
    Attributes
    - -

    - The attributes for mlabeledtr are the same - as for mtr. Unlike the attributes for the - mtable element, attributes of - mlabeledtr that apply to column elements - also apply to the label. For example, in a one column table, -

    - -
    -
    - 
    -        <mlabeledtr rowalign='top'>
    - 
    -      
    -
    -

    means that the label and other entries in the row are vertically aligned - along their top. To force a particular alignment on the label, - the appropriate attribute would normally be set on the - mtd element that surrounds the label content. -

    -
    - +
    Equation Numbering
    - -

    One of the important uses of mlabeledtr is + + +

    Earlier versions of MathML specified an mlabeledtr element for numbered equations. In an mlabeledtr, the - label represents the equation number and the elements in the row are - the equation being numbered. The side and minlabelspacing attributes of mtable determine the placement of the equation - number.

    + first mtd represented the equation number and the remaining elements in the row + the equation being numbered. The side and minlabelspacing attributes of mtable determined the placement of the equation + number. + This element was not widely implemented and is not specified in the current version, it is still valid + in the Legacy Schema.

    In larger documents with many numbered equations, automatic numbering becomes important. While automatic equation numbering and automatically resolving references to equation numbers is outside the scope of MathML, these problems can be addressed by the use of style - sheets or other means. The mlabeledtr construction provides support - for both of these functions in a way that is intended to facilitate - XSLT processing. The mlabeledtr element can be - used to indicate the presence of a numbered equation, and the first - child can be changed to the current equation number, along with - incrementing the global equation number. For cross references, an - id on either the mlabeledtr element or on the first element - itself could be used as a target of any link. - Alternatively, in a CSS context, one could use an empty mtd - as the first child of mlabeledtr and use CSS counters and generated content + sheets or other means. Un a CSS context, one could use an empty mtd + as the first child of a mtr and use CSS counters and generated content to fill in the equation number using a CSS style such as

    @@ -6954,40 +6830,8 @@
    Equation Numbering
    -
    -
    Example
    - -
    -
    -       <mtable>
    -         <mlabeledtr id='e-is-m-c-square'>
    -           <mtd>
    -             <mtext> (2.1) </mtext>
    -           </mtd>
    -           <mtd>
    -             <mrow>
    -               <mi>E</mi>
    -               <mo>=</mo>
    -               <mrow>
    -                 <mi>m</mi>
    -                 <mo>&#x2062;<!--InvisibleTimes--></mo>
    -                 <msup>
    -                   <mi>c</mi>
    -                   <mn>2</mn>
    -                 </msup>
    -               </mrow>
    -             </mrow>
    -           </mtd>
    -         </mlabeledtr>
    -       </mtable>
    -     
    -
    -
    - mlabeledtr example -
    - -
    +

    Entry in Table or Matrix <mtd>

    @@ -6998,7 +6842,7 @@
    Description

    An mtd element represents one entry, or cell, in a table or matrix. An mtd element is only allowed as a direct sub-expression of an mtr - or an mlabeledtr element.

    + element.

    The mtd element accepts a single argument possibly being an inferred mrow of multiple children; @@ -7083,13 +6927,7 @@

    Attributes
    -

    The rowspan and columnspan attributes - can be used around an mtd element that represents - the label in an mlabeledtr element. - Also, the label of an mlabeledtr element is not - considered to be part of a previous rowspan and - columnspan. -

    +
    diff --git a/src/respec.rnc b/src/respec.rnc index 9a93a84..8d96e1b 100644 --- a/src/respec.rnc +++ b/src/respec.rnc @@ -62,7 +62,8 @@ attribute style {text}?, #FIX attribute id {text}?, attribute tabindex {text}?, attribute role {text}?, -h6?, #FIX +h6?, #FIX +attribute title {text}?, (divcontent|label|input)* } From afb96e378db5fdf135870157ee5ceef94e84cda2 Mon Sep 17 00:00:00 2001 From: David Carlisle Date: Thu, 3 Oct 2024 09:14:38 +0100 Subject: [PATCH 2/2] corrections from Neil --- src/presentation-markup.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/presentation-markup.html b/src/presentation-markup.html index 57b0839..cfbf226 100644 --- a/src/presentation-markup.html +++ b/src/presentation-markup.html @@ -6806,8 +6806,8 @@
    Equation Numbering

    Earlier versions of MathML specified an mlabeledtr element for numbered equations. In an mlabeledtr, the - first mtd represented the equation number and the remaining elements in the row - the equation being numbered. The side and minlabelspacing attributes of mtable determined the placement of the equation + first mtd represents the equation number and the remaining elements in the row + the equation being numbered. The side and minlabelspacing attributes of mtable determines the placement of the equation number. This element was not widely implemented and is not specified in the current version, it is still valid in the Legacy Schema.

    @@ -6816,7 +6816,7 @@
    Equation Numbering
    numbering becomes important. While automatic equation numbering and automatically resolving references to equation numbers is outside the scope of MathML, these problems can be addressed by the use of style - sheets or other means. Un a CSS context, one could use an empty mtd + sheets or other means. In a CSS context, one could use an empty mtd as the first child of a mtr and use CSS counters and generated content to fill in the equation number using a CSS style such as