Fix bug #8563 with TeX input method.