# How to Type the Pi Symbol



## masayoshi (Feb 11, 2013)

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`

```
setenv LANG en_US.UTF-8
setenv LC_CTYPE  ja_JP.UTF-8
```


----------



## Beastie (Feb 11, 2013)

You setup a compose key. To use it press and release your compose key (don't hold it), then type 'p', then 'i'.

If you mean on a virtual terminal without X, then I have no idea.


----------



## jrm@ (Feb 11, 2013)

This solution is for X.  

In ~/.Xmodmap make the semicolon key a dead key.  
	
	



```
keysym semicolon = dead_horn colon
```

In ~/.XCompose make dead-horn p the pi character.  
	
	



```
<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.  

```
<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.

```
<dead_horn> <dead_horn> : ";"
```

With a dead key you can fun with lots of composed keys.

```
# 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> : "Â¶"
```


----------



## AlexJ (Feb 11, 2013)

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}'`


----------

