<xsl:template name="subMrow">
<xsl:param name="x"/>
<xsl:param name="y"/>
<xsl:param name="baseline" select="0"/>
<xsl:param name="nodes"/>


This template is used to align the children of a row on the same baseline. It also calls stretchy correction on operators that must stretch vertically. The first part of this function is to compute all the children on the same baseline. To do that, it calls a template alignChild that takes the same parameters plus a firstChild parameter that is used to determine which element is the first child. This first child will give its basline attribute to all other children in order to align all children on the same baseline.

After that, the function corrects the elements that must stretch vertically. All the stretchy embellished operators are first retrieved by using getStretchyEmbellished. If there are no stretchy embellished operator, nothing is done and all the annotated children elements are returned. In the other case, a stretchy correction may be done.

If a stretchy correction has to be done, the lowest and highest Y of all non stretchy children have to be retrieved to know the final size of the stretchy operators. To retrieve these children, getNonStretchyEmbellished function is used. If there is no element that does not stretch, nothing is done and all the annotated children elements are returned without any correction. In the other cases, a stretchy correction is done.

Now that the non-stretchy elements are retrieved, the lowest and highest Y can be computed and the alignChild template is called again to recompute the row with these new parameters. All the elements have to be recomputed because if an operator has to be stretched, its width will be greater. Therefore, all the elements that follow it must have a new X coordinate. Finally, all elements are returned.