moved LaTeX macros to the preamble, following Jim Phillips suggestion