I have the following input methods set up on Ubuntu 20 LTS: English (US), English (Dvorak), Chinese (Intelligent Pinyin), Chinese (hanyu pinyin (m17n)).

I would like to type pinyin with all its available tone marks with the Compose Key, without using the specific input method hanyu pinyin (m17n). Only some of the possible tone marks seem to work with the compose key, and good documentation on this is hard to find or doesn't exist.

Pinyin Tone Marks

In the following examples, replace x with any of the base characters: a, e, i, o, u

  • The 1st tone is the macron: ¯,
    typed with compose + - + x
  • The 2nd tone is the acute: ´,
    typed with compose + ' + x
  • The 3rd tone is the caron: ˇ (note, caron is different from breve),
    typed with compose + < + x (< is shift + ,)
  • The 4th tone is the grave: `,
    typed with compose + ` + x

Actually, it's more complicated than that, because there's one more "base chracter": ü, so in pinyin these sounds are also available: ǖ, ǘ, ǚ, ǜ. These can be combined with adding more modifiers to the compose key, ǘ can be produced with compose + ' + " + u.

When trying all combinations, some of them work, some don't:

1st tone, ¯, macron, supports all but ǖ
 ā: compose - a
 ē: compose - e
 ī: compose - i
 ō: compose - o
 ū: compose - u
 ǖ: ?

2nd tone, ´, acute, supports all
 á: compose ' a
 é: compose ' e
 í: compose ' i
 ó: compose ' o
 ú: compose ' u
 ǘ: compose ' " u

3rd tone, ˇ, caron, only supports e
 ǎ: ?
 ě: compose < e
 ǐ: ?
 ǒ: ?
 ǔ: ?
 ǚ: ?

4th tone, `, grave, supports all
 à: compose ` a
 è: compose ` e
 ì: compose ` i
 ò: compose ` o
 ù: compose ` u
 ǜ: compose ` " u

My questions

  1. Should this actually work? Should I file a bug report? If so; where's the source repo? Who maintains the compose key?
  2. Is it possible to type all pinyin tone marks with the Compose Key? The missing combinations are: ǖ, ǎ, ǐ, ǒ, ǔ, ǚ.
  3. Is it possible to add custom key sequences to the compose key (with a specific dotfile in my homedir for example)? This answer doesn't seem to work since Ubuntu 19: https://askubuntu.com/a/71335/872681

What I do not want:

  • Yet another input method for just the pinyin marks, as described in the Hanyu Pinyin input in this answer: https://askubuntu.com/a/728506/872681
    (I've got this working, it's just not as comfortable as using the compose key.)
  • Use any form of online editor such as: https://www.pinyin-editor.com
  • Use a point-and-click application like the Character Map.

I'm not on Ubuntu but since on Manjaro I had the same characters missing, maybe this will help you:

ǖ: compose _ ü

ǎ: compose c a
ǒ: compose c o
ǔ: compose c u
ǚ: compose c ü

There are other combinations to choose from, which you may find here:

You may even define your own combinations in ~/.XCompose (you can just create it, if it's not there).

include "%L"

<Multi_key> <minus> <udiaeresis> : "ǖ"
<Multi_key> <less> <a> : "ǎ"
<Multi_key> <less> <i> : "ǐ"
<Multi_key> <less> <o> : "ǒ"
<Multi_key> <less> <u> : "ǔ"
<Multi_key> <less> <udiaeresis> : "ǚ"

include "%L" loads the systems compose file from usr/share ....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.