38

I'm trying to put in an email the temperature outside in degrees. On my Mac, the degree symbol (°) is Option+Shift+8. But I'm writing the email in Thunderbird on an Ubuntu 10.10 with the default US English keyboard layout. What key combination do I use to get the degree symbol under X11?

EDIT: Gert successfully answered the question... but, bonus points for any easier to use keystroke than what's in his answer!

Josh
  • 8,311
  • 12
  • 54
  • 73

11 Answers11

47

Set up a Compose key. On Ubuntu, this is easily done in the keyboard preferences, “Layout” tab, “Options” subdialog. Caps Lock is a good choice as it's pretty much useless (all remotely serious editors have a command to make the selection uppercase for the rare times it's needed).

Press Compose followed by two characters (occasionally three) to enter a character you don't have on your keyboard. Usually the resulting character combines the two characters you type, for example Compose ' a enters á and Compose s s enters ß. The degree symbol ° is one of the less memorable combinations, it's on Compose o o.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • 14
    `Compose` `o` `o` is a lot easier to remember than `Ctrl` `Shift` `u` `B` `0` `enter`. "o" because ° is an o. – Josh Dec 13 '10 at 19:37
  • 3
    +1 voted Keyboard Feature of the Month by the Keyboard Feature of the Month Committee (i.e. me) – msw Dec 14 '10 at 14:02
  • 1
    Following the links, I found this way to "test drive" A Compose key that won't persist when you restart X: `%xmodmap -e "keysym Super_L = Multi_key"` ... Super_L is the left "windows-button" keycode; use `xev` to find any keycode you want. – luser droog Apr 21 '12 at 05:27
  • 3
    At least Ubuntu 18.04 also has `Compose` `*` `0` and `Compose` `0` `*` sequences for `°`. All mappings are in `/usr/share/X11/locale/en_US.UTF-8/Compose`. – lapis May 28 '20 at 23:21
27

Ctrl + Shift + u (this will show an underlined u), and with those keys held down, type the unicode value (in this case B0). Then, with Ctrl + Shift still pressed, press enter. You might find that in the last step, you do not need to press enter, and that you only need release all keys.

Full list here.

markling
  • 183
  • 16
Gert
  • 9,886
  • 3
  • 36
  • 37
  • When I type `` + `` + `` into Thunderbird, I get underline turned on and a "u" character appearing. Then, "B0" just gets typed in also (still underlined) :-( – Josh Dec 13 '10 at 14:53
  • 3
    Follow it by `` – Gert Dec 13 '10 at 14:54
  • Ah ha, that's the key. Really? This is the only way? `Option`+`Shift`+`8` on Mac is so much easier to remember, since `Shift`+`8` is *... – Josh Dec 13 '10 at 14:55
  • You can always set a hotkey or something for this. – Falmarri Dec 14 '10 at 04:00
  • Both yours and Gilles' answers worked, but his was the one I used because it's easier for me to remember. Sorry! +1 anyway though! – Josh Dec 21 '10 at 13:42
13

You can also use Alt Gr+Shift+0.

TafT
  • 101
  • 5
laurent
  • 655
  • 4
  • 7
  • Damn, I am foiled again! It's a laptop keyboard and doesn't have an `Alt GR` key :-( – Josh Dec 13 '10 at 18:20
  • On Ubuntu 16.04 it seems important that Alt Gr is pressed before Shift. If you find the above not working for you make sure your sequencing is correct. – TafT Jan 24 '17 at 09:05
  • @TafT for me it works both ways on Xubuntu 16.04 – jarno Jan 26 '19 at 14:21
6

As a follow-up to @Gert's answer (since I cannot comment yet), I've found a slightly different method is required when using Raspbian Jessie:

with Ctrl and Shift held down, type u B 0 and then release all keys.

patricktokeeffe
  • 249
  • 3
  • 9
  • 3
    how do you type lower u and upper B when you hold shift all the time?? – Youda008 Aug 06 '18 at 16:32
  • Hi, didn't see your comment sorry - with the held down, it will produce a lower case `u` – patricktokeeffe Oct 21 '18 at 23:37
  • 1
    wait, so shift is pressed whole time, but ctrl only for `u` and then released for `B` ? – Youda008 Oct 22 '18 at 08:57
  • 1
    I'm a bit late but someone else may benefit. You press CTRL+SHIFT+U and then b and 0. Then press Enter key or space key also works. You don't have to hold those keys just press once. – Rishab Dec 04 '19 at 06:12
  • ignore case of the u/b/0 keys, just type them, then release ctrl and shift. – RGD2 Apr 12 '22 at 07:36
4

in vi

  • hold down ctrl, press and release v, release ctrl button
  • hit u and release u
  • type 00b0

the ° will appear, continue typing normal characters

this does not work at a shell/terminal prompt, this is in the VI or VIM editor.

ron
  • 5,749
  • 7
  • 48
  • 84
  • (0) Thanks; I didn’t know about that.  (1) You can also type **Ctrl+V u b 0** and then the next character you want to type, as long as it isn’t a hex digit (i.e., 0-9, A-F or a-f).  I.e., you don’t always have to type the leading zeroes.  (2) To type a Unicode character greater than U+FFFF (e.g., , , or ), type Ctrl+V **U** (i.e., Ctrl+V followed by Shift+U) and then up to eight hex digits. – G-Man Says 'Reinstate Monica' Dec 24 '21 at 21:20
  • Simple and good process. – RRMadhav Jun 14 '22 at 07:28
2

ALT+0 works for me (I'm using Gentoo Linux).

Kevin
  • 40,087
  • 16
  • 88
  • 112
paravoid
  • 21
  • 1
2

If you're using the US international keyboard (us_intl), you can do Alt Gr+Shift+;

elias
  • 512
  • 7
  • 17
1

You can find the way to display any symbol using xmodmap:

sh$ xmodmap -pke | grep degre
keycode  19 = 0 parenright agrave 0 braceright degree at degree
#             1      2        3   4      5        6   7   8

For each keycode, it shows what symbol is associated depending on the modifiers:

  1. no modifier
  2. Shift+Key
  3. mode_switch+Key
  4. mode_switch+Shift+Key
  5. AltGr+Key
  6. AltGr+Shift+Key
  7. ???
  8. ???

In that example, I can see "degree" is in 6th position and the plain key (position 1) is 0. So I can obtain the degree by pressing AltGr+Shift+0 in that order: depending on your configuration, if you press Shift first, Shift+AltGr is understood as an emulation of the Meta key which has different bindings.

Sylvain Leroux
  • 649
  • 4
  • 13
0

Yeah, systems vary on this - so do Android keyboards - unless you have Google's Pixel or Nokia, you likely have some custom keyboard, not the default Android one, but so do I - I think both Swype (not available anymore, but I love it even if the skins can't be bought (or bought ones redownloaded anymore), syncing is off, etc. Nuance has dropped support - they have excellent speech recognition system available for various systems, including Android (works as keyboard) that let's you do anything you would be able with keyboard, but they should have kept the lesser version (Dragon, that's why it was called Swype + Dragon), but it's still the only one with selection/editing mode available... BUT I DIGRESS...

On most systems, there's a way to compose characters not on keyboard, and on Linux it can be highly configurable, depending on your desktop environment. For example, I have set it to 4th level of right Ctrl (So AltGr+Right Ctrl). Then I type oo to get degree symbol. There are easily found a whole load of list of characters and keys you can enter them with. I would be surprised if OS X didn't have similar compose key, but not that much if it wasn't configurable. However composing with two 'o' characters is the easiest way to get the degree symbol. The OS X advice relies on entering Unicode value of the character. That's not possible on all system, and very cumbersome to remember, especially if you need more than one composed character, like me with µMatrix/µBlock Origin :D But it does allow entering ANY unicode character, which has it's uses. On Linux you might have to do it on terminal and copy output and paste it to, say, email program. But for common characters, but non-alphabets/numbers composing is easier. Like € and ¢ (well, I don't need compose for euro, but it's "e" and "-"; cent is "c" and "|".

There were many more lacking and some more complicated answers here, so I hope this helps.

robsku
  • 1
  • 2
-1

hold down 'alt' key and while holding it down, hold down the 'shift' key too. and while holding down both of those, hold down the 'u' key. now, release all three. a 'u' with an underscore should appear. now press and release the 'b' key and then press and release the '0' (zero) key. now, press the 'enter' key. a '°' should appear.

-1

This symbol is used to represent degrees in many different fields, such as angle or temperatures. It is obtained by drawing a small circle as a superscript. The Unicode of the icon is U + 00B0.

on Mac:

Using keyboard shortcuts : OPTION + SHIFT + 8

on PC:

Press and hold the ALT key and type 0 1 7 6 on the numeric keypad of your keyboard. Make sure the NumLock is on and type 0176 with the leading zero. If there is no numeric keypad, press and hold the Fn before typing the 0176 numbers of degree symbol.

on iPhone & iPad:

  • Step 1: Click the 123 button on the screen keyboard to open the number keyboard.

  • Step 2: Hold down zero (i.e. 0), and move your finger to choose the degree symbol (i.e. °).

on LaTeX:

gensymb

\usepackage{gensymb}
\begin{document}
The right angle is 90\si{\degree}.
\end{document}

textcomp

\usepackage{textcomp}
\begin{document}
The round angle is 360\si{\textdegree}.
\end{document}

siunitx

\usepackage{siunitx}
\begin{document}
Degree symbol: 45\si{\degree}.
\end{document}

circ

^{\circ}

Check out more: https://www.degree-symbol.com/

  • PC is not an OS/desktop so there is no PC way of entering Unicode characters. There is Windows way, BSD way, Linux, Solaris... also MacOS, you can have Linux installed on older Mac hardware which may use KDE or Gnome or ... – Doncho Gunchev Jan 10 '22 at 10:51
  • question wasn't 'on any platform BUT X11'... – RGD2 Apr 12 '22 at 07:34