Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Clojure library designed to let you painfully write easily readable math.
Clojure
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
src/unicode_math
test/unicode_math
.gitignore
README.md
project.clj Bumping version

README.md

unicode-math

A Clojure library designed to let you painfully write easily readable math.

Examples

Binet's Fibonacci Number Formula:

(defn binet-fib [n]
  (/ (- ( φ n)
        ( (- φ) (- n)))
     ( 5)))

de Morgan's Laws:

(assert ( [p [true false] q [true false]]
             (= (¬ ( p q))
                ( (¬ p) (¬ q)))))

Inclusion-Exclusion Principle:

(assert (= (count ( A B))
           (+ (count A)
              (count B)
              (- (count ( A B))))))

Usage

Add the following to your project.clj:

[unicode-math "0.2.0"]

The full list of implemented symbols is in src/unicode_math/core.clj.

Unicode in your editor

Emacs

Emacs has simple Unicode support out of the box. I recommend reading Xah Lee's Emacs & Unicode Tips to learn all of the functionality, but the critical commands are:

  • C-x 8 <return> or M-x insert-char, which will prompt you for a character name or hexadecimal code point.
  • C-\ or M-x toggle-input-method, which will prompt you for an input method name the first time and then toggle between your current input method and the one that you specify. I use the "greek-babel" input method, as I'm frequently using Greek letters as variables in formulas.
  • M-x describe-char, which will display the character code and full Unicode name in the Help buffer.

Vim

Vim users can use the digraph functionality to quickly insert most of the Unicode characters used in unicode-math. Many of the digraphs for math symbols will serve you well when using unicode-math. For the characters that don't have digraphs, CTRL-V can be used.

Disclaimer

It's almost certainly a bad idea to use this, but it's fun.

License

Copyright © 2013 Matthew Adereth

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.