mathquill/mathquill — pull request #265 by mjdesa (2014-03-21 09:46:08+00:00)
Title: Add global API fn to make 'sqrt'/'pi' autocommands

The API function lets you specify that certain LaTeX control sequences
(letters only, length at least 2) automatically render when you type
those letters in sequence, without having to type backslash first.

For example, normally to get a SquareRoot you have to type \sqrt and
then space or tab or enter; after MathQuill.addAutoCommands('sqrt'),
you can just type 'sqrt'.

MathQuill.addAutoCommands parses the autocommands list and adds them to
hash set. Letter::createLeftOf checks previously typed text against
this hash set.