Add support for math equations
Refactor title definition to ensure variable is set