Framework for formatting simple math expression, with backends for REPL and LaTeX