pandoc

converts document formats

TLDR

Convert Markdown to HTML
$ pandoc [input.md] -o [output.html]
Convert to PDF
$ pandoc [input.md] -o [output.pdf]
Convert to Word
$ pandoc [input.md] -o [output.docx]
Specify input format
$ pandoc -f [latex] -t [html] [input.tex] -o [output.html]
With table of contents
$ pandoc [input.md] --toc -o [output.html]
Use template
$ pandoc [input.md] --template=[template.html] -o [output.html]

SYNOPSIS

pandoc [options] [input...]

DESCRIPTION

pandoc converts document formats. Universal document converter.The tool handles many formats. Markdown, LaTeX, HTML, DOCX, PDF, and more.

PARAMETERS

INPUT

Input file(s).
-o FILE
Output file.
-f FORMAT
Input format.
-t FORMAT
Output format.
--toc
Include table of contents.
--template FILE
Use template.
--help
Display help information.

INSTALL

sudo apt install pandoc
sudo dnf install pandoc-cli
sudo pacman -S pandoc-cli
sudo apk add pandoc-cli
sudo zypper install pandoc-cli
brew install pandoc
nix profile install nixpkgs#pandoc

CAVEATS

PDF output requires LaTeX or wkhtmltopdf. Format support varies.

HISTORY

Pandoc was created by John MacFarlane as a universal document converter.

SEE ALSO

markdown(1), latex(1), groff(1)