Pandoc is an open-source document converter, widely used as a writing tool (especially by scholars) and as a basis for publishing workflows - wikipedia
The program is used by Architect and RStudio to produce documents in a variety of formats from Markdown files which may include statistical analysis written in R and processed with Knitr.
If no *input-file* is specified, input is read from *stdin*. Otherwise, the *input-files* are concatenated (with a blank line between each) and used as input - github
pandoc -s -o output.html input.txt
Output goes to *stdout* by default (though output to *stdout* is disabled for the `odt`, `docx`, `epub`, and `epub3` output formats). For output to a file, use the `-o` option:
pandoc -o output.html input.txt
By default, pandoc produces a document fragment, not a standalone document with a proper header and footer. To produce a standalone document, use the `-s` or `--standalone` flag:
For more information on how standalone documents are produced, see [Templates], below.
Instead of a file, an absolute URI may be given. In this case pandoc will fetch the content using HTTP:
pandoc -f html -t markdown http://www.fsf.org
If multiple input files are given, `pandoc` will concatenate them all (with blank lines between them) before parsing. This feature is disabled for binary input formats such as `EPUB`, `odt`, and `docx`.
The format of the input and output can be specified explicitly using command-line options. The input format can be specified using the `-r/--read` or `-f/--from` options, the output format using the `-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from Markdown to LaTeX, you could type:
pandoc -f markdown -t latex hello.txt
To convert `hello.html` from HTML to Markdown:
pandoc -f html -t markdown hello.html
# Integration with Reference Managers
The information is automatically transformed into a citation in various styles using an implementation of the Citation Style Language.
Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc's simple document model.
While conversions from pandoc's Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc's Markdown can be expected to be lossy.
# Supported File Formats
Pandoc's most thoroughly supported file format is an extended version of Markdown, but it can also read many other forms of lightweight markup language, HTML, LaTeX, OPML, Org-mode, DocBook, and Office Open XML (Microsoft Word .docx).
It can be used to create files in many more formats, including Office Open XML, OpenDocument, HTML, Wiki markup, InDesign ICML, web-based slideshows, ebooks, OPML, and various TeX formats (through which it can produce a PDF). It has built-in support for converting LaTeX mathematical equations to MathML and MathJax, among other formats.
Plug-ins for custom formats can also be written in Lua, which has been used to create an exporting tool for the Journal Article Tag Suite.
`pandoc` [*options*] [*input-file*]...
# Description Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library.
It can read Markdown, CommonMark, PHP Markdown Extra, GitHub-Flavored Markdown, and (subsets of) Textile, reStructuredText, HTML, LaTeX, MediaWiki Markup, TWiki Markup, Haddock Markup, OPML, Emacs Org mode, DocBook, txt2tags, EPUB, ODT and Word docx;
and it can write Plain Text, Markdown, CommonMark, PHP Markdown Extra, GitHub-Flavored Markdown, reStructuredText, XHTML, HTML5, LaTeX, ConTeXt, RTF, OPML, DocBook, OpenDocument, ODT, Word docx, GNU Texinfo, MediaWiki markup, DokuWiki markup, Haddock markup, EPUB (v2 or v3), FictionBook2, Textile, groff man pages, Org mode, AsciiDoc, InDesign ICML,
# Slide Shows
# Enhanced Markdown
Pandoc's enhanced version of Markdown includes syntax for [footnotes], [tables], flexible [ordered lists], [definition lists], [fenced code blocks], [superscripts and subscripts], [strikeout], [metadata blocks], automatic tables of contents, embedded LaTeX [math], [citations], and [Markdown inside HTML block elements][Extension: `markdown_in_html_blocks`]. (These enhancements, described below under Pandoc's Markdown, can be disabled using the `markdown_strict` input or output format.)
In contrast to most existing tools for converting Markdown to HTML, which use regex substitutions, pandoc has a modular design: it consists of a set of readers, which parse text in a given format and produce a native representation of the document, and a set of writers, which convert this native representation into a target format. Thus, adding an input or output format requires only adding a reader or writer.