Typing guillemets (angle quotes, «») in Russian and English keyboards

Below is list of methods to enable special typographic symbols.
For Russian en English layouts they are defined in /usr/share/X11/xkb/symbols/typo file (mainly based on the layout proposed by Ilya Birman).

As the result you will get the following symbols:

First keyboard row:

  • ~ NoSymbol , Shift+~ approxeq ;
  • 1 onesuperior ¹, Shift+1 exclamdown ¡;
  • 2 twosuperior ², Shift+2 onehalf ½;
  • 3 threesuperior ³, Shift+3 onethird ;
  • 4 dollar* $, Shift+4 onequarter ¼;
  • 5 U2030 (PER MILLE SIGN) , Shift+5 NoSymbol;
  • 6 uparrow , Shift+6 NoSymbol;
  • 7 ampersand &, Shift+7 questiondown ¿;
  • 8 infinity , Shift+8 oneeighth ;
  • 9 leftarrow , Shift+9 NoSymbol;
  • 0 rightarrow , Shift+0 NoSymbol;
  • - emdash , Shift+- endash ;
  • = notequal , Shift+= plusminus ±;

Second keyboard row:

  • e EuroSign , Shift+e NoSymbol;
  • r registered ®, Shift+r NoSymbol;
  • t trademark , Shift+t NoSymbol;
  • y yen ¥, Shift+y NoSymbol;
  • p acute ´, Shift+p doubleacute ˝;
  • [ bracketleft [, Shift+[ braceleft {;
  • ] bracketright ], Shift+] braceright }.

Third keyboard row:

  • a U0301 (COMBINING ACUTE ACCENT) ́, Shift+a NoSymbol;
  • s section §, Shift+s NoSymbol;
  • d degree °, Shift+d division ÷;
  • f sterling £, Shift+f NoSymbol;
  • j doublelowquotemark , Shift+j singlelowquotemark ;
  • k leftdoublequotemark , Shift+k leftsinglequotemark ;
  • l rightdoublequotemark , Shift+l rightsinglequotemark ;
  • ; leftsinglequotemark , Shift+; minutes ;
  • ' rightsinglequotemark , Shift+' seconds .

Fourth keyboard row:

  • x multiply ×, Shift+x U22C5 (DOT OPERATOR) ;
  • c copyright ©, Shift+c cent ¢;
  • v downarrow , Shift+v U25CA (LOZENGE) ;
  • m U2212 (MINUS SIGN) , Shift+m enfilledcircbullet ;
  • , guillemotleft «, Shift+, less <;
  • . guillemotright », Shift+. greater >;
  • / ellipsis , Shift+/ NoSymbol;

Space:

  • Space nobreakspace , Shift+ Space nobreakspace .

For other languages layouts may vary.
Settings for common desktop environments are presented below.


Ubuntu with Unity and GNOME desktop environments

Ubuntu 14.04 LTS and Ubuntu 16.04 LTS

  1. Launch GNOME Tweaks (installable with sudo apt-get install gnome-tweak-tool, run by gnome-tweak-tool)

    1. Go to Typing
    2. In Miscellaneous compatibility options check Enable extra typographic characters
    3. Close GNOME Tweaks.
  2. Open Keyboard preferences (or unity-control-center keyboard)

    1. Click on Text Entry, then on Keyboard Settings...
    2. Select key in Alternative Characters Key (for example, Right Alt) (note: it is 3rd level)
    3. Back to Text Entry section, select Russian keyboard layout and click small keyboard icon keyboard icon to ensure that we have guillemets («елочки»):

      Guillemets or Елочки in GNOME

    4. Close Keyboard windows.

  3. Use guillemets («елочки») in any application by pressing RightAlt with corresponding keys (Б and Ю; , and .).

Ubuntu 18.04 LTS

  1. Launch GNOME Tweaks (installable with sudo apt-get install gnome-tweaks, run by gnome-tweaks)
    1. Go to Keyboard & Mouse
    2. Click on Additional Layout Options
    3. Expand Miscellaneous compatibility options check Enable extra typographic characters
    4. Close GNOME Tweaks.
  2. Use guillemets («елочки») in any application by pressing RightAlt with corresponding keys (Б and Ю; , and .).

Ubuntu with MATE Desktop Environment (any version)

GUI way

  1. Open System -> Preferences -> Hardware -> Keyboard (or mate-keyboard-properties).
  2. Go to Layouts tab
    1. Click Options
    2. In Key to choose 3rd level choose needed key (for example Right Alt)
    3. In Miscellaneous compatibility options check Enable extra typographic characters
    4. Click Close
  3. Select Russian keyboard layout and click Show to ensure that we have guillemets («елочки»):

    Guillemets or Елочки in MATE

  4. Use guillemets («елочки») in any application by pressing RightAlt with corresponding keys (Б and Ю; , and .).

Terminal way

Use GSettings to set two layouts (us and ru) using Alt+Shift as layout switcher, typographic symbols are enabled RightAlt as 3rd level switch::

gsettings set org.mate.peripherals-keyboard-xkb.kbd layouts "['us', 'ru']"
gsettings set org.mate.peripherals-keyboard-xkb.kbd model "''"
gsettings set org.mate.peripherals-keyboard-xkb.kbd options \
"['grp\tgrp:alt_shift_toggle', 'lv3\tlv3:ralt_switch', 'compat\tmisc:typo']"

Other GUI sessions and terminal

Edit /etc/default/keyboard and add here two parameters as described in man xkeyboard-config:

  • misc:typo to enable extra typographic characters and
  • lv3:ralt_switch to choose typographic symbols with Right Alt:

    XKBOPTIONS="grp:alt_shift_toggle,lv3:ralt_switch"
    

After editing you should update initramfs images to include the new version of configuration file

sudo update-initramfs -k all -u

On the English keyboard the simplest way I have found is this...
Tap Compose then >> (2x > in succession) which gives »
Tap Compose then << (2x < in succession) which gives «