Where Does Pandoc Store Templates and Filters?
Pandoc looks up templates, filters, and defaults in a user data directory: ~/.local/share/pandoc on Unix, %APPDATA%\pandoc on Windows.
Last updated
Pandoc's user data directory is where customization lives: templates, Lua filters, defaults files, reference docs, and metadata. The layout mirrors Pandoc's own data tree, with subfolders like templates, filters, defaults, and custom. You create the pieces you need; Pandoc never scaffolds the folder for you.
Current versions prefer the XDG spot, with the old ~/.pandoc kept as a fallback for upgrades. That fallback order explains half the confusion online: two candidate folders, and whichever exists first wins. --data-dir cuts through all of it.
Where Pandoc stores this, by platform
~/.local/share/pandoc
Subfolders templates, filters, defaults, custom, and metadata go here. Legacy ~/.pandoc is still searched when this folder is absent. XDG_DATA_HOME relocates the parent when set.
~/.local/share/pandoc
Same XDG-style default as Linux for modern Pandoc builds, with ~/.pandoc as fallback. Older guides that only mention ~/.pandoc predate the XDG move, so check both when templates seem ignored.
%APPDATA%\pandoc
The Windows default never moved to XDG; it stays under Roaming AppData. Templates go in a templates subfolder. --data-dir works identically across platforms for portable setups.
Frequently asked questions
The data directory does not exist. Is something broken?
Create it yourself. Pandoc searches the data directory but does not generate it, so mkdir -p ~/.local/share/pandoc/templates (or the Windows equivalent) and drop files in. pandoc -D latex prints a default template to seed it.
How do I point Pandoc at a different folder?
Pass --data-dir explicitly. That flag beats every default and fallback, which makes it the right tool for portable setups and per-project template sets.
Notice an outdated path? Let us know.