# Using Vim Unicode macros to create math formulas at ease

## Jakob Westhoff

I am currently studying a lot of mathematical formulas and other theoretical stuff for some upcoming university exams. I like to take notes on information I am working through to have a structured basis for recapitulation. Normally I take these notes with pen and paper, because it happens quite often that I need to write down a mathematical formula, draw a graph or create all sorts of weird diagrams. I always thought that it would be much easier to write down all this with my favorite editor vim, render the graphs in graphviz and draw the needed diagrams with inkscape. The only thing which prevented me from doing so was the missing functionality of vim to scribble down some formulas. I am aware that I could write latex documents with appropriate formula code, but I am a really big fan of Restructured Text to write down this kind of notes and nearly all other stuff I am documenting. Some days ago I discovered a neat way of achieving my aim. I copied a formula from a pdf document containing slides from a university presentation just into vim. I was really astonished, that evince transliterated most of the formula into the appropriate Unicode representation. Today I found the time to implement a macro mapping for vim which does include the most important mathematical symbols and operators.

I will just append the small documentation of this script below. I hope you will love this as much as I do.

## Unicode Macro Table

Version 0.1

Copyright 2008 by Jakob Westhoff jakob@php.net

Provided under the GPLv3.

This script provides the needed functionality to easily register insert mode macros for useful Unicode characters as well as initial mapping tables for a mostly math oriented background.

### Instructions

Simple source the script inside your .vimrc to register the needed macros. You may then use any macro name listed below with a backslash in front of it, Therefore just typing "\alpha \beta \gamma" in insert mode would give you the Greek letters you want.

You may customize every mapping table to your linkings or add new ones. If you create new tables or extend the ones already present I would be grateful if you could send me a copy of your work, for everyone to benefit from.