Below, I'll explain the -D option in Pandoc and provide a list of valid parameters based on the current Pandoc documentation (as of Pandoc version 2.14 and later; always check the latest version for updates). The -D option is used to output the default template for a specified output format. This is useful for inspecting or customizing templates, as we discussed in the previous context (e.g., for LaTeX).
What Does the -D Option Do?
- The command
pandoc -D FORMAT dumps the default template for the specified FORMAT to standard output.
- This works for formats that have associated templates. Not all output formats in Pandoc have templates (e.g., some like
pdf rely on another format like latex).
- Syntax:
pandoc -D FORMAT > output-file.extension
- Example:
pandoc -D latex > default-latex-template.tex
Valid Parameters for -D
The valid parameters for -D correspond to Pandoc's supported output formats (also known as "writers") that have default templates. Pandoc supports a wide range of formats, but only those with templates can be used with -D. Here's a list of commonly supported formats based on Pandoc's documentation:
- latex: For LaTeX output (e.g., for PDF generation via a LaTeX engine).
- beamer: For Beamer presentations (a LaTeX-based slideshow format).
- html: For basic HTML output.
- html5: For HTML5 output.
- revealjs: For Reveal.js presentations.
- s5: For S5 slideshows.
- slidy: For Slidy slideshows.
- slideous: For Slideous slideshows.
- dzslides: For DZSlides slideshows.
- context: For ConTeXt output.
- ms: For Microsoft Word (doc) output (though it's less common for templates).
- opendocument: For OpenDocument Text (ODT) output.
- docbook: For DocBook XML output.
- docbook4: For DocBook 4 XML.
- docbook5: For DocBook 5 XML.
- jats: For JATS (Journal Article Tag Suite) XML.
- jats_archiving: For JATS Archiving XML.
- jats_articleauthoring: For JATS Article Authoring XML.
- jats_publishing: For JATS Publishing XML.
- texinfo: For Texinfo output (for GNU documentation).
- man: For Unix man page output.
- mediawiki: For MediaWiki markup.
- dokuwiki: For DokuWiki markup.
- zimwiki: For Zim Wiki markup.
- markdown: For standard Markdown output.
- markdown_strict: For strict Markdown output.
- markdown_phpextra: For PHP Markdown Extra.
- markdown_github: For GitHub Flavored Markdown.
- commonmark: For CommonMark output.
- gfm: For GitHub Flavored Markdown (extended).
- haddock: For Haddock markup (for Haskell documentation).
- epub: For EPUB e-book output.
- epub3: For EPUB 3 e-book output.
- fb2: For FictionBook 2 e-book output.
- icml: For InDesign ICML output.
- org: For Emacs Org-mode output.
- textile: For Textile markup.
- rtf: For Rich Text Format output.
- asciidoc: For AsciiDoc output.
Notes:
- Not all formats work with -D: For instance, formats like
pdf, docx, or pptx don't have direct templates because they are generated via intermediate formats (e.g., PDF is typically produced from LaTeX). If you try -D pdf, it might not work or could default to another format.
- Case sensitivity: Formats are generally lowercase and should be used exactly as listed.
- Version dependency: This list is based on Pandoc 2.14+. Newer versions of Pandoc might add or remove formats, so always refer to the official Pandoc documentation for the most accurate and up-to-date list. You can check this by running
pandoc --version or visiting the Pandoc website.
- How to use it:
If you're using -D for a specific purpose (like customizing templates for your Markdown to PDF conversion), remember that you can modify the output and use it with the --template option in Pandoc, as we discussed earlier.
For more details, I recommend checking the Pandoc user guide or running pandoc --help in your terminal, which lists available writers. If you have a specific format in mind, let me know for more tailored advice!