Questions tagged [pandoc]

Pandoc is an open-source, command-line, universal document converter for converting between various markup formats.

If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert documents in any of thirty supported input formats, e.g., Markdown, reStructuredText, textile, HTML, DocBook, or LaTeX, to more than fifty output formats:

Pandoc understands a number of useful Markdown syntax extensions, including document metadata (title, author, date); footnotes; tables; definition lists; superscript and subscript; strikeout; enhanced ordered lists (start number and numbering style are significant); running example lists; delimited code blocks with syntax highlighting; smart quotes, dashes, and ellipses; Markdown inside HTML blocks; and inline LaTeX. If strict Markdown compatibility is desired, all of these extensions can be turned off.

LaTeX math (and even macros) can be used in Markdown documents. Eight different methods of rendering math in HTML are provided, including MathJax and translation to MathML. LaTeX math is rendered in docx using native Word equation objects.

Pandoc includes a powerful system for automatic citations and bibliographies, using Andrea Rossato’s citeproc-hs. This means that you can write a citation like

[see @doe99, pp. 33-35; also @smith04, ch. 1]

and pandoc will convert it into a properly formatted citation using any of hundreds of CSL styles (including footnote styles, numerical sytles, and author-date styles), and add a properly formatted bibliography at the end of the document. Many forms of bibliography database can be used, including bibtex, RIS, EndNote, ISI, MEDLINE, MODS, and JSON citeproc. Citations work in every output format.

Pandoc includes a Haskell library and a standalone command-line program. The library includes separate modules for each input and output format, so adding a new input or output format just requires adding a new module.

Pandoc is free software, released under GPL2-or-later. © 2006-2020 John MacFarlane.

2486 questions
35
votes
2 answers

Inserting Vertical Space in Pandoc Markdown

Is it possible to insert a extra vertical space using Pandoc flavored Markdown? Something that would show up as a blank line in a Word document or a
in HTML or \vspace in LaTeX. Or anything equivalent? My problem is that I don't want a title…
tlnagy
  • 3,274
  • 4
  • 24
  • 37
34
votes
4 answers

Add author affiliation in R markdown beamer presentation

How to add author affiliation in a new line in an rmarkdown beamer presentation? --- title: "This is the title" author: "Author" date: "Thursday, April 09, 2015" output: beamer_presentation --- ## Slide with Bullets - Bullet 1 - Bullet 2 - Bullet…
Crops
  • 5,024
  • 5
  • 38
  • 65
34
votes
3 answers

Creating a footer for every page using R markdown

I'm writing a document in R Markdown and I'd like it to include a footer on every page when I knit a PDF document. Does anyone have any idea on how to do this?
n8sty
  • 1,418
  • 1
  • 14
  • 26
34
votes
3 answers

Pandoc insert appendix after bibliography

I'm using the knitr package and pandoc in R to convert a .Rmd file to a PDF. Pandoc is linked to a .bib file and automatically inserts the bibliography at the end of the PDF The entries in my .bib file look like these, taken from…
luciano
  • 13,158
  • 36
  • 90
  • 130
32
votes
2 answers

How to specify numbered sections in Pandoc's front matter?

I would like to specify numbered sections via Pandoc's support for YAML front matter. I know that the flag for the command-line usage is --number-sections, but something like --- title: Test number-sections: true --- doesn't produce the desired…
tlnagy
  • 3,274
  • 4
  • 24
  • 37
31
votes
6 answers

Convert Markdown links to HTML with Pandoc

In my new project I have multiple Markdown files which are linked to each other. These links refer to the original .md files. Example: File README.md ... 1. [Development documentation](Development.md) 1. [User documentation](Usage.md) ... If I…
P.Tail
  • 413
  • 1
  • 4
  • 6
30
votes
3 answers

Pandoc conversion to PDF not providing colored hyptertext links

Consider the following snippet of a PDF generated from pandoc by way of latex. Were you able to identify the hypertext links in there? Neither was I... It turns out that the second Kaplan Meier has a fully functional link to an external site. …
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
30
votes
2 answers

Is there a way to have conditional markdown chunk execution in Rmarkdown?

I am an instructor looking to make a homework assignment and homework solution guide from the same Rmarkdown file by changing a document parameter I created called soln. When soln=FALSE the assignment document is generated, and when soln=TRUE the…
thatssobayesic
  • 323
  • 1
  • 4
  • 6
29
votes
2 answers

How can I control cell width in a Pandoc/Markdown table?

Is there a way to control the maximum cell width in a Pandoc table? For example: | | | |----------|------------| | I want to the contents of this cell to fit on one line| XXXXXXX | I want to control how the line in the left…
Mustafa
  • 1,814
  • 3
  • 17
  • 25
28
votes
1 answer

Unable to compile PDF in R Studio (LaTeX Error: File `lmodern.sty' not found.)

I can't compile the most basic PDF file in R studio. This is my error message: output file: Report.knit.md ! LaTeX Error: File `lmodern.sty' not found. Type X to quit or to proceed, or enter new name. (Default extension: sty) Enter file…
geneorama
  • 3,620
  • 4
  • 30
  • 41
28
votes
1 answer

Does pandoc support Synctex?

I've spent a week writing an R vignette using knitr, with input in R Markdown, and output in HTML. Previously all vignettes that I wrote were in Sweave with a PDF target. One of the things I miss is Synctex, which gives the ability to jump from the…
user2554330
  • 37,248
  • 4
  • 43
  • 90
28
votes
4 answers

Pandoc - Inserting pages before generated Table of Contents

I've been playing around with Pandoc. Is there anyway to insert pages before the generated Table of Contents? For example: Title Page Insert Custom Page 001 Insert Custom Page 002 (Generated) Table of Contents Many thanks in advance!
Andrew Vink
  • 321
  • 1
  • 4
  • 7
28
votes
4 answers

Special characters not showing in pandoc html output

I am trying to get special characters (for foreign surnames) working in pandoc. I followed the instructions here and made sure all special characters are represented using UTF encoding (as per this page. I chose HTML Entity (decimal) option. The…
user2603493
  • 281
  • 1
  • 3
  • 4
28
votes
8 answers

Add styling rules in pandoc tables for odt/docx output (table borders)

I'm generating some odt/docx reports via markdown using knitr and pandoc and am now wondering how you'd go about formating tables. Primarily I'm interested in adding rules (at least top, bottom and one below the header, but being able to add…
Tilo Wiklund
  • 751
  • 1
  • 10
  • 15
27
votes
5 answers

How to make PDF presentations in Markdown

Is there a LaTeX style, header, or something so that e.g. markdown2pdf from pandoc would produce a PDF having a new page with each H1/markdown heading? Cheers
type
  • 1,137
  • 2
  • 9
  • 16