Add support for md
Refactor and add feature for tex and tex_pdf