From 79f962594231ddd24ff46de76fdc375ad04736ae Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 9 Jan 2025 06:33:10 -0600 Subject: [PATCH] Give explicit multiplication the special mq_precedence as well. Implied multiplication ` *` currently has the precedence of 2.9 when MathQuill is used. This means that `(x-3)/4 (x+8)/7` is interpreted as `\frac{(x-3)}{4} * \frac{(x+8)}{7}`. However, `(x-3)/4 * (x+8)/7` is interpreted as `\frac{\frac{(x-3)/4 * (x+8)}{7}`. That should also be interpreted as `\frac{(x-3)}{4} * \frac{(x+8)}{7}` and is with the mq_precendence for `* ` also set to 2.9. --- lib/Parser/Context.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Parser/Context.pm b/lib/Parser/Context.pm index f326404301..97ceb99885 100644 --- a/lib/Parser/Context.pm +++ b/lib/Parser/Context.pm @@ -216,7 +216,7 @@ sub usePrecedence { /^Standard/i and do { $self->operators->set( ' *' => { precedence => 3, mq_precedence => 2.9 }, - '* ' => { precedence => 3 }, + '* ' => { precedence => 3, mq_precedence => 2.9 }, ' /' => { precedence => 3 }, '/ ' => { precedence => 3 }, fn => { precedence => 7.5 },