-
New in pandoc 3.9:
Many CSL styles will format citations differently when the same source has been cited earlier. In documents with chapters, it is usually desirable to reset this position information at the beginning of every chapter. To do this, add the class `reset-citation-positions` to the heading for each chapter:# The Beginning {.reset-citation-positions}
Note that this class only has an effect when placed on top-level headings; it is ignored in nested blocks.
-
Off-label-use: pandoc as a network downloader
Lua helper script (pget.lua):
#!/usr/bin/env pandoc-lua
local mb = require 'pandoc.mediabag'
local path = require 'pandoc.path'
local uri = arg[1] or error"No URI given"
local out = arg[2] or path.filename(uri)
local mt, content = mb.fetch(uri)
mb.insert(out, mt, content)
mb.write('.')Usage:
pandoc lua pget.lua URI [OUTFILE]
Example:
pandoc lua pget.lua https://pandoc.org/diagram.svgz diagram.svg
-
Off-label-use of pandoc: convert numbers from Roman numerals to Arabic numerals.
echo 'MMXXVI.' | pandoc -t commonmark
⇒ 2026. -
🆕 pandoc 3.8.3 🎉
This release adds three new input formats (#Asciidoc, #PPTX, and #XLSX) and one new output format (#BBCode + variants).
It also fixes a number of bugs (including some regressions in 3.8). See the changelog for full details.
Thanks to all who contributed!
-
#CommonMark and its variants, like #gfm, allow to span setext-style header across multiple lines:
Line one
and two
--------Note that this allows to insert line breaks in headings
The Hobbit\
or\
There and Back Again
================== -
Format-specific output can be passed through from input to output via “raw blocks” and “raw inlines”. E.g., inserting a pagebreak in docx would work via “raw_attributes” in Markdown:
```{=openxml}
<w:p>
<w:r><w:br w:type="page"/></w:r>
</w:p>
```Or to insert HTML from org mode:
@@html:<var>x</var>@@
-
Line breaks within a paragraph are treated as spaces in Markdown. However, this gives bad results in East Asian languages, where spaces between words are unusual. Use
pandoc -f markdown+east_asian_line_breaks
to ensure that line breaks between East Asian wide characters get ignored.
The extension also works with #CommonMark (commonmark), GitHub Flavored Markdown (gfm), and pandoc's CommonMark extension (commonmark_x).
-
"Moloch" is a clean, simple, and freshly modernized LaTeX beamer theme. It's the successor to the popular "Metropolis" theme, brought up to current standards by @jolars with some help from @samcarter.
Usage with pandoc:
pandoc --to=beamer --variable=theme:moloch …
Blog post: https://jolars.co/blog/2024-05-30-moloch/
-
Article by R. N. West on how to use #pandoc in an advanced way in order to generate corporate-styled Word documents.
The post explains custom styles, shows how #openxml templates can be used, and includes a short primer on important aspects of the #docx-format.
https://rnwest.engineer/auto-generate-docx-with-pandoc/ -
🆕 release pandoc 3.7 ✨
Features:
• New option `--variable-json`. Structured variable values can now be passed via the command line.
• Rowspans and colspans are supported in grid-table output (#Markdown and #RST).
• Improved handling of inline TeX in #orgmode.
• #Lua subsystem: the `pandoc.read` function can now be used in “sandboxed” mode, restricting file or network access.Please see the changelog for the full list of changes and bugfixes.
https://github.com/jgm/pandoc/releases/tag/3.7 -
The "pandoc user's guide" Markdown file is part of the executable; it can be accessed by running
pandoc --print-default-data-file MANUAL.txt
Use
pandoc --print-default-data-file MANUAL.txt | pandoc …
to convert it to any pandoc-supported format. E.g., to read it in a terminal, try `--to=ansi`.
-
#Pandoc normally doesn't produce that syntax when writing Markdown, so here's a #LuaFilter for that:
CodeBlock = function (cb)
local lang = cb.classes:remove(1)
if lang then
local mdcode = pandoc.write(pandoc.Pandoc{cb}, 'markdown')
return pandoc.RawBlock(
'markdown',
mdcode:gsub('^```+', '%1 ' .. lang)
)
end
end -
#Markdown syntax tip for code block attributes, yielding the best rendering results with both pandoc and on platforms such as #GitLab #GitHub, #Codeberg, etc:
``` lua {#my-id .another-class}
io.stdout:write('hi!')
```The curly-braces syntax for attributes is ignored when read as #CommonMark, the Markdown variant used by most platforms. The above ensures that syntax highlighting still works with CommonMark, and that the other attributes get respected when converting with #pandoc.
-
🆕 release: #pandoc 3.2.1
Possibly the most notable change: #OpenXML templates can now be used with #docx output.
The release comes with many other small improvements and bugfixes, as usual. See the changelog for details.
https://github.com/jgm/pandoc/releases/tag/3.2.1 -
Support for #CommonMark alert-boxes was added in pandoc 3.1.10.
> [!INFO]
> This is an informational message.Note, however, that writer (i.e., rendering) support for this is limited, and that the `alert` extension works with CommonMark, but not with pandoc-flavored Markdown.
The syntax has been made popular by GitHub: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
-
For more info on the #joss publishing pipeline, esp. the #JATS generation, see this article
https://www.ncbi.nlm.nih.gov/books/NBK579698/
and the accompanying presentation
https://jats.nlm.nih.gov/jats-con/2022/presentations/jatscon22-krewinkel.html#/title-slide -
Pandoc's #Markdown supports attributes on headings, code, spans, etc. Attributes are enclosed by curly braces and follow this syntax:
{#identifier-value .class-one .class-two some-key="a value"}
Attributes can define an internal cross-ref target and carry a variety of additional information about the element, e.g. language or styling.
peace: [שָׁלוֹם]{lang="he" dir="rtl"}