Inputting TeX Characters

Ben Maughan has an excellent tip on entering non-standard characters in an Emacs buffer. Mickey had the same tip but it was hidden in a longer article.

The idea is that you switch into TeX input mode and then use the TeX code for the character. For example, if I want a lower case zeta, I merely switch into TeX input mode, type \zeta and I get ζ. If you use TeX or LaTeX a lot and are used to its diacritical support, this is a really useful way of entering characters such as Å. It’s much easier than typing 【Ctrl+x 8 Return】 and then remembering the name of the character.

The meat of the tip is that you can toggle the TeX input mode simply by typing【Ctrl+\】. You don’t have to toggle it for each special character because it looks for the \ to trigger the translation.

The mechanism is more general than just entering TeX. There are several input modes and you can specify the one you want to use by adding a prefix. Since the only input method that makes sense for me is the TeX method, I set it as the default method with

(setq default-input-method 'TeX)

Someone who uses an alternate character set (one of the Chinese sets, say) may want to make that the default method and explicitly specify the TeX input method when they need it.

This entry was posted in General and tagged . Bookmark the permalink.