2

I want to use a custom latex template with Pandoc.

I followed the instructions (--data-dir) but then I couldn't find the user data directory on my mac as explained here.

So I created the .pandoc/templates folders manually, put my template inside ~/.pandoc/templates, run pandoc input.md --template=mytemplate.latex -o output.pdf

and this is what I get

pandoc: Could not find data file /usr/local/Cellar/pandoc/1.18/share/x86_64-osx-ghc-8.0.1/pandoc-1.18/data/templates/mytemplate.latex

I could easily move my template inside that folder but I'm quite sure that's not the right way, if only for the fact that it would stop working as soon as I upgrade to v.1.19.

Community
  • 1
  • 1
Barbara
  • 12,908
  • 6
  • 32
  • 43

1 Answers1

0

Ok, solved. For some reason it couldn't read my template file.

Instead I've edited the template that pandoc -D latex > ~/.pandoc/templates/default.latex generated and renamed it to mytemplate.latex.

It's working now.

Barbara
  • 12,908
  • 6
  • 32
  • 43