18

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
LANG=en_GB.utf8
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=

Spin-off question.

1
  • what distribution are you using? this could be an input method issue (uim, xim). Dec 9, 2015 at 17:55

6 Answers 6

19

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.

4
  • 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. Oct 15, 2016 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). Mar 14, 2017 at 14:34
  • 3
    @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! Feb 18, 2018 at 19:55
  • @mariotomo: Excellent help, thank you very much.
    – mpts.cz
    Feb 2, 2021 at 18:51
8

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.

2
  • how do you add a dead_greek to your layout?
    – codeshot
    Aug 5, 2020 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. Aug 5, 2020 at 14:41
7

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.

4
  • 1
    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, 2015 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 Dec 9, 2015 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. Dec 9, 2015 at 17:48
  • This solution didn't work, mariotomo's did. But thanks for the keycodes!
    – d9k
    Oct 26, 2023 at 1:45
3

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

2
  • Nothing happens on my system, it simply types 03a0.
    – peterh
    Jun 15, 2018 at 9:00
  • 1
    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, 2020 at 20:05
2

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)

2
  • 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, 2017 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. Mar 14, 2017 at 19:33
-2

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.

4
  • 1
    Sorry, neither of those work.
    – l0b0
    Dec 8, 2015 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. Dec 9, 2015 at 10:44
  • 5
    Perhaps this is from github.com/kragen/xcompose
    – Mikel
    Sep 3, 2016 at 20:14
  • That''s the digraph sequence in vim. The vim help says it's RFC 1345.
    – JohnLittle
    Sep 27, 2021 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .