home.social
  1. 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.

  2. New off-label use: packing zip archives with pandoc:

    pandoc --extract-media=archive.zip <<EOF
    ![](file1.txt)
    ![](document.pdf)
    EOF

  3. Or as a single command, without a helper script:

    pandoc lua -l m=pandoc.mediabag \
    -e 'm.insert(OUTFILE, m.fetch(URI))' \
    -e 'm.write(".")'

  4. 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 pandoc.org/diagram.svgz diagram.svg

  5. Off-label-use of pandoc: convert numbers from Roman numerals to Arabic numerals.

    echo 'MMXXVI.' | pandoc -t commonmark
    ⇒ 2026.

  6. 🆕 pandoc 3.8.3 🎉

    This release adds three new input formats (, , and ) and one new output format ( + 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!

    github.com/jgm/pandoc/releases

  7. and its variants, like , 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
    ==================

  8. Overly long headings can be spread across multiple lines in pandoc's Markdown by “hiding” the line break in an HTML comment:

    ## An incredibly<!--
    --> long heading

  9. 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>@@

  10. 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), GitHub Flavored Markdown (gfm), and pandoc's CommonMark extension (commonmark_x).

  11. Article by @alefunguju on how to use pandoc to produce nice-looking diffs for docx and odt with , and even how to provide that functionality with .

    spiffyk.cz/blog/git-pandoc/

  12. "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: jolars.co/blog/2024-05-30-molo

  13. Article by R. N. West on how to use in an advanced way in order to generate corporate-styled Word documents.
    The post explains custom styles, shows how templates can be used, and includes a short primer on important aspects of the -format.
    rnwest.engineer/auto-generate-

  14. 🆕 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 ( and ).
    • Improved handling of inline TeX in .
    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.
    github.com/jgm/pandoc/releases

  15. 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`.

  16. normally doesn't produce that syntax when writing Markdown, so here's a 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

  17. syntax tip for code block attributes, yielding the best rendering results with both pandoc and on platforms such as , , etc:

    ``` lua {-id .another-class}
    io.stdout:write('hi!')
    ```

    The curly-braces syntax for attributes is ignored when read as , 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 .

  18. 🆕 release: 3.2.1
    Possibly the most notable change: templates can now be used with output.
    The release comes with many other small improvements and bugfixes, as usual. See the changelog for details.
    github.com/jgm/pandoc/releases

  19. Support for 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: docs.github.com/en/get-started

  20. For more info on the publishing pipeline, esp. the generation, see this article
    ncbi.nlm.nih.gov/books/NBK5796
    and the accompanying presentation
    jats.nlm.nih.gov/jats-con/2022

  21. Of course, all of the journal's systems are open source. E.g., the publishing pipeline is available here:
    github.com/openjournals/inara
    The pipeline currently produces , , and XML output.

  22. Pandoc's supports attributes on headings, code, spans, etc. Attributes are enclosed by curly braces and follow this syntax:

    {-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"}