Pinyin with Tone Marks in Mac OS

What’s Pinyin?

As you may or may not know, Pinyin is the system used to transcribe Chinese characters phonetically. This is actually one of the first things Chinese children learn at school because it is considerably easier compared to the task of learning thousands of characters. For the same reason Pinyin is also the first thing that foreigners learning Chinese study in textbooks and classes.

Pinyin uses the Latin alphabet but has somewhat different pronunciation rules compared to English. In addition, since Mandarin Chinese is a tonal language—i.e., word meaning depends on tone (intonation)—there are tone marks on top of most vowels to indicate the tone used to pronounce each character. There are four tones plus a neutral one: ā, á, ǎ, à, and a. For example, 你好 (hello) is spelled as nǐ hǎo, while 电脑 (computer) is spelled as diàn nǎo.

Typing Pinyin

Typing Pinyin is easy except for the tone marks. There are some ways to do that in macOS. For example, you can use the ABC – Extended keyboard layout that covers not only Chinese tone marks but also accents used in other languages. I didn’t like this much since the keyboard shortcuts are not intuitive. Instead, I made my own keyboard layout where you simply press Control-1 before a vowel to indicate 1st tone, Control-2 for 2nd tone, and so on:

  • ā = Control-1, then “a”
  • á = Control-2, then “a”
  • ǎ = Control-3, then “a”
  • à = Control-4, then “a”

Additionally, there is special handling of “v” which is used as ü in Pinyin. Again, you can use Control-1 to Control-4 to add tone marks, or Control-5 for the ü symbol without a tone mark. Now you can easily type 女儿 (daughter) as nǚ ér.

Installation

To set up and use my Pinyin keyboard layout follow the instructions below:

  • Download the GB-Pinyin ZIP file
  • Extract the contents to the Desktop
    • Just one GB-Pinyin bundle file
  • Navigate to the Library folder:
    • Open Finder and click on the Go menu
    • Hold down the Option key while the Go menu is open
    • Select the Library folder that appears
  • Open the Keyboard Layouts folder inside the Library folder
  • Copy the GB-Pinyin bundle file inside Keyboard Layouts

Next, go to the Keyboard section of System Preferences, select Input Sources, and add GB-Pinyin to the list:

Finally, select GB-Pinyin as the active keyboard input source using the keyboard icon in the top right of the macOS menu bar. Now you can use the key combinations mentioned above to enter tone marks. Enjoy!