RRC|BIOSTATISTICS

Knitting With Pandoc: Playing Nice With Emacs and R

Whoops, your Linuxmachine can’t find pandoc and let you make beautiful documents. Here’s how to figure out what’s happening:

Go to your terminal and enter:

1
which pandoc

And you should get the folowing paths:

1
2
3
~/.cabal/bin/pandoc
~/Library/Haskell/bin
C:\\PROGRA~1\\Pandoc\\bin\\pandoc.exe

You can get fancy when you’re knitting and calling pandoc to use the system() command or M-x eshell if you’re feeling frisky. More often than not, you get this error message:

1
2
system("pandoc edaupdated.md -o edaupdated.pdf -H ~/Documents/margins.sty")
sh: 1: pandoc: not found

But when you go to the terminal, pandoc is still there and functions perfectly. This is happening because its not sure about the path:

1
system("/home/user/.cabal/bin/pandoc edaupdated.md -o edaupdated.pdf -H ~/Documents/margins.sty")

When you locate the path (with which pandoc) mentioned earlier then enter in this way, now your pandoc functions as its supposed to.

Comments