Writing math in Unicode with the Compose key

Kragen Javier Sitaker, 2007 to 2009 (2 minutes)

I can write quite a bit of math in a quasi-reasonable way with Unicode combining characters. For example:

This one uses COMBINING OVERLINE; xterm supports this, but Emacs, gnome-terminal, and Firefox 2 don’t:

zz̅ = x² + y² = |z|²

Using for the compose key, I type this as zz•^__ = x•^2 + y•^2 = |z|•^2.)

This one totally abuses it, and it doesn’t look that great in xterm either:

√a̅²̅+̅b̅²̅

That’s •sqa•^__•^2•^__+•^__b•^__•^2•^__, which is kind of a pain, but still kind of cute.

This uses superscript and Greek characters:

θ = tan⁻¹(b/a)

That’s just •*u = tan•^-•^1(b/a). My Greek bindings, which are based on the standard Greek keyboard layout, are adequate for math, but not for typing Greek, because they don’t include accents. And, as you can see, typing things like x³²⁰⁷² is a bit of a pain.

There are logic characters:

∀x ∈ ℤ: ∃y ∈ ℤ: y > x

•AAx •in • Z: •EEy •in • Z: y > x

∀x, y ∈ ℤ: x < y ∨ x = y ∨ x > y

•AAx, y •in • Z: x < y •\/ x = y •\/ x > y

Definition of XOR:

x ⊕ y = x̅y + xy̅

x •(+) y = x•^__y + xy•^__

Or in different notation:

x ⊻ y = ¬x ∧ y ∨ x ∧ ¬y

x •\_/ y = •-,x •/\ y •\/ x •/\ •-,y

I’m not sure if this is any clearer than the C:

x ^ y = ~x & y | x & ~y

And I can write:

f∘g = λx.f(g(x))

f•o*g = •*lx.f(g(x))

Also I have a keybinding for the vector arrow, even though its rendering is pretty suboptimal in every piece of software I have handy:

F⃗ = ma⃗

F•^> = ma•^>

An example from the Zeldovich HiStar paper:

L₁ ⊑ L₂ iff ∀c: L₁(c) ≤ L₂(c).

L•_1 •[= L•_2 iff •AAc: L•_1(c) •<= L•_2(c)

Topics