How to install Pandoc for Windows?
Asked Answered
P

4

8

I have been to their website. I have viewed a YouTube on a related subject. And, so far I don't really get it. My objective is to use Pandoc in conjunction with R Markdown to convert R Markdown HTML document into either Word or Pdf files.

Prewar answered 10/12, 2015 at 22:44 Comment(0)
C
7

You can install pandoc in several ways:

  1. Using the x86 or x64 executable from here and installng like any other Windows app: pandoc downloads

  2. Using the x86 or x64 flavor of the zip file (same link shown above), and unpack it on the folder of your preference. Then, set manually the path to that folder. Pandoc is only a couple of files pandoc.exe and pandoc-citeproc.exe. You may even copy then to your /bin folder of your preference if want to save adding another PATH.

  3. Using the R package installr, and then run installr::install.pandoc(). It will automatically install the Windows msi and add the PATH for you. You may review the user path in environment variables: C:\Users\user_name\AppData\Local\Pandoc\.

Reload the environment variables by restarting your PC.

Commix answered 1/6, 2018 at 5:53 Comment(2)
Are you sure option 3 is correct? I tried to install Pandoc this way under R 4.0.3 on Windows 10. It appeared to work. But, I wanted Pandoc because R's package manager uses it for creating documentation. I was following Hadley Wickham's book on packaging, r-pkgs.org/man.html , and trying to build my vignettes by calling devtools::build_vignettes() . When I did this, R gave me the message "Pandoc (>= 1.12.3) and/or pandoc-citeproc not available".Burlingame
@Phil I will have to check. I wrote this in 2018. With so many updates in the packages I am not sure if it applies today. I will revert to you soon.Commix
U
3

If you have the Chocolatey package manager installed on your Windows machine, you can install the Pandoc package with:

choco install pandoc
Unrig answered 13/1, 2022 at 9:21 Comment(1)
if you get permission errors when trying to install - first open PowerShell terminal as administrator - and then run the above command.Flaviaflavian
C
2

If you have RStudio installed (and most R users do) then you already have a pandoc binary. Maybe just add that directory to your $PATH ?

Condescension answered 10/12, 2015 at 23:35 Comment(2)
Can you flesh out a bit how you would actually install Pandoc. I am not a professional R coder by any means. But, I can learn and get by ok.Prewar
Same as everything else: From source you install the (required and rather involved) Haskell build environment. Else from binary from the Pandoc site. Or else you use somebody else's build -- which is what I suggested here as RStudio ships one. Pandoc is orthogonal to R: It is just yet another tool that can also be used by R.Condescension
S
0

The latest version of Pandoc can be installed using the winget package manager, which is part of Windows 11 and can be installed in Windows 10.

To install Pandoc, open a terminal and type

winget install JohnMacFarlane.Pandoc
Sami answered 3/6, 2024 at 12:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.