Hacker News new | ask | show | jobs
by devereaux 3196 days ago
For vectors, they already exist in Unicode as combining characters so nothing fancy is needed. Just map one of your keys to U+20d7 and use that as you would with an "accent", like the French acute or the German umlaut. Cf http://www.fileformat.info/info/unicode/char/20d7/index.htm

For matrices, here is how you can do it Mathematica style : a (ctrl-enter) b will put b vertically under a, "matrix style". Do it a few times if you need a few rows. (ctrl-), creates additional columns. You need a grammar, with say separators of records, but it wouldn't be hard to defie, and there are already characters for that.

FYI, if you want a above b, but for the fraction a/b, use (ctrl-/) : it will likewise put one above the other, but separated by a bar

This isn't rocket science. It already works in Mathematica. It just requires defining combining characters and a grammar -- or instead of reinventing the wheel, we could reuse something like Mathematica's grammar, which is already quite efficient at that.

Of course, for more complex math, more combining characters will be needed. I just wanted to show here how it would be possible to support most of the casual math notation with a dozen Unicode combining characters.