Writing

Recipe: How-to install Pandoc on OS X 10.6.x (Snow Leopard)

In case you wonder how-to install Pandoc, the “universal document converter” on OS X Snow Leopard…

… the secret sauce: go for Haskell Platform installer instead of following your standard (assumption!) installation approach using MacPorts.

The steps:

  1. First install Haskell Platform.
  2. cabal update
  3. cabal install cabal-install
  4. cabal install pandoc
  5. Update your ~/.profile file with export PATH=/Users/[USERNAME]/.cabal/bin:$PATH and read in with source ~/.profile.

What is Pandoc? Great you asked! ;)

Pandoc can read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it can write plain text, markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF, RTF, DocBook XML, OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages, and S5 HTML slide shows. PDF output (via LaTeX) is also supported with the included markdown2pdf wrapper script.
– Source and more details: johnmacfarlane.net/pandoc

9 Responses to “Recipe: How-to install Pandoc on OS X 10.6.x (Snow Leopard)”

  1. Maak

    13 May 2010 at 12:17 pm

    thank you for the turotial, only the last part does not work for me: on entering the last step, “source ~/.profile” in the bash terminal, I get an error; /Users/neuscham/.profile: No such file or directory

    anything I can do ?

    Thank you!

  2. Maak

    13 May 2010 at 1:37 pm

    pandoc installed, but textmate returns “/bin/bash: pandoc: command not found” – :-(

  3. matthias

    13 May 2010 at 7:11 pm

    Maak, seems like you did not properly create the .profile file in you user’s home directory. Make sure you create the file, in your case in /Users/neuscham, and execute again source ~/.profile.

  4. Matt Frost

    1 December 2010 at 3:59 am

    Maak (and Matthias, if you are interested),
    You need to add the ~/.cabal/bin path to the rest of the PATH variable in

    “ TextMate -> Preferences -> Advanced Preferences -> Shell Variables

  5. Léo

    4 April 2011 at 12:50 pm

    Thanks for the how-to !

    I just tried to install Pandoc on my Mac (10.6.6), but it seems that step 2 does not work, the build fails…

    Here is the error message :

    cabal: Error: some packages failed to install:
    cabal-install-0.8.2 depends on time-1.1.4 which failed to install.
    random-1.0.0.3 depends on time-1.1.4 which failed to install.
    time-1.1.4 failed during the configure step. The exception was:
    ExitFailure 1

    Any idea to solve that ?

  6. matthias

    10 April 2011 at 5:18 pm

    Hmm, unfort. I can not reproduce on my setup. But it could be an issue due to different cabal version… you might want to check out the solution proposed here: http://trac.haskell.org/haskell-platform/ticket/164

    HTH

  7. Dennis Groves

    7 June 2011 at 1:02 am

    It seems to install the binaries here:

    export PATH=”$HOME/Library/Haskell/bin:$PATH”

    if you put this into your ~/.profile instead everything works..

  8. Jamie Bullock

    22 November 2011 at 2:14 pm

    Thanks for posting the guide, but it doesn’t work for me. Falls over at step ’3′:

    Resolving dependencies…
    Configuring cabal-install-0.10.2…
    Preprocessing executables for cabal-install-0.10.2…
    Building cabal-install-0.10.2…
    : cannot satisfy -package-id HTTP-4000.1.1-0803293cd6c183e64edf1052955fdec1
    (use -v for more information)
    cabal: Error: some packages failed to install:
    cabal-install-0.10.2 failed during the building phase. The exception was:
    ExitFailure 1

  9. Jamie Bullock

    22 November 2011 at 2:21 pm

    UPDATE: since this post is currently the top hit in Google for ‘pandoc OS X’, I thought I’d mention that there is now an installer for pandoc on OS X from the maintainer’s site:

    http://johnmacfarlane.net/pandoc/installing.html

    This was a 52M install as compared to Haskell, which is a 800+M install, so it’s probably the way to go.