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

Generating headlines before reference types in sorted bibliography (CSL)

Recently I have found a tip that allows for sorting CSL-generated bibliography by reference type in PDF output. In my example, I applied this tip accordingly:
1
vote
1 answer

How to move the "list of figures" (lot) in pandoc

I want to place my "list of figures" (lot) to the end of the document, but pandoc puts the lot by default at the beginning, directly after the toc. My .md looks like this: --- toc: true lof: true --- # Heading 1 Lorem ipsum… #…
nani8ot
  • 11
  • 2
1
vote
1 answer

Check if latex code is processed by Pandoc or *tex

When converting a latex file to word, I'd like to skip some sections which Pandoc does not handle well, or redefine commands which pandoc does not understand. Now I use the following highly unelegant mechanism: \iffalse % code executed by pandoc…
Roel
  • 197
  • 8
1
vote
0 answers

Keeping internal links in EPubs generated from HTML with Pandoc

I'm trying to generate EPubs from HTML files, and they contain a bunch of links to internal pages (the pages are on the same folder). When running pandoc to convert the files, it doesn't keep the links correctly. Looking on calibre, the EPub pages…
1
vote
1 answer

Command line tool to convert Markdown Pipe-Tables to Double-Pipe-Header-Tables

I write my Markdown tables usually in the Pipe-Table syntax (used by Pandoc, multimarkdown, php extra and others). Here an example: | fruit | price | |--------|------:| | apple | 2.05 | | pear | 1.37 | | orange | 3.09 | In a Confluence wiki…
halloleo
  • 9,216
  • 13
  • 64
  • 122
1
vote
1 answer

Using pandoc converting a markdown document with LaTeX to HTML and LaTeX converted to SVG within HTML

Using pandoc, what is the command to process a Markdown document with LaTeX to HTML? The LaTeX needs to be converted into SVG and placed inline with HTML. Example: Markdown content... $$ \lim_{x \to \infty} \ \frac{x + \sin x}{x} $$ The above is…
Santosh S Kumar
  • 469
  • 1
  • 6
  • 30
1
vote
0 answers

Custom latex handler for fenced div blocks in bookdown

I'd like to use fenced divs in a large bookdown project to create numbered environments like Theorem, Example, etc. Bookdown's built-in code blocks to do this aren't sufficient, since they can't have R code blocks inside of them and also interfere…
turtlegraphics
  • 296
  • 3
  • 8
1
vote
0 answers

Pandoc - Support for a custom input latex environment

I am using a single unified LaTeX doc to create problem sets and solutions: \item What is one plus one? \begin{soln} The answer is "two". \end{soln} In LaTeX, I define this environment with (simplified): \NewEnviron{soln} …
Nathaniel Tagg
  • 385
  • 2
  • 14
1
vote
2 answers

Pandoc highlighting theme

I'm trying to generate a highlighting theme for my site created with pandoc framework. I followed this guide : guide I create my theme this way: pandoc --print-highlight-style breezedark > my_style.theme and then I add it to my command like…
Difettoso
  • 51
  • 1
  • 1
  • 10
1
vote
1 answer

Costum dynamic pandoc (or Latex) command to set text color

I prepare a document in Markdown in which I have to highlight changes in color. I am aware that I could wrap the text like this: This text is unchanged, however \textcolor{red}{I changed this}, before going back to the original color. But I would…
lilla
  • 151
  • 3
  • 12
1
vote
1 answer

lineNumbers in Reveal.js code block using pandoc - markdown conversion

How can I get the line-numbers to display on the left edge of a code block in a Reveal.js slide show created with pandoc from a markdown document? I have tried the following markdown: --- title: 'Display Code-block Line Numbers' date: 'Aug…
Clay
  • 2,584
  • 1
  • 28
  • 63
1
vote
1 answer

Text formatting of lists in Pandoc's Markdown

I've added asterisks and a new line break to the sampleList elements in order to create a bulleted list format: sampleList <- list(1, 2, 3) # Create bulleted list createPoints = function(list) { # Pre-allocate list setList <- vector(mode =…
SRL
  • 145
  • 9
1
vote
1 answer

From word to Latex using pandoc , problem with citation

My main propose of using pandoc is to make word documents from latex files, so I share them with my colleagues for review. I am new in pandoc, so I used a straightforward example. I used pandoc to create a docx file form a simple Latex tex file,…
1
vote
1 answer

Getting the first author in a pandoc template (Rmarkdown)

I am currently creating my own pandoc template for Rmarkdown (outputting html). I want my report to show a footer containing the title and first author's name. Reading the pandoc manual, I saw that it is possible to use a pipe to get the first…
1
vote
1 answer

Solving the first exercise on "Pandoc Filters" page

The first question on https://pandoc.org/filters.html#exercises asks to convert all text to uppercase except if it is part of a URL or a link title. So, I read the discussion about "Execution Order" in lua filters at…
Vijay
  • 151
  • 1
  • 11
1 2 3
99
100