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

Insert blank line between bullet items in pandoc markdown?

I would like to insert a single blank line between my bullet elements. However, I'm having a hard time making this work in pandoc markdown. I'm using pandoc -f markdown -t html my_doc.md to perform the conversion. Right now, I have something…
Him
  • 5,257
  • 3
  • 26
  • 83
1
vote
0 answers

how to pass a value to a "subvariable" with pandoc?

My yaml-file has these variables: values: - name: MyName amount: 123 --- In the pandoc-template for LaTeX I have inserted the variables as following: $for(values)$ $if(values.name)$Name: $values.name$$endif$ $if(values.amount)$Amnount:…
lukascbossert
  • 375
  • 1
  • 11
1
vote
0 answers

Can pandoc generate a bibliography with the references in order of citation?

Pandoc noob here. I am trying to convert a LaTeX file into a Word document for submission to a picky journal. They are requiring that my references appear in the bibliography in the order in which they are cited. This is no problem in LaTeX, but…
1
vote
1 answer

How to add a alphabetical index with Pandoc?

I have a markdown file and I want to PDF with a last section with alphabetical index such as latex alphabetical index. But I have been looking in the pandoc manual and looking for a Lua plugin for this thing, but I have not seen anything.
tres.14159
  • 850
  • 1
  • 16
  • 26
1
vote
1 answer

Customising Pandoc writer element output

Is it possible to customise element outputs for a pandoc writer? Given reStructuredText input .. topic:: Topic Title Content in the topic Using the HTML writer, Pandoc will generate

Topic Title

sbaildon
  • 250
  • 3
  • 8
1
vote
1 answer

Error converting pandoc tables from .md to PDF

I try to convert Markdown files to PDF with FOR %%i IN (*.md) DO pandoc "%%~fi" -o "%%~dpni.pdf" --template=weber-export.tex --pdf-engine=xelatex But it wont convert pandoc-tables. instead there occurs an error saying Error producing PDF. ! Missing…
DerHelge
  • 53
  • 6
1
vote
1 answer

How to convert Org mode file to ODT using a template and Pandoc?

I have a file plan.org with following contents: * Hello! This is a test. I want to convert it to LibreOffice (ODT) format using Pandoc so that it is formatted according to a template draft.ott or draft-template.odt both of which are available…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
1
vote
0 answers

pandoc - how to generate hugo-like section page?

In hugo a section page is file _index.md and by default this page is a type of list, ie. it would have URL links to other files/pages in same directory. How would I do that with pandoc. Let's image I have a directory named fruits and with a file…
Jiri B
  • 361
  • 1
  • 12
1
vote
1 answer

Centering column names with `pander` while left justifying content

I am using the pander::pander function to make some tables in a knitted latex document. I want the rows to be left justified and the column names to be centered. library(pander) library(dplyr) tibble(`column name` = c("long text string", "* hi"))…
John-Henry
  • 1,556
  • 8
  • 20
1
vote
1 answer

Pandoc: in a .md file, how to modifiy the YAML metadata block and put the modified block in markdown format using a lua filter

I want to transform some parts of the metadata in the YAML header of a block-empty .md file before passing it to a template file. That is, the workflow would be this: source_YAML_md_file -> lua_filter -> transformed_YAML_md_file -> template ->…
Joan Sanz
  • 43
  • 4
1
vote
1 answer

Is there a way to change the default blue header color when creating a table using pandoc in Rmarkdown

I would like to change the color of the default table produced by pandoc in Rmarkdown. The default is blue. How can change it? Reprex: --- title: "reprex" author: "" date: "" output: ioslides_presentation --- ```{r setup,…
tall_table
  • 311
  • 3
  • 11
1
vote
1 answer

Pandoc Markdown to HTML blockquote style

I'm trying to find a good solution to writing my emails in Markdown, and styling them for general consumption, in Thunderbird. My previous solution, the add-on Markdown-here is not maintained, and no longer works with the latest Thunderbird…
Prunus Persica
  • 1,173
  • 9
  • 27
1
vote
1 answer

Iterating through a sequence of mappings with different inputs with pandoc

I am trying to use one template to handle varying input files. I want to iterate through a specific sequence of mappings where the keys and the values in the sequence of mappings can change. I have a solution but it feels like a hack and it only…
Sean Kross
  • 51
  • 2
1
vote
0 answers

Pandoc not convert file doc has math to file latex

Hello everyone I have a problem that is difficult to answer. I have the function to convert the doc file with the math formula to a .tex (latex) file. But when converting to .tex file, the mathematical formula in .doc file, .docx file error file…
1
vote
1 answer

Pandoc: is it possible to disable interpretation of inline HTML in markdown?

I need markdown only for what options its syntax offers. So I don't want it to interpret inline HTML (e.g. hello), but it should display those tags as text. Is there a way to disable this? Or should I simply search and replace each and…
Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152