3The simplest way to get the latest pandoc release is to use the installer.
5<a href="https://github.com/jgm/pandoc/releases/latest"
6 class="btn btn-primary" id="downloadInstallerBtn">
7 Download the latest installer
10For alternative ways to install pandoc, see below
11under the heading for your operating system.
15There is a package installer at pandoc's [download page].
16This will install pandoc, replacing older versions, and
17update your path to include the directory where pandoc's
18binaries are installed.
20If you prefer not to use the msi installer, we also provide
21a zip file that contains pandoc's binaries and
22documentation. Simply unzip this file and move the binaries
23to a directory of your choice.
25Alternatively, you can install pandoc using
26[Chocolatey](https://chocolatey.org):
30Chocolatey can also install other software that integrates with Pandoc.
31For example, to install `rsvg-convert` (from [librsvg], covering formats
32without SVG support), [Python] (to use Pandoc filters), and
33[MiKTeX] (to typeset PDFs with [LaTeX]):
35 choco install rsvg-convert python miktex
37Using multiple installation methods can result in two separate
38installations of pandoc; it is recommended to properly uninstall
39pandoc before switching to an alternative installation method.
41By default, Pandoc creates PDFs using LaTeX.
42We recommend installing it via [MiKTeX].
46There is a package installer at pandoc's [download page].
47If you later want to uninstall the package, you can do so
48by downloading [this script][uninstaller]
49and running it with `perl uninstall-pandoc.pl`.
51Alternatively, you can install pandoc using
52[Homebrew](https://brew.sh):
56Homebrew can also install other software that integrates with Pandoc.
57For example, to install [librsvg] (its `rsvg-convert` covers formats
58without SVG support), [Python] (to use Pandoc filters), and
59[BasicTeX] (to typeset PDFs with [LaTeX]):
61 brew install librsvg python homebrew/cask/basictex
63Note: On unsupported versions of macOS (more than three releases old),
64Homebrew installs from source, which takes additional time and disk space
65for the `ghc` compiler and dependent Haskell libraries.
67We also provide a zip file containing the binaries and man
68pages, for those who prefer not to use the installer. Simply
69unzip the file and move the binaries and man pages to
70whatever directory you like.
72By default, Pandoc creates PDFs using LaTeX. Because a full [MacTeX]
73installation uses four gigabytes of disk space, we recommend
74[BasicTeX] or [TinyTeX](https://yihui.org/tinytex/)
75and using the `tlmgr` tool to install additional packages
76as needed. If you receive errors warning of fonts not found:
78 tlmgr install collection-fontsrecommended
82Check whether the pandoc version in your package manager is
83not outdated. Pandoc is in the [Debian], [Ubuntu], [Slackware],
84[Arch], [Fedora], [NiXOS], [openSUSE], [gentoo] and [Void] repositories.
86To get the latest release, we provide a binary package for amd64
87architecture on the **[download page]**.
89The executable is statically linked and
90has no dynamic dependencies or dependencies on external
91data files. Note: because of the static
92linking, the pandoc binary from this package cannot use lua
93filters that require external lua modules written in C.
95Both a tarball and a deb installer are provided. To install the deb:
99where `$DEB` is the path to the downloaded deb. This will
100install the `pandoc` executable and man page.
102If you use an RPM-based distro, you may be able to install
103the deb from our download page using `alien`.
105On any distro, you may install from the tarball into `$DEST`
106(say, `/usr/local/` or `$HOME/.local`) by doing
108 tar xvzf $TGZ --strip-components 1 -C $DEST
110where `$TGZ` is the path to the downloaded zipped tarball.
111For Pandoc versions before 2.0, which don't provide
112a tarball, try instead
114 ar p $DEB data.tar.gz | tar xvz --strip-components 2 -C $DEST
116You can also install from source, using the
117instructions below under [Compiling from source].
118Note that most distros have the Haskell platform in their
119package repositories. For example, on Debian/Ubuntu,
120you can install it with `apt-get install haskell-platform`.
122For PDF output, you'll need LaTeX. We recommend installing
123[TeX Live](https://www.tug.org/texlive/) via your package
124manager. (On Debian/Ubuntu, `apt-get install texlive`.)
128On Chrome OS, pandoc can be installed using the
129[chromebrew](https://github.com/skycocker/chromebrew) package manager
136This will automatically build and configure pandoc for the specific
141Pandoc is in the [NetBSD] and [FreeBSD ports] repositories.
145The official Docker images for pandoc can be found at
146<https://github.com/pandoc/dockerfiles> and at
147[dockerhub](https://hub.docker.com/).
149The [pandoc/core](https://hub.docker.com/r/pandoc/core)
150image contains `pandoc`.
152The [pandoc/latex](https://hub.docker.com/r/pandoc/latex)
153image also contains the minimal LaTeX installation needed
154to produce PDFs using pandoc.
156To run pandoc using Docker, converting `README.md` to `README.pdf`:
158 docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/latex README.md -o README.pdf
162Pandoc can be run through
163[GitHub Actions](https://github.com/features/actions). For some
164examples, see <https://github.com/pandoc/pandoc-action-example>.
166## Compiling from source
168If for some reason a binary package is not available for your
169platform, or if you want to hack on pandoc or use a non-released
170version, you can install from source.
172### Getting the pandoc source code
174Source tarballs can be found at
175<https://hackage.haskell.org/package/pandoc>. For example, to
176fetch the source for version 1.17.0.3:
178 wget https://hackage.haskell.org/package/pandoc-1.17.0.3/pandoc-1.17.0.3.tar.gz
179 tar xvzf pandoc-1.17.0.3.tar.gz
182Or you can fetch the development code by cloning the repository:
184 git clone https://github.com/jgm/pandoc
187Note: there may be times when the development code is broken
188or depends on other libraries which must be installed
189separately. Unless you really know what you're doing, install
190the last released version.
192### Quick stack method
194The easiest way to build pandoc from source is to use [stack][stack]:
1961. Install [stack][stack]. Note that Pandoc requires stack >= 1.7.0.
1982. Change to the pandoc source directory and issue the following commands:
203 `stack setup` will automatically download the ghc compiler
204 if you don't have it. `stack install` will install the
205 `pandoc` executable into `~/.local/bin`, which you should
206 add to your `PATH`. This process will take a while, and
207 will consume a considerable amount of disk space.
209### Quick cabal method
2111. Install the [Haskell platform]. This will give you [GHC] and
212 the [cabal-install] build tool. Note that pandoc requires
213 GHC >= 7.10 and cabal >= 2.0.
2152. Update your package database:
2193. Check your cabal version with
223 If you have a version less than 2.0, install the latest with:
225 cabal install cabal-install
2274. Use `cabal` to install pandoc and its dependencies:
231 This procedure will install the released version of pandoc,
232 which will be downloaded automatically from HackageDB.
234 If you want to install a modified or development version
235 of pandoc instead, switch to the source directory and do
236 as above, but without the 'pandoc':
2405. Make sure the `$CABALDIR/bin` directory is in your path. You should
241 now be able to run `pandoc`:
245 [Not sure where `$CABALDIR` is?](https://wiki.haskell.org/Cabal-Install#The_cabal-install_configuration_file)
2475. By default `pandoc` uses the "i;unicode-casemap" method
248 to sort bibliography entries (RFC 5051). If you would like to
249 use the locale-sensitive unicode collation algorithm instead,
250 specify the `icu` flag (which affects the dependency `citeproc`):
252 cabal install pandoc -ficu
254 Note that this requires the `text-icu` library, which in turn
255 depends on the C library `icu4c`. Installation directions
256 vary by platform. Here is how it might work on macOS with Homebrew:
259 stack install pandoc \
260 --flag "citeproc:icu" \
261 --extra-lib-dirs=/usr/local/opt/icu4c/lib \
262 --extra-include-dirs=/usr/local/opt/icu4c/include
2646. The `pandoc.1` man page will be installed automatically. cabal shows
265 you where it is installed: you may need to set your `MANPATH`
266 accordingly. If `MANUAL.txt` has been modified, the man page can be
267 rebuilt: `make man/pandoc.1`.
270### Custom cabal method
272This is a step-by-step procedure that offers maximal control
273over the build and installation. Most users should use the
274quick install, but this information may be of use to packagers.
275For more details, see the [Cabal User's Guide]. These instructions
276assume that the pandoc source directory is your working directory.
277You will need cabal version 2.0 or higher.
2791. Install dependencies: in addition to the [Haskell platform],
280 you will need a number of additional libraries. You can install
284 cabal install --only-dependencies
288 cabal configure --prefix=DIR --bindir=DIR --libdir=DIR \
289 --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \
290 --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \
291 --mandir=DIR --flags=FLAGSPEC --enable-tests
293 All of the options have sensible defaults that can be overridden
296 `FLAGSPEC` is a list of Cabal configuration flags, optionally
297 preceded by a `-` (to force the flag to `false`), and separated
298 by spaces. Pandoc's flags include:
300 - `embed_data_files`: embed all data files into the binary (default no).
301 This is helpful if you want to create a relocatable binary.
303 - `https`: enable support for downloading resources over https
304 (using the `http-client` and `http-client-tls` libraries).
3114. Build API documentation:
313 cabal haddock --html-location=URL --hyperlink-source
317 cabal copy --destdir=PATH
319 The default destdir is `/`.
3216. Register pandoc as a GHC package:
325 Package managers may want to use the `--gen-script` option to
326 generate a script that can be run to register the package at
329### Creating a relocatable binary
331It is possible to compile pandoc such that the data files
332pandoc uses are embedded in the binary. The resulting binary
333can be run from any directory and is completely self-contained.
334With cabal, add `-fembed_data_files` to the `cabal configure`
335or `cabal install` commands.
337With stack, use `--flag pandoc:embed_data_files`.
343Pandoc comes with an automated test suite.
344To run with cabal, `cabal test`; to run with stack, `stack
347To run particular tests (pattern-matching on their names), use
350 cabal install pandoc --enable-tests
351 cabal test --test-options='-p markdown'
355 stack test --test-arguments='-p markdown'
357It is often helpful to add `-j4` (run tests in parallel)
358and `--hide-successes` (don't clutter output with successes)
359to the test arguments as well.
361If you add a new feature to pandoc, please add tests as well, following
362the pattern of the existing tests. The test suite code is in
363`test/test-pandoc.hs`. If you are adding a new reader or writer, it is
364probably easiest to add some data files to the `test` directory, and
365modify `test/Tests/Old.hs`. Otherwise, it is better to modify the module
366under the `test/Tests` hierarchy corresponding to the pandoc module you
369### Running benchmarks
371To build and run the benchmarks:
373 cabal configure --enable-benchmarks && cabal build
380To use a smaller sample size so the benchmarks run faster:
382 cabal bench --benchmark-options='-s 20'
384To run just the markdown benchmarks:
386 cabal bench --benchmark-options='markdown'
389[Arch]: https://www.archlinux.org/packages/community/x86_64/pandoc/
390[Cabal User's Guide]: https://cabal.readthedocs.io/
391[Debian]: https://packages.debian.org/pandoc
392[Fedora]: https://apps.fedoraproject.org/packages/pandoc
393[FreeBSD ports]: https://www.freshports.org/textproc/hs-pandoc/
394[GHC]: https://www.haskell.org/ghc/
395[Haskell platform]: https://hackage.haskell.org/platform/
396[MacPorts]: https://trac.macports.org/browser/trunk/dports/textproc/pandoc/Portfile
397[MacTeX]: https://tug.org/mactex/
398[BasicTeX]: https://www.tug.org/mactex/morepackages.html
399[LaTeX]: https://www.latex-project.org
400[MiKTeX]: https://miktex.org/
401[librsvg]: https://wiki.gnome.org/Projects/LibRsvg
402[Python]: https://www.python.org
403[NetBSD]: https://pkgsrc.se/wip/pandoc
404[NixOS]: https://nixos.org/nixos/packages.html
405[Slackware]: https://www.slackbuilds.org/result/?search=pandoc&sv=
406[Ubuntu]: https://packages.ubuntu.com/pandoc
407[download page]: https://github.com/jgm/pandoc/releases/latest
408[gentoo]: https://packages.gentoo.org/package/app-text/pandoc
409[haskell repository]: https://wiki.archlinux.org/index.php/Haskell_Package_Guidelines#.5Bhaskell.5D
410[openSUSE]: https://software.opensuse.org/package/pandoc
411[source tarball]: https://hackage.haskell.org/package/pandoc
412[stack]: https://docs.haskellstack.org/en/stable/install_and_upgrade.html
413[cabal-install]: https://hackage.haskell.org/package/cabal-install
414[Void]: https://voidlinux.org/
415[uninstaller]: https://raw.githubusercontent.com/jgm/pandoc/master/macos/uninstall-pandoc.pl
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list