View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Accented Characters

From LQWiki

Jump to: navigation, search

Contents

Typing Accented and other "foreign language" Characters

There are a number of ways of obtaining accented characters and symbols which are not on the keyboard. Obviously you can only use such a character if there is a least one installed font which contains it.

The AltGr Key

The AltGr key functions like a second Shift key, changing the usage of any key pressed while it is held down. The following account applies to one English-language layout: other systems and languages will differ.

Some characters are produced in two keystrokes: the first indicates that the following character is to be accented, and the second is the character to which the accent is to be applied. The keystroke that produces the accent is called a dead key; the keys that function in this way with AltGr are ;, ', #, [, ] and =.

  • Alt Gr + ; applies an acute (forward-leaning) accent to the next letter: á é í ó ú ý Á É Í Ó Ú Ý ć ń ĺ ŕ ś ź Ć Ń Ĺ Ŕ Ś Ź
  • AltGr + ' applies a circumflex (hat) accent to the next vowel: â ê î ô û Â Ê Î Ô Û.
  • AltGr + \ applies a grave (backward-leaning) accent to the next vowel: à è ì ò ù À È Ì Ò Ù
  • AltGr + [ applies an umlaut or diaeresis (two dots) to the next vowel: ä ë ï ö ü Ä E Ï Ö Ü
  • AltGr + ] applies a tilde to some letters: ã ĩ ñ õ ũ Ã ĩ Ñ Õ
  • AltGr + = applies a cedilla (left hook) or comma under certain letters: ç ģ ķ ļ ņ ŗ ş Ç Ģ Ķ Ļ Ŗ Ş
  • AltGr + shift + ' applies a carom (inverted circumflex) to some letters: č ď ľ ň ř š ť ž Č Ď Ľ Ň Ř Š Ť Ž
  • AltGr + shift + = applies an ogonek (right hook) under some vowels: ą ę į ų Ą Ę Į Ų
  • AltGr + shift + \ applies a breve to a: ă Ă
  • AltGr + shift + [ applies a ring to the next A: å Å
  • AltGr + shift + ] applies a macron to the next vowel: ā ē ī ō ū Ā Ē Ī Ō Ū
  • AltGr + shift + / applies a dot above some letters; ḃ ċ ḋ ė ḟ ġ ṁ ṗ ṫ ż Ḃ Ċ Ḋ Ė Ḟ Ġ Ṁ Ṗ Ṫ Ż

You can check what accent a key produces by pressing it twice. The combinations of accent and character are pre-set and cover the needs of European languages, but not the transliteration of other scripts. There are also some errors, like the omission of ŵ and ţ.

Other characters are produced using a single keystroke. The diagram below shows the relationship between each key and the characters it produces (top row is shifted):

| ¡ ⅛ £ ¼ ⅜ ⅝ ⅞ ™ ± ° ¿ ˛
| ¹ ² ³ € ½ ¾ { [ ] } \ ¸
` 1 2 3 4 5 6 7 8 9 0 - =
  Ω Ł E ® Ŧ ¥ ↑ ı Ø Þ ˚ ¯
  @ ł e ¶ ŧ ← ↓ → ø þ " ~
  Q W E R T Y U I O P [ ]
  Æ § Ð ª Ŋ Ħ J & Ł ˝ ˇ ˘
  æ ß ð đ ŋ ħ j ĸ ł ' ^ `
  A S D F G H J K L ; ' #
  « » ¢ “ ” n µ   · ˙
  < > © ` ' N º × ÷ 
  Z X C V B N M , . /

These combinations can be altered by configuring the keyboard map.

The Compose Key

This is not a Shift key, but is used to signal the operating system that the next two key strokes are to be taken as a code for something else. Thus the sequence Compose + a + e will produce æ.

Some computers (e.g. those from Sun) have a Compose key on their keyboard, but for a PC you must nominate a spare key: one of the Windows keys is the natural choice.

From a desktop like Gnome or KDE, the choice can be made with the system menu. Alternatively, the command xmodmap can be used to define the key as Multi_key.

There appears to be no reliable list of the compose sequences, but the following will work:

To get accented letters, use

  • grave, tilde, circumflex keys
  • apostrophe for the acute
  • double-quote for the dieresis
  • period for the over-dot
  • comma for both the cedilla and ogonek
  • hyphen gives a tilde with ‘aon’ but a macron with ‘eiu’

Other combinations are

aa for å-d for đ.i for ı.I for İng for ŋ
/o for øss for ßth for þae for æoe for œ
co for ©e= for €p! for ¶so for §-y for ¥
 !! for ¡?? for ¿<< for «>> for »/c for ¢
_a for ª_o for º<’ for ‘>’ for ’
^0 for °^2 for ²xx for ×-: for ÷+- for ±

Further information can be found at Wikipedia. Note that compose sequences cannot be altered by the user.

Character Maps

The best-known method of obtaining special characters is selection from a character map, like Gnome's charmap or the one in OpenOffice. The obvious disadvantage is having to know where to look: for Chinese, ‘á’ and ‘à’ are in Latin-1, ‘ā’ is in Latin Extended-A, and ‘ǎ’ in Latin Extended-B! The Gnome map is often worth consulting for its notes and cross-references.

The Gnome Character Palette is a panel applet, described fully in Gnome Help. It enables you to place a number of selected characters, unobtainable from the keyboard, on one or more customised charts, ready for use. Only precomposed character-diacritic combinations can be placed on the palette, but combining diacritics can be put there and applied to the base letters in your text.

Ctrl-Shift-U

This is the last resort. Hold down Ctrl and Shift and enter U40: the result should be @, for which 0040 is the hexadecimal Unicode. I say ‘should be’, for the occasional program will trap the key combination and prevent its use. The obvious drawback is the need to know the code. But if on one occasion you repeatedly need a particular symbol, finding the code and using this method will be quicker than repeatedly picking it out of a character map or putting it on a palette.


Personal tools