<menclose/>These notes collect various ideas to implement the MathML element
<menclose/> that I use for Amaya and Firefox. The current
rendering of <menclose/> in Amaya is only an approximation.
It is made essentially with its "P langage" so the ideas should be applyable to
renderers that use CSS to display MathML (such that Opera). The implementation
for Firefox is supposed to be closer to the expected result and gives other
ideas. I am very grateful to Karl
Tomlinson for reviewing my patches for Firefox and for its comments &
suggestions. I would also like to thank Azzeddine Lazrek for having
provided information about the madruwb notation, although I have finaly not
implemented this notation in Firefox. I hope someone else will be able to work
on it.
The element was introduced in the MathML
2 recommendation to render its content inside an enclosing notation. The
way to draw the different notations is not described exactly in this
specification but some examples are given. More information will be available
in the MathML 3 specification, especially about how to deal with several
notations in the same <menclose/>.
First, the <menclose/> follows the rule of the inferred
mrow so we can imagine it has only one child. Hence we suppose that we have
the bounding box of this child i.e. a rectangle that represents its extent.
Bounding boxes are commonly used in layout engines. However, the layout algorithm described below could be modified to
deal with other shapes.
The <menclose/> element has a notation attributes that
may contain any number of notation names separated by whitespace. The first
step is to parse this attribute to determine the list of notation to draw.
Duplicated values are counted once and unknown values are ignored. The MathML
REC contains a list
of suggested values. A new notation is proposed in the current MathML 3
working draft: madruwb.
The next steps is to render this list of notations. Some test pages:
Some notations can be drawn as a combination (exact or approximative) of others. It can be useful to start with approximations because some of the notations are more difficult to implement.
longdiv" can be approximated by "left top"actuarial" can be drawn as "right top"box" can be drawn as "top right left
bottom"roundedbox" and "circle" can be approximated
by "box"updiagonalstrike" and "downdiagonalstrike" can
be approximated by "horizontalstrike"madruwb" can be approximated by "bottom
right"radical" can drawn using the same mechanism than for the
<msqrt/> element, if the latter is already
implementedTODO
TODO
We increase the dimension of the bounding box by a factor .
If we consider the point M, we have
Hence i.e .
TODO