I'm pretty sure I used to be able to create lowercase pi characters using Composepi (as described on for example fsymbols.com), but it no longer works. My compose key works for other characters (like Composeaa for “å”), so what could be wrong?

I don't have /usr/share/X11/locale/en_GB.utf8/Compose (or ~/.XCompose), is that something which should have been installed/generated? There is a /usr/share/X11/locale/en_US.utf8/Compose; would it be sufficient to symlink that from /usr/share/X11/locale/en_GB.utf8/Compose to fix this?

$ locale

Spin-off question.

  • what distribution are you using? this could be an input method issue (uim, xim). – Klaatu von Schlacker Dec 9 '15 at 17:55

The X11 compose list is typically under /usr/share/X11/locale/ (this location may vary between distributions though), but the Compose file is not necessarily in the directory named after your LC_CTYPE setting. There is a stage of translation of locale names via the file /usr/share/X11/locale/compose.dir. This translation allows many locales to share the same compose file. (Symbolic links would have been another way, but a text file is easier to distribute and works on platforms that don't have symbolic links — X11 exists outside of Unix.) Most locales that use the UTF-8 encoding for a language written in the Latin alphabet use the compose file for en_US.UTF-8, located in en_US.UTF-8/Compose.

In en_US.UTF-8/Compose, the only way to generate U03C0 (GREEK SMALL LETTER PI) is <dead_greek> <p>. There is no <Multi_key> (Compose) sequence. Among the keyboard layouts distributed with X.org, the only one that defines a dead_greek key is the BÉPO layout (a French analog of DVORAK). So there's no way to type π using the Compose key with the default configuration. And the default UK layout doesn't include a way to type π, not even in an XKB variant (a US Mac layout (us(mac)) will give you π on AltGr+P however).

As far as I can tell, there's never been a standard Compose sequence to insert π on Xorg. If you remember one, you might have been an input method other than X11's built-in mechanism.

| improve this answer | |
  • how do you add a dead_greek to your layout? – codeshot Aug 5 at 14:16
  • @codeshot Pick a key and bind it. If you want to change a single key, it's easier to do it with xmodmap than with xkb. – Gilles 'SO- stop being evil' Aug 5 at 14:41

as others remark, there are no standard compose rules in X for π, so if you want to use compose to make the π symbol (as I just did), you could:

  • install uim
  • create ~/.XCompose
  • put there the rules you need
  • do not forget to start the file with include "%L"

mine looks like this:

include "%L"

<Multi_key> <l> <l>                 : "ℓ"   U2113     # litre symbol
<Multi_key> <p> <i>                 : "π"   U03C0     # GREEK SMALL LETTER PI

this works on Debian. it does affect the way Ctrl-Shift-u works.

| improve this answer | |
  • That doesn't seem to work for me using xorg server 1.17.4 on Gentoo. I used exactly the contents above, started a new terminal, used the compose key, and pi didn't show up. – Pavel Šimerda Oct 15 '16 at 23:11
  • 2
    @PavelŠimerda Sorry to post on an old comment. Did you reload your DE/DM (there might be a more elegant way to do it, but I am not aware of it; as far as I know X is the one handling the Compose bindings). – omninonsense Mar 14 '17 at 14:34
  • 2
    @omninonsense My only problem was that I used .Xcompose instead of .XCompose. Reloading Xorg or WM is not necessary, it's read at the start of a client, i.e. a web browser or a console. Thanks! – Pavel Šimerda Feb 18 '18 at 19:55

This isn't super convenient, but it works:

If you look in your Compose file for the 'pi' symbol:

% grep -i greek /usr/share/X11/locale/en_US.UTF-8/Compose | grep -i 'letter pi'
<dead_greek> <P>            : "Π"   U03A0    # GREEK CAPITAL LETTER PI
<dead_greek> <p>            : "π"   U03C0    # GREEK SMALL LETTER PI

You see that the combination for lowercase π is U03C0

So if you press ControlShiftu and then type in 03c0 Space, you are left with a π symbol.

The other way that should work is to define a key with xmodmap, but I have had problems with some applications not responding to that.

| improve this answer | |
  • I'm afraid that keyboard shortcut doesn't work (I tried starting with Compose, Shift, u; Compose+Shift+u; Compose, Shift+u; and Compose+Shift, u), and it would be very difficult to memorise. – l0b0 Dec 9 '15 at 7:55
  • 6
    U03c0 means that it's the Unicode character whose code point is 0x03c0. It doesn't mean that the U key is involved in typing it in any way. You can type Control+Shift+U (not Compose+Shift+U) and then enter a hexadecimal code to enter a character by its Unicode code point, but that's a Gnome thing, unrelated to the compose mechanism, and not available outside Gnome applications (except maybe if you're using a Gnome-inspired input method globally, I don't know which ones implement that if any). Cc @l0b0 – Gilles 'SO- stop being evil' Dec 9 '15 at 10:41
  • Changed the answer to control-shift-u. Did not intend to imply that this has anything to do with Compose; using Compose to get the Unicode number, using that to produce π character. As I said, not convenient and not the "right" way but possibly an option. – Klaatu von Schlacker Dec 9 '15 at 17:48

One option is to change your keyboard setup to use the Greek language and then press the "p" (lower case, i.e. with Caps lock off)

| improve this answer | |
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – shirish Mar 14 '17 at 18:52
  • 3
    I didn't critique. I am Greek and having had the same problem writing up some documentations, i ended up using the easiest way possible. – Chris Tsiakoulas Mar 14 '17 at 19:33

Use unicode compose [shift]+[control]+U then 03A0

| improve this answer | |
  • Nothing happens on my system, it simply types 03a0. – peterh - Reinstate Monica Jun 15 '18 at 9:00
  • Hold Shift+Ctrl+u and type 03a0 then for uppercase Pi (Π), type 03c0 for lowercase Pi (π). For me, on Manjaro Linux it works. – stimulate Feb 4 at 20:05

In my (mostly default) configuration, * is the Compose prefix for Greek characters, so a lowercase pi can be Composed with Compose * p.

Other configurations include more visual constructions, though, so you might also see whether Compose"~ works.

| improve this answer | |
  • 1
    Sorry, neither of those work. – l0b0 Dec 8 '15 at 0:07
  • 1
    Not in any of the Compose tables that come with X11. Maybe there's some other input method that offers this combination, but this answer isn't useful if you don't specify which. – Gilles 'SO- stop being evil' Dec 9 '15 at 10:44
  • 5
    Perhaps this is from github.com/kragen/xcompose – Mikel Sep 3 '16 at 20:14

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.