Converting Latex to Markdown

I’m applying for a job, which requires me to submit a plain text version of my resumé. As I maintain my CV as a latex document, I wanted to find a simple way to convert it to Markdown format so that it will look good when cut/paste into the web browser.

I use pandoc all the time for document conversion, but I found that because of some heavy layout tweaks to make my CV look good (I’m not using a style file), the markdown produced using

pandoc cv.tex -o

is pretty gross.

After a bit of googling, I found out about the htlatex utility (found here, and it’s included with TexLive), and which does a fantastic job at converting Latex to HTML:

htlatex cv.tex "xhtml, mathml, charset=utf-8" " -cunihtf -utf8"

Then, use pandoc to convert from HTML to Markdown with:

pandoc cv.html -o

This leaves a few small things to clean up with further scripting (such as stray /s), but altogether a nice looking Markdown file.


2 thoughts on “Converting Latex to Markdown

  1. clarkrichards Post author

    Note: the stray “\”s can be taken care of with our good friend sed, by doing something like:

    sed 's/\\//g' >

    I use a Makefile to run the commands, for which I specify a target like:

        htlatex cv.tex "xhtml, mathml, charset=utf-8" " -cunihtf -utf8"
        make html
        pandoc cv.html -o
        sed 's/\\//g' >

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s