Improve IME and LaTeX support