22

I want to input:

  • Celsius degree symbol
  • Common Greek letter: Alpha, Theta, Omega
Nick
  • 4,423
  • 4
  • 24
  • 41
  • 4
    -1: Please do some background research prior to posting. A [google search for "emacs greek letters"](https://www.google.com/?gws_rd=ssl#q=emacs+greek+letters) turns up the aptly titled [S.O. thread "How to enter Greek characters in Emacs"](http://stackoverflow.com/questions/10192341/how-to-enter-greek-characters-in-emacs) as the first hit. A [google search for "emacs special characters"](https://www.google.com/?gws_rd=ssl#q=emacs+special+characters) or ["emacs unicode"](https://www.google.com/?gws_rd=ssl#q=emacs+unicode) turns up tutorials, the EmacsWiki, and the manual. – Dan Dec 22 '14 at 15:33
  • See also https://emacs.stackexchange.com/q/23887/15748 – Basil Aug 04 '18 at 12:30

4 Answers4

26

The standard Emacs way to do this is C-x 8 RET followed by either the Unicode code point (a natural number) or the Unicode name of the character. Completion is available for the name.

If you use library Icicles then you can complete the name using parts of it, with multiple patterns matching different parts, if you want. And you can see the characters themselves, next to their candidate names, in buffer *Completions*.

For example, C-x 8 RET cels S-RET completes to DEGREE CELSIUS 2103 ℃ and inserts that character, .

Drew
  • 75,699
  • 9
  • 109
  • 225
21

If you are familiar with TeX, you will find the TeX input method helpful. Just do

M-x set-input-method TeX

then type something like \alpha — it will be replaced with the corresponding Unicode character. You can switch the input method off by typing C-\.

You can find all the supported TeX commands with

M-x describe-input-method
jch
  • 5,680
  • 22
  • 39
  • 1
    Yes, I know some TeX. This method solved all the math symbol in a unified manner as well. Thank you! – Nick Dec 23 '14 at 00:28
8

In addition to C-x 8 RET, mentioned here that lets you insert any character by name, C-x 8 also has many shortcuts for inserting common characters. In this case, C-x 8 o inserts "°". See them all with C-x 8 C-h

The C-x 8 keymap is also a good place to define your own shortcuts to insert the characters you use most often. The Greek letters aren't bound to keys by default, but we can add them with lines like

(global-set-key (kbd "C-x 8 a") (lambda () (interactive) (insert "α")))

which will make C-x 8 a insert a GREEK SMALL LETTER ALPHA. I got the initial alpha in the global-set-key line by using C-x 8 RET and searching for "alpha"

erikstokes
  • 12,686
  • 2
  • 34
  • 56
2

I'm using this:

(defun helm-insert-char ()
  (interactive)
  (helm :sources
      `((name . "Unicode char name")
        (candidates . ,(ucs-names))
        (action . insert))))
abo-abo
  • 13,943
  • 1
  • 29
  • 43