A Clojure library designed to let you painfully write easily readable math.
Binet's Fibonacci Number Formula:
(defn binet-fib [n]
(/ (- (ⁿ φ n)
(ⁿ (- φ) (- n)))
(√ 5)))
(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))))))
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.
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>
orM-x insert-char
, which will prompt you for a character name or hexadecimal code point.C-\
orM-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 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.
It's almost certainly a bad idea to use this, but it's fun.
Copyright © 2013 Matthew Adereth
Distributed under the Eclipse Public License, the same as Clojure.