**What to Do**

- Reduce the work in postfixing by converting to canonical operations. So "Math.sin(", "math.sin(", "\sin(", and "sin(" all become "sin(".
- Parse lots of LaTeX.

**What Not to Do**

- Don't do anything that can more easily be done while postfixing.
- Don't do anything that makes the output hard for humans to understand.

**Steps**

- Simple 1-to-1 substring replacements with important whitespace.
- x in y becomes x∈y

- Handle any complex replacements before whitespace removal.
- Remove whitespace.
- Simple 1-to-1 substring replacements.
- \alpha becomes α
- Math.sin becomes sin

- Handle any complex replacements.
- \frac{1}{2} becomes (1)/(2)
- LaTeX matrices become arrays.