allow custom template for pdf and beamer