This is a solution for using the mimetex library.