New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to represent brackets equivalent to \big( and friends #491
Comments
Note that w3c/mathml-core#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 |
@physikerwelt I don't think font-size is a good mechanism for implementing larger delimiters, |
@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 |
On a purely MathML ergonomics side, I suspect the missed opportunity is using a single attribute as a shorthand for setting You can see something similar in CSS, which has 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 In a CSS world one would have wished for some new properties. Possibly <mo style="math-stretch-size: 2.047em">(</mo> for precise stretch sizing using matching min+max values. And likely also wish for the MathML I took inspiration for some of that from Fred's suggestion in w3c/mathml-core#218 for new CSS properties doing the job of |
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 |
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 (brucemiller/LaTeXML#2317 (comment)). 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 |
Here is a codepen reproducing some of the discussion so far: The default stretching of As per David's explanation |
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. |
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
The text was updated successfully, but these errors were encountered: