Hacker News new | ask | show | jobs
by dfc 5232 days ago
If you like markdown you will LOVE using pandoc. I can't stress how wonderful things have been since I moved to pandoc.

http://johnmacfarlane.net/pandoc/

4 comments

My favorite thing about Pandoc is its LaTeX transparency. You can just throw some TeX in there and it will pass it through.

Of course doing this bypasses the possibility of easily converting to HTML, but I've started many research papers writing in Markdown, which has less, let's say, "markup overhead" than LaTeX, previewing the results using pandoc's markdown2pdf utility. Then later when I'm ready to use the proper article template it's an easy step to convert to tex and insert it in the template. It's a nice way to initially not worry about formatting while writing the draft, but pandoc's TeX transparency allows to you insert figures and math-mode markup and still keep the rest of the document in markdown, so it's brilliant.

Also with a little regex script to change "section" into "slide" it's trivial to use markdown and pandoc for generating Beamer presentations, which is way nicer than writing them directly in tex, because of all the enumeration/itemize sections.

With a little script? Have you seen the recent pandoc+beamer integration?
To elaborate: in pandoc 1.9 you can just do:

    pandoc -t beamer -o presentation.pdf
Hadn't seen that, thanks!
I love pandoc too, and there are three things that would make me absolutely giddy if they were added:

1) Proper reference support. In LaTeX you can use things like \ref{fig:foo} to insert autonumbers for things like Figure X and Table Y. (Which is awesome, because if you move a figure, you don't have to change all of your numbers around.) There's no Pandoc markdown equivalent, so this gets lost if I convert to e.g. HTML. I have to work around this with a script that looks for this LaTeX snippet and does the counters before passing to Pandoc.

2) Better footnote output for LaTeX. Right now, if you use a [^foo] footnote mark twice, you will get two \footnote{}'s in your LaTeX (and therefore a repeated footnote message in your output) instead of a \footnotemark for the second one.

3) Better metadata. Both Jekyll and MMD are so much more flexible about the metadata you add at the top of a document; Pandoc seems to think the only items I'll ever need are author, title, and date. If I could only add things like addresses, enclosures, salutation lines, and extra variables my templates could adjust to, I could produce more sensible templates for formats like business letters.

All my notes, like this one: http://notes.ceondo.com/mongrel2-zmq-paas/ are both available as HTML and PDF thanks to Pandoc. I really really recommend it. It is robust and extremely fast.
Many thanks for the link to pandoc. This is incredibly helpful.