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

Pandoc and listings in YAML header?

I have the following test.md: --- listings: true # here it just seems to include usepackage, but still keeps code blocks in {verbatim}; only --listings on command line starts wrapping code block in lstlisting ? title: "Some title here" author: John…
sdbbs
  • 4,270
  • 5
  • 32
  • 87
1
vote
1 answer

Latex to HTML with Pandoc, how do I include the Lua script output to the conversion?

I'm using pandoc to convert LaTeX to HTML. However, I have a lua script included in the latex file (which pulls some data from a JSON file and formats the data to LaTeX). As I convert to HTML, the script is not executed but appears as lua in the…
fiddler
  • 13
  • 2
1
vote
1 answer

Pandoc-citeproc isn't showing "p. " only the page number

Recently I've discovered the great pandoc-citeproc filter for adding literature sources to markdown documents -- in order to convert them to PDFs with bibliographic references. However, I would prefer to avoid the substitution of "p. ". E.g.: When…
alex
  • 1,103
  • 1
  • 14
  • 25
1
vote
1 answer

Match pattern with whitespace in lua filter

I have found a lua filter for pandoc which transforms patterns like [[Link]] to file:///Link. Right now it doesn't match patterns like [[Link more words]] though. I would like to also match patterns like [[Link more words]] and transform spaces…
Philipp L.
  • 35
  • 5
1
vote
1 answer

Conda: How to install latest version of `pandoc-crossref` from Github in `conda` environment?

pandoc-crossref must match the pandoc version, and also only the 3.10.0 release works on OSX Big Sur. Thus, it is not possible to get pandoc and pandoc-crossref running in a conda environment from the official channel or from conda-forge. I could…
Martin Hepp
  • 1,380
  • 12
  • 20
1
vote
0 answers

Best way to write setup script for multi-language project package that includes anaconda, atom, node.js etc.?

I am designing an environment for productive research, i.e. writing, data-analysis, publication, etc. In order to share the final results with others, I need to find a way to package this and to set up the local installation. The project depends on…
Martin Hepp
  • 1,380
  • 12
  • 20
1
vote
1 answer

exec: does not exist (No such file or directory)

I'm using WSL with docker (with a complex pandoc configuration with latex, python and pandoc-filters) and trying a long command with --filter=filters/the_filter.sh that results in an error: Error running filter filters/the_filter.sh:…
Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
1
vote
1 answer

Pandoc re-run latex filter on element after latex+raw_tex and lua filter

I've been writing a custom LaTeX reader Lua filter to convert a bunch of LaTeX source into Pandoc Markdown, which will be my new source for several documents. I run the usual filter like the following. pandoc file.tex \ -f latex+raw_tex \ -t…
Rico Picone
  • 381
  • 4
  • 10
1
vote
1 answer

Failed to run xelatex when trying to convert jupyter notebook to pdf

I am trying to get my jupyter notebook to convert to pdf so I can submit it, and am having an awfully hard time doing so. I first installed nbconvert and pypandoc and then I downloaded the pandoc zip folder on their website (the installer wasn't…
Vons
  • 3,277
  • 2
  • 16
  • 19
1
vote
1 answer

Pandoc beamer change "Section 1" to "Chapter 1"

I was doing my thesis presentation and my guide insists that the "Section {1, 2, ..}" should be replaced with "Chapter {1, 2, ..}" as in below image. I tried a few tricks in YAML, and ended up with the below lines I think would help, but no…
Adrine Correya
  • 163
  • 1
  • 7
1
vote
1 answer

Is it possible to specify the pandoc standalone option in the yaml front matter?

When I specify the toc option in the yaml front matter as such: --- title: "Reading notes" toc: yes --- Pandoc generates a table of content for pdf output but not for html output. This is due to the fact that the pdf document has the standalone…
Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110
1
vote
3 answers

Return the text string of el.content in pandoc filter

When using pandoc filter, I just want to get the text of el.content, but it return a Table! The .md as follows(just for debug): [It's so easy!]{color="red"}. Today is Monday. I want to get the string It's so easy! be printed. So, I write the…
user26992
  • 13
  • 3
1
vote
1 answer

Rmarkdown with LaTex-document in appendix?

I need to create an Rmarkdown document in which I have some text and 3 appendices showing 3 different LaTex files. I found many resources showing how to append Rcode in an appenidx, but have been unsuccessful for other kinds of appendices. As a…
lilla
  • 151
  • 3
  • 12
1
vote
1 answer

R Markdown not rendering some HTML?

When I knit an R Markdown file with the following code, not all of the HTML is rendered. Any thoughts on what is happening here? R Markdown file --- title: "html test" author: "NA" date: "1/16/2021" output: html_document ---
max
  • 4,141
  • 5
  • 26
  • 55
1
vote
1 answer

Creating tables where a cell may contain more than one line or paragraph using pandoc and Markdown

I am trying to create a table where certain cells may contain more than one line or paragraph. I am creating my document in markdown and using pandoc to convert it to other formats which would be the ones disseminated. The Pandoc User Guide mentions…
sghosh
  • 11
  • 1