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
1 answer

Why is KnitR not Printing Title and Abstract?

I have two YAML metadata blocks, and it appears that the 2nd metadata block is not being read. I think this has something to do with Pandoc, but I'm not sure. I used the same code several months ago, and it was working. I do get the warning…
James
  • 459
  • 2
  • 14
1
vote
1 answer

Pandoc convert YAML title to header 1 to combine multiple files

I have written multiple articles in their own respective markdown files. Each article contains its own YAML-header with title and authors. Now I want to combine all articles for my dissertation, but I bump into a problem: all titles and authors are…
Jasper
  • 555
  • 2
  • 12
1
vote
1 answer

How to parse a text table in rmarkdown code chunks

There is an rmarkdown file with a markdown table that will be regularly updated. The content should be parsed in a code chunk so that e.g. ggplot could be used. I don't want to maintain the table in a code chunk or a separate file. How can I read…
Birger
  • 1,111
  • 7
  • 17
1
vote
1 answer

Pandoc 4th Level Markdown Headers

I am working on converting a bunch of orgmode files into markdown. I have been unable to find how to prevent pandoc from converting headings greater than level 3 into numbered lists. For example: * Heading 1 Here is some content ** Heading 2 Here…
tgrosinger
  • 2,463
  • 2
  • 30
  • 38
1
vote
1 answer

R Markdown Workflow to Render a Powerpoint Presentation as PDF

I have begun using Rmd to render Powerpoint presentations consistently, using the YAML tags and more importantly, a reference Powerpoint to ensure standardized / consistent formatting: output: powerpoint_presentation: slide: reference_doc:…
Roqarr
  • 13
  • 2
1
vote
1 answer

Unable to reference a package

I'm failing to run (or compile) a simple script due to a reportedly missing Text.Pandoc.JSON dependency. This question is similar to another one: Pandoc 'Could not find module ...' for installed module Here's the script: import…
oldhomemovie
  • 14,621
  • 13
  • 64
  • 99
1
vote
1 answer

How to reference a fenced code block in pandoc markdown?

I have written a document in markdown, and I am having problem referencing a fenced code block. When I write the block as ```sql SELECT Name FROM STUDENT WHERE Id = 987654321 ``` and compile to pdf format with pandoc. The output looks like the…
Imran Ali
  • 2,223
  • 2
  • 28
  • 41
1
vote
1 answer

Pandoc: use syntax highlighting in HTML without creating anchors?

I just noticed that when Pandoc creates syntax highlighting, it also creates an HTML anchor for each code line: This results in a lot of invisible tab stops. Is there a way to suppress creating those anchors?
Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152
1
vote
1 answer

Pandoc 2.x renders images' alternative texts in an inaccessible fashion

Since I upgraded from Pandoc v1.19 to 2.9, decorative images are not exported as expected anymore. First of all, when generating HTML from ![](test.jpg), in v1.19 a

structure was wrapped around the image, but now it's only a…

Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152
1
vote
1 answer

Converting LaTeX document to word using pandoc -- problem with tables with multicolumns

I use pandoc to convert my latex documents into word documents. Most of my tables have multicolumns. Rows with cells across multiple columns don't appear in my final word document and I don't really understand why. Here some LaTeX example…
EcSil
  • 11
  • 2
1
vote
1 answer

knitr::is_word_output() to check if the current output type is word – just like knitr::is_latex_output() and knitr::is_html_output()

knitr::is_latex_output() and knitr::is_html_output() allow checking if the current output type LaTex or HTML respectively. Is there an equivalent for Word as an output format? If not, what would be the most simple to use workaround? --- title: "MWE…
mavericks
  • 1,005
  • 17
  • 42
1
vote
0 answers

R DataMaid pandoc UTF 8

when I try to create a data report with the package DataMaid and the function makeDataReport, I am always getting some error messages. The code looks like this: install.packages("dataMaid") library("dataMaid") codebook_data <-…
1
vote
1 answer

Why does pandoc remove .incremental from divs?

I want to make incremental div elements, but pandoc is stripping out the incremental class name from them: $ echo '
hello
' | pandoc -f markdown -t slidy
earldouglas
  • 13,265
  • 5
  • 41
  • 50
1
vote
1 answer

How to made a flextable table in the same MSWord style than tables made with knitr::kable, or how to define interlines?

After kniting a Bookdown project into a .docx file, the - excellent - flextable package made tables in my .docx document with MS-Word 'Normal Style', which has very large interline and is supposed to define the text, nor the tables' cells. Please,…
Clément LVD
  • 648
  • 5
  • 12
1
vote
1 answer

How does this Haskell Pandoc filter work?

I want to use Pandoc to merge multiple Markdown files. While doing so, I want each file's frontmatter or metadata to generate custom Markdown at the top of the document before merging. I found this SO post answer which appears to do what I want, but…
jds
  • 7,910
  • 11
  • 63
  • 101
1 2 3
99
100