template support for math-macros