Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.09k stars 958 forks source link

File eisvogel.latex not found in resource path #49

Closed mrichman closed 6 years ago

mrichman commented 6 years ago

I have eisvogel.latex (renamed from eisvogel.tex) in $HOME/.pandoc/templates.

When I run pandoc my.md -o my.pdf --from markdown --template eisvogel --listings I get the error:

File eisvogel.latex not found in resource path

Please advise.

Wandmalfarbe commented 6 years ago

There seems to be an issue with the user data directory and the lookup of latex files in version 2.2.2:

Fix regression finding templates in user data directory (#4777). Under version 2.2.1 and prior pandoc found latex templates in the templates directory under the data directory, but this broke in 2.2.2.

The new pandoc version 2.2.2.1 should fix this issue. You can download it from the release page.

mrichman commented 6 years ago

I'm on 2.2.2:

pandoc --version
pandoc 2.2.2
Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2
Default user data directory: /User/Mark/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
mrichman commented 6 years ago

I was able to work around this by using --template ~/.pandoc/templates/eisvogel.latex

Wandmalfarbe commented 6 years ago

I accidentally wrote the wrong version number in the first comment. The problem is fixed in version 2.2.2.1. So you just have to update. Sorry for the confusion.

hidde-jan commented 5 years ago

Bug seems present in Pandoc 2.3.1. Pandoc doesn't even look in the data-dir it seems.

kopax commented 4 years ago

I have the same issue with pandoc 2.7.3, should --data-dir be fixed?

cagix commented 4 years ago

according to the pandoc manual in section "General writer options" pandoc would search for template files in $DATADIR/templates/, where $DATADIR can be specified using the --data-dir option ...

that is, pandoc requires a certain subfolder structure in $DATADIR. you can not specify the folder containing the template directly via the option --data-dir ...

cagix commented 4 years ago

just tried this (pandoc 2.7.3): created a subfolder templates/ in my working copy, copied eisvogel.tex to this subfolder, opened a terminal at examples/book/ and issued pandoc book.md -o book.pdf --template eisvogel.tex --data-dir ../../ ... worked pretty well :)

ok, pandoc book.md -o book.pdf --template ../../eisvogel.tex works, too ...