new function write_latex_definitions closes #478