Add functionality to write latex.