Closed physikerwelt closed 6 months ago
Note that https://github.com/w3c/mathml-core/issues/103 is about percentage values, it does not change the interpretation of em values.
(edit: the fix to make sure minsize/maxsize preserves symmetry may still be relevant though)
@fred-wang thank you. I feel that this is not the most intuitive way to implement \big
I would prefer something like <mo style="font-size: larger;">
.
@physikerwelt I don't think font-size is a good mechanism for implementing larger delimiters, \big
and stretching generally isn't usually implemented by using a larger font (which would imply heavier stroke weights ,and expanding width in proportion to height) but by choosing or constructing a larger delimiter within the same font.
@davidcarlisle I didn't mean to change the implementation (in the browser). My goal was to find a better way to find a synonym (or equivalent concept) for the tex concept in MathML. Using maxsize and minsize simultaneously feels like abusing implementation details to achieve the goal. When we update MathML (at least the unfrozen parts), I think, it makes sense to discuss how frequently used concepts in Tex (as most content originates from Tex) can be expressed in MathML. Or do we think that the \big
concepts should be avoided in most cases in tex? From a semantics perspective, I would in almost all cases prefer \bigl
which makes putting superscripts like \bigr)^2
easier.
On a purely MathML ergonomics side, I suspect the missed opportunity is using a single attribute as a shorthand for setting minsize
and maxsize
to the same value.
You can see something similar in CSS, which has min-height
and max-height
, but you also have a standalone height
property (and similarly for width), which avoids some pain.
Since the behavior here relies on the stretching algorithm (which was very good to learn and keep in mind), maybe we would have needed a new stretchsize
attribute in a MathML-only formulation.
In a CSS world one would have wished for some new properties. Possibly math-stretch-size
to use as
<mo style="math-stretch-size: 2.047em">(</mo>
for precise stretch sizing using matching min+max values. And likely also wish for the MathML minsize
and maxsize
getting matching CSS properties, maybe math-stretch-min-size
, math-stretch-max-size
.
I took inspiration for some of that from Fred's suggestion in https://github.com/w3c/mathml-core/issues/218 for new CSS properties doing the job of lspace
and rspace
.
@physikerwelt
I think, it makes sense to discuss how frequently used concepts in Tex (as most content originates from Tex) can be expressed in MathML. Or do we think that the \big concepts should be avoided in most cases in tex? F
That's my point though: TeX does not change fonts for \big or \left etc :it selects delimters from the same font (in unicode tex) or the same font or its extension font (in classic tex) it never chooses a delimiter from a font of larger nominal design size.
The formulation certainly feels awkward, but as @davidcarlisle points out, there are two distinct cases: choosing a glyph from a font of a certain size vs choosing/stretching/synthesizing a glyph from the current font to be of a certain size.
The problem with your 2nd example, using "|" in Firefox, appears to be that under certain circumstances, Firefox is not defaulting "|" to be stretchy; adding an explicit stretchy="true"
fixes that. It feels like a bug, but may be just an question of what form
it is using and how it has looked up "|" in the dictionary.
I am starting to realize that I need to understand the implementation details better. If I had to implement stretching I had no idea how to do that for a general utf-8 char. I encountered similar problems with horizontal stretching (https://github.com/brucemiller/LaTeXML/issues/2317#issuecomment-1936996943). How would for example \big A look like, would there be an exception?
Stretching is implemented by the font, so from a math renderer point of view there is nothing to do for "a general utf-8 char" you just ask the font for the character if the font doesn't contain a recipe for extending the character you just get it at normal size. As classic tex can't look in to the font the macro set has to declare which characters are extendable (by giving them a non zero \delcode
) so typically A
has not got a \delcode
so \big A
is an error.
Here is a codepen reproducing some of the discussion so far: https://codepen.io/dginev/pen/LYvQBXM
The default stretching of |
doesn't seem to work in Firefox, but despite that a set minsize
is respected. Curious.
As per David's explanation A
is inert to stretching in STIX Two Math, which is probably a good feature. There are fonts where people may get tempted to use a highly decorative version of say the Latin letter L
, instead of the math-oriented ⌊
(U+230A), if it was possible to stretch any char.
A general suggestion for people posting codepen.io examples: include some text explaining what each example is meant to demonstrate. Each browser potentially displays the example differently (hopefully that comes to an end in my lifetime), so it isn't always clear what the example demonstrates, especially when coming back to it later.
resolved to make no change and keep misize+maxsize and close 2024-05-16 meeting
The input
can be represented using
Note: That the em values are defined in orinate from #75. While this renders well in Firefox at least, the following example fails
Maybe there is another UTF-8 symbol which better stretches compared to |.
However, this would require special treatment for any argument of the
\big
macros. Thus I wonder if there is a MathML inherent way to model the LaTeX construct.See also