How to Type the Pi Symbol

I would like to type the Pi Symbol (Ï€ = 3.14). If I use Japanese input method, I can type it. If I don't use any Japanese input method, how should I do? I tried "Alt + 227" on my FreeBSD, it didn't work. Without X Window System, can I type the Pi Symbol?

I use US keyboard.

% less .cshrc
Code:
setenv LANG en_US.UTF-8
setenv LC_CTYPE  ja_JP.UTF-8
 
This solution is for X.

In ~/.Xmodmap make the semicolon key a dead key.
Code:
keysym semicolon = dead_horn colon

In ~/.XCompose make dead-horn p the pi character.
Code:
<dead_horn> <p> : "¶"

But now that semicolon has been mapped to dead_horn we have no semicolon key. In English, semicolons are only used when followed by a whitespace character. Add the following lines to get a semicolon when dead-horn space or dead-horn return is typed.
Code:
<dead_horn> <space> : "; "
<dead_horn> <Return> : ";\n"

In case you really want a semicolon without a trailing whitespace put this line in ~/.XCompose to get a semicolon when you hit dead_horn dead_horn.
Code:
<dead_horn> <dead_horn> : ";"

With a dead key you can fun with lots of composed keys.
Code:
# acute
<dead_horn> <a> <e> : "é"
<dead_horn> <a> <E> : "É"

# cedilla
<dead_horn> <d> : "ç"
<dead_horn> <d> : "Ç"

# circumflex
<dead_horn> <c> <a> : "â"
<dead_horn> <c> <A> : "Â"
<dead_horn> <c> <e> : "ê"
<dead_horn> <c> <E> : "Ê"
<dead_horn> <c> <i> : "î"
<dead_horn> <c> <I> : "ÃŽ"
<dead_horn> <c> <o> : "ô"
<dead_horn> <c> <O> : "Ô"
<dead_horn> <c> <u> : "û"
<dead_horn> <c> <U> : "Û"

# grave
<dead_horn> <g> <a> : "à"
<dead_horn> <g> <A> : "À"
<dead_horn> <g> <e> : "è"
<dead_horn> <g> <E> : "È"
<dead_horn> <g> <u> : "ù"
<dead_horn> <g> <U> : "Ù"

# 
<dead_horn> <s> : "ß"

# diaeresis (tréma, ümlaut)
<dead_horn> <t> <a> : "ä"
<dead_horn> <t> <A> : "Ä"
<dead_horn> <t> <e> : "ë"
<dead_horn> <t> <E> : "Ë"
<dead_horn> <t> <i> : "ï"
<dead_horn> <t> <I> : "Ï"
<dead_horn> <t> <o> : "ö"
<dead_horn> <t> <O> : "Ö"
<dead_horn> <t> <u> : "ü"
<dead_horn> <t> <U> : "Ü"

# currency
<dead_horn> <u> <1> : "¢"
<dead_horn> <u> <2> : "€"
<dead_horn> <u> <3> : "£"
<dead_horn> <u> <4> : "Â¥"

# math / science symbols

<dead_horn> <minus> : "÷"
<dead_horn> <equal> : "×"
<dead_horn> <underscore> : "±"
<dead_horn> <8> : "•"
<dead_horn> <0> : "°"
<dead_horn> <5> : "‰"
<dead_horn> <p> : "¶"
 
I don't screw up my head with remembering exotic key combinations for such rare for me cases, but usually ask google for such unique characters and when it bring something like http://en.wikipedia.org/wiki/Pi_(letter) I simply select and copy/paste such symbols over SSH sessions(where I work mostly) to editor on other end.

Another way, if there no internet connections is to generate such symbols on the fly.
Write your text by placing your own pseudo Pi code (such as {Pi} for example) in place where you need a Pi and then filter your text through a filter like

# echo " bla bla {Pi} bla bla" | awk '{gsub("\{Pi\}","\xCF\x80"); print}'
 
Back
Top