Using Pandoc to write PDFs, Word documents, and slideshows in Markdown - Obsidian Community Talk
Based on Obsidian Community Talks's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Pandoc conversions follow a repeatable pattern: specify the input Markdown file (with extension) and an output filename/extension, and expect overwriting if the output name already exists.
Briefing
Pandoc turns an Obsidian-style Markdown file into polished outputs—Word documents, PDFs, and Reveal.js slide decks—by converting the content through a shared internal structure and then rendering it in the target format. The practical takeaway from this community talk is that once the command-line basics are understood (paths, input/output, and options), a repeatable workflow emerges: convert, add citations, apply custom styling, and automate the whole process inside Obsidian.
The session starts with command-line fundamentals that matter specifically for Pandoc usage. Commands follow a pattern: a program name plus arguments (like the input file) and optional flags (like output format or styling options). Just as important is “perspective” in the filesystem: absolute paths start from the computer’s root and work regardless of where the terminal is; relative paths depend on the current working directory. That distinction becomes the lever for shortening commands later.
With that foundation, Pandoc is introduced as a command-line converter that supports many document formats. Conversions follow a consistent structure: call `pandoc`, point it at an input file (including the extension so it knows the source type), specify an output filename and extension, and run. The talk demonstrates Markdown → Word and Markdown → PDF conversions using the same Markdown source. A key practical warning appears early: Pandoc overwrites output files if the target name already exists. Another concrete limitation shows up with embedded images: one embedding style carries over into Word and PDFs, while the other (the wiki-link style) does not.
Citations are handled through a three-part setup. First, citations are inserted into the Markdown using a site key (e.g., square brackets with an `@` prefix and the key). Second, Pandoc must be told where the bibliography data lives—typically by exporting a Zotero library to BibTeX or CSL JSON. Third, Pandoc needs a citation style definition (commonly APA) provided via a URL to a CSL style file. When those pieces are wired together, Pandoc generates both in-text citations and a reference list—though the reference heading must be added manually in the input.
For formatting beyond Pandoc’s defaults, the talk moves to “reference documents,” a Word-oriented template approach. The workflow is: export Pandoc’s default Word reference document, edit only the styles (not the content), then pass that reference document into the conversion command. The result is Word output with customized heading and paragraph styling.
Automation inside Obsidian comes next. The Snippets plugin lets users run shell commands from Markdown code blocks, so conversions can be triggered without leaving the editor. Chaining commands with `&` enables shorter relative-path commands by first switching into a common directory. Adding `start` opens the generated file immediately. Templater then layers on interactivity: it can pull the current file title/path, prompt for which citation style or reference document to use, and generate the final Pandoc command.
Finally, Reveal.js slideshows are produced from Markdown via Pandoc’s `reveal.js` output. The talk explains how YAML metadata becomes the title slide, how heading levels map to slide structure, and how options like theme selection, CSS injection, and reference handling can be combined. The closing Q&A highlights two workflow pain points: setting defaults to avoid repeating bibliography/style flags (via Pandoc’s data directory) and handling Obsidian block embeds (often better supported by an Obsidian Pandoc plugin, with command-line Pandoc as a fallback).
Cornell Notes
Pandoc provides a consistent command-line workflow for converting Obsidian-style Markdown into Word, PDF, and Reveal.js slides. The talk emphasizes two essentials: use the right filesystem paths (absolute vs relative) and follow Pandoc’s input/output command structure, including output overwriting behavior. Citations require three linked pieces: site-key citations in Markdown, a bibliography export from Zotero (BibTeX or CSL JSON), and a CSL citation style (e.g., APA) supplied to Pandoc. For better formatting, Word “reference documents” let users customize styles while keeping the template’s content intact. Automation is achieved by running Pandoc commands inside Obsidian using the Snippets plugin, then adding prompts and variables with Templater, and mapping Markdown headings into Reveal.js slide layouts.
Why does absolute vs relative path handling matter for Pandoc commands in an Obsidian workflow?
What are the three components needed to get citations working through Pandoc?
What limitation shows up with image embedding when converting Markdown to Word/PDF?
How do “reference documents” customize Word output without rewriting the whole template?
How can Obsidian reduce the friction of running long Pandoc commands?
How does Markdown structure map to Reveal.js slides when using Pandoc?
Review Questions
- When would you prefer relative paths over absolute paths for Pandoc, and what command-line step makes that safe?
- What exact inputs must be provided to Pandoc to format citations in APA, and where do they originate?
- How does a Word reference document differ from a full Pandoc template, and what should be edited (styles vs content) to avoid breaking the template?
Key Points
- 1
Pandoc conversions follow a repeatable pattern: specify the input Markdown file (with extension) and an output filename/extension, and expect overwriting if the output name already exists.
- 2
Absolute paths are unambiguous but long; relative paths become practical once the terminal changes into a common working directory.
- 3
Citations require three linked pieces: site-key citations in Markdown, a Zotero-exported bibliography (BibTeX or CSL JSON), and a CSL citation style (e.g., APA) provided to Pandoc.
- 4
Word formatting customization is best done via Word “reference documents,” where only style settings are edited and the template content remains intact.
- 5
Obsidian automation can be layered: Snippets runs shell commands inside notes, and Templater adds variables and prompts to generate the final Pandoc command.
- 6
Reveal.js slide decks can be generated from Markdown by mapping heading levels to slide structure, using YAML metadata for the title slide, and optionally applying themes/CSS and citation handling.
- 7
Some Obsidian-specific content (like block embeds) may require an Obsidian Pandoc plugin rather than relying solely on command-line Pandoc.