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
1
vote
0 answers

Rscript won't run in EC2, bash script, due to pandoc and HOME env variable

I am trying to run an Rscript inside an EC2 by supplying a set of scripts to the instance from S3. The EC2 instance is a custom AMI running R and R Server. When the instance is fired up, it fetches it's scripts from S3, and runs them, then closes…
monkey
  • 1,213
  • 2
  • 13
  • 35
1
vote
1 answer

R markdown change inline code background color for PDF

How to change the background color for inline code elements in R-markdown PDF ? Currently when I use the single back-ticks like that, the background color is not rendered when I knit the pdf (only the font, see the capture below). However everything…
polop
  • 51
  • 4
1
vote
0 answers

Omit index page from the Bookdown TOC

I am using bookdown to write a book with a web-version, using the bs4_book format. I want my index page (the front page) to not appear in the TOC on the left, i.e. I want the blue circled item in this screenshot not to appear in the TOC: I tried…
saladi
  • 3,103
  • 6
  • 36
  • 61
1
vote
0 answers

rmarkdown site generator workflow

I'm working with an rmarkdown site generator comprised of 30 *.Rmd and facing a number of issues. Rendering the entire site takes a long time (~20-30 min) even with cache=TRUE in most chunks Some of the R generated figures are mismatched especially…
Thomas Speidel
  • 1,369
  • 1
  • 14
  • 26
1
vote
0 answers

How can I embed an image in a .pod file to have it render in .odt?

I have a program called multipandoc which takes as input a plain-text file in Perl's Plain Old Documentation (.pod) format and converts it simultaneously into .txt, .html, .pdf and .odt formats. It does so by use of the Pod::Pandoc module from…
James E Keenan
  • 281
  • 2
  • 10
1
vote
0 answers

Detecting a docx page break in Pandoc

There are lots of answers about how to output a page break to .docx files with Pandoc, but is there any way to detect page breaks when reading from a .docx? I know Pandoc's AST doesn't support the idea of a page break, but I'd been hoping to be able…
Alec
  • 2,432
  • 2
  • 18
  • 28
1
vote
2 answers

How to make a Pandoc table wider than textwidth?

I'm adding a table to a document and discovered that the columns are too narrow, making it a bit difficult to read. Therefore I'd like to make the entire table (and thus also the individual columns relative sizes) wider while keeping the textwidth…
Axel Kennedal
  • 527
  • 6
  • 22
1
vote
1 answer

Define Table Header for Mardown Table of +---+---+ Markup Type

What markup should be used to turn the first row into a table header? +-------+----------+-------------------------------------------------+ | Bits | Field | Description | | | Name | …
DANI3L
  • 25
  • 5
1
vote
1 answer

How do I get CMake to check for TeXLive in Pandoc?

In PerfectTIN (https://github.com/phma/perfecttin), I build the documentation with this CMakeLists file: find_program(PANDOC pandoc) if (PANDOC) execute_process(COMMAND ${PANDOC} "--resource-path=/" INPUT_FILE /dev/null ERROR_FILE /dev/null…
Pierre Abbat
  • 485
  • 4
  • 10
1
vote
0 answers

Can bookdown output in PDF/X-3 format?

I have a book authored in R/Bookdown and would like to offer a print-on-demand option. Many book publishers require pdf/x-3 for printing. How do I generate a pdf in this format?
sliptonic
  • 460
  • 3
  • 11
1
vote
0 answers

Bibliography causes rmarkdown::render() to fail

trying to render my rmarkdown into a MS Word, if I add a bibliography I get this error: pandoc-citeproc: when expecting a product (:*:), encountered Object instead Error running filter pandoc-citeproc: Filter returned error status 1 Error: pandoc…
Bakaburg
  • 3,165
  • 4
  • 32
  • 64
1
vote
0 answers

Stretched ends of line with justified alignment in rmarkdown generated MS Word documents

I know how to create a justified alignment Word document from rmarkdown, using a template file. The problem is that the ends of line are all stretched (see picture). In Word, one solves this by putting a tab at the end of the line, but I can't…
Bakaburg
  • 3,165
  • 4
  • 32
  • 64
1
vote
1 answer

Add proper syntax name to code blocks when converting from HTML to Markdown with Pandoc

I need to convert some HTML to Markdown with Pandoc. All is fine except the code blocks in my document are not converted properly. I need them to appear in the resulting Markdown document as backtick-code blocks with syntax definition. For example,…
Dany
  • 4,521
  • 1
  • 15
  • 32
1
vote
0 answers

Inserting Part Dividers Into Markdown ePub with Pandoc

I'm assembling a book with individual chapters constructed as markdown files with Pandoc. Currently, I'm successfully using a script like this to combine the metadata document with the chapters to create an ePub document: pandoc -o book.epub…
nxl4
  • 714
  • 2
  • 8
  • 17
1
vote
1 answer

Why is swedish letters not working with fancyhdr for laTex pandoc conversion?

Does anyone know why this decoding error happens when I try to convert a markdown file to pdf? Everything works fine except when I use Swedish letters in fancyhdr. If i remove the letter 'å' it works (the letter is in the YAML…
Tomas R
  • 440
  • 2
  • 10