Added support for latex documents