I have a bunch of tutorials I have written and they are written in Latex. Now I want to convert them to HTML and to Blogger also.

I heard about Pandoc and decided to try it. Below are my results :

My original latex file : https://github.com/abidrahmank/OpenCV2-Python-Tutorials/blob/master/thresholding/threshold.tex

HTML created from that file : https://github.com/abidrahmank/OpenCV2-Python-Tutorials/blob/master/thresholding/threshold.html

Below is the command I used to create HTML :

pandoc -s  --listings --latexmathml threshold.tex -o threshold.html

Problem 1 :

If you check the HTML file, you can see there are some latex labels and parameters printed out near images and equations. How to avoid that?

Problem 2 :

There is no code highlighting. How can I add code highlighting in HTML?

Problem 3 :

When I copied this HTML to blogger, it doesn't work. How can I create a blogger friendly HTML file using Pandoc.

Problem 4 :

Is there any other better option other than Pandoc ?

  • 2
    for 4) try htlatex threshold "xhtml, mathml, charset=utf-8" " -cunihtf -utf8"
    – michal.h21
    Commented May 19, 2013 at 8:10
  • @michal.h21 : that is great, It looks better than pandoc. But a plenty of extra files are created. Pandoc has a --standalone option for that. anything like that for htlatex? Commented May 19, 2013 at 8:14
  • do you mean files with extensions like .lg, .4tc, 4ct, etc.? There is no option to not generate them, but you can delete them with some script
    – michal.h21
    Commented May 19, 2013 at 9:46
  • A better option is to write in markdown and then convert to html and latex with pandoc. I've found that gives better results. Also, writing in markdown is simpler for simple files. I realise that's not helpful for the current situation...
    – Seamus
    Commented May 19, 2013 at 10:02
  • This looks to be essentially a Pandoc issue, so off-topic for us.
    – Joseph Wright
    Commented Aug 3, 2014 at 18:51


Browse other questions tagged .