As explained in this EmacsWiki article, you can append stuff to an input method like this:
(let ((quail-current-package (assoc "TeX" quail-package-alist)))
(quail-define-rules ((append . t))
("_i" ?ᵢ)
("^\\alpha" ?ᵅ)))
I also find it convenient to use ;
instead of the cumbersome \
as a prefix for my symbols, so I do the following
(let ((quail-current-package (assoc "TeX" quail-package-alist)))
(quail-defrule ";" (quail-lookup-key "\\")))
Finally, note that the file ac-math.el contains a list of unicode math characters and the corresponding TeX macro names, and can be easily changed into a new and much more complete TeX-esque input method (I can even type \gamma\dot
to get γ̇.)
ADDENDUM Using the new package math-symbol-lists (available on MELPA) one can define a comprehensive mathematical input method as follows:
(package-initialize)
(require 'math-symbol-lists)
(quail-define-package "math" "UTF-8" "Ω" t)
(quail-define-rules ; whatever extra rules you want to define...
("\\from" #X2190)
("\\to" #X2192)
("\\lhd" #X22B2)
("\\rhd" #X22B3)
("\\unlhd" #X22B4)
("\\unrhd" #X22B5))
(mapc (lambda (x)
(if (cddr x)
(quail-defrule (cadr x) (car (cddr x)))))
(append math-symbol-list-basic math-symbol-list-extended))
To activate the input method, type C-u C-\ math RET
. Then, typing \mscrC yields , \lParen yields ⦅, etc.
ADDENDUM 2 There is now a package on Melpa that provides a very comprehensive TeX-like input method.