Generating a nice-looking PDF with Pandoc

Pandoc is one of my favourite tools in the world. If you haven’t come across it before, it converts between more or less any two document formats. I use it a lot with MarkDown and ReStructuredText so that I can produce content efficiently and then share it in a way that looks nice, but also to get word documents into cleaner formats. However the PDF output has always looked a little bit … dated? (this is rich from an rst2pdf maintainer I know!) and I was recently delighted to find some tricks that resulted in a better PDF. I’m sharing them here, so I can find them again in the future; you are welcome to use them too, of course! Continue reading

Generating HTML from Markdown with Pandoc

I’m writing more and more things that are not code these days, and my content-managing toolchains are becoming more developed all the time. I’ve written in REstructured Text, Asciidoc, and LaTeX, and today I’m working on an article which eventually wants to be HTML but I’m creating in Markdown because it’s much easier.

My swiss army knife of document formats is a program called pandoc. It’s absolutely fabulous, powerful, and not too complicated if you don’t need to do anything too complicated. It will guess input and output formats from file extensions, or you can be more specific if you need to. Today’s command looks like this:

pandoc article.md -o article.html

You won’t be surprised to hear that this command takes a file called article.md which contains my markdown, and outputs a file called article.html containing the HTML. I also use this to convert between all the various text markups, HTML, but also PDF and office document formats – it’s a very comprehensive tool!