desmosinc / mathquill

Magic textboxes where you can type math as easily as writing!
mathquill.com
132 stars 39 forks source link

Recognize "-" as "negative" after certain operator names #282

Closed jared-hughes closed 5 months ago

jared-hughes commented 5 months ago

Adds an option prefixOperatorNames to specify which names behave as prefixes. In Desmos, this is used for "ln," "log," and the trig functions such as "sin." A minus sign (-) after any such name is treated as "negative" instead. This affects spacing (there's less space after a "negative" than after a minus sign) and mathspeak / aria labels. For example, \sin -1 is read as "sine negative 1" instead of "sine minus 1."

Also, all of the existing infixOperatorNames (such as "for" in Desmos) have the same treatment, so (t,t) for -1 < t < 1 contains "for negative 1 less than" instead of "for minus 1 less than."

Before/after comparing spacing (less space after "negative") before after