mathquill / mathquill

Easily type math in your webapp

Home Page:http://mathquill.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Curly brackets not rendered when using .latex('\\{') in combination with fade-in

sjcjoosten opened this issue · comments

When I run:

mq.latex('\\left\\{1,\\right\\}');

I expect to see {1,}.

The LaTeX, spacing and characters all seem to be there, but the { and } seem transparent or hidden. The 1, is shown.

Hi @sjcjoosten,

I tried reproducing this and I'm not seeing the described behavior, can you send a repro video or more details?

mathquill-escaped-curly-braces-2022-08-16_11.53.17.mp4

Sorry for not testing this in isolation. I figured out what the problem was, running these two examples from the console on the MQ homepage:

d = document.createElement('div');mf=MQ.MathField(d,{handlers:{enter:()=>{}}});$('#example').append(d);d.style='display:none';$(d).fadeIn(200);mf.latex('\\left\\{1,\\right\\}');

d = document.createElement('div');mf=MQ.MathField(d,{handlers:{enter:()=>{}}});$('#example').append(d);d.style='display:none';mf.latex('\\left\\{1,\\right\\}');$(d).fadeIn(200);

First of these works like a charm, the second has the exact same issue I'm facing. This immediately gives me a work-around (i.e. do the first thing and not the second), so this is no longer an issue for me, but it could still be considered a bug as I was expecting the two examples to have the same behavior (I'll leave it up to MQ to decide if this is a bug or just something to be aware of).

Oh in that case I have good news. There is a branch that we are finishing reviewing with changes made by the Desmos team on their fork. One of the changes was a performance improvement to how "strechy symbols" like curly braces, parenthesis, etc. are scaled and displayed. Their approach looks to have fixed this behavior after a quick test on top of their branch.

The mathquill PR for merging this in:
#947

Original PR on the desmos fork that introduced the feature:
desmosinc#107

Will be fixed by #947
Many thanks!