Single sourcing from the command line

Command Line – pandoc

© Lead Image © Natalia Bannykh,

© Lead Image © Natalia Bannykh,

Article from Issue 283/2024

In search of a tool for creating multiple documents from a single source, Bruce revisits the universal document converter, pandoc.

The number of text formats in modern computing has steadily increased, resulting in complexity when it comes to porting to and from the different formats. Added to this complexity is the desire to single-source documents, which allows you to create different documents from a single file. With this in mind, I return to a tool I covered a few years ago, pandoc [1].

Universal Document Converter

Pandoc supports 22 input formats (Figure 1) and 25 output formats (Figure 2) – and half as many again if you count various versions of the same basic format. With so many formats to support, you might expect support conversion between formats to be spotty, especially if you are familiar with such efforts as Collabora's ongoing struggle to improve just LibreOffice's support of Microsoft Office. In fact, pandoc's man page warns [2]:

"One should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc's simple document model. While conversions from pandoc's Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc's Markdown can be expected to be lossy."


Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Swiss Army Knife

    Pandoc lets you convert files from one markup format to another at the command line.

  • Pandoc Website

    Build a simple web page in Markdown; then convert it to HTML at the command line.

  • UberWriter

    The UberWriter text editor, which is optimized for Markdown, includes a number of interesting features and does some amazing things. We show you how it works.

  • Tutorials – Markdown

    Create attractive and structured documents from the comfort of your text editor – and convert them to a huge array of formats.

  • FOSSPicks

    Graham has finally taken delivery of a couple of RISC-V development boards for Linux experimentation. Expect plenty of cross-build tools in future issues!

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More