documentation module has an attribute "latex_macros" which are copied ad verbatim into the footer of the html pages -- this requires to expose the whole module in the template (good idea!)