Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer find custom templates in data-dir/templates under 2.2.2 #4777

Closed
rbubley opened this issue Jul 17, 2018 · 8 comments
Closed

Can no longer find custom templates in data-dir/templates under 2.2.2 #4777

rbubley opened this issue Jul 17, 2018 · 8 comments

Comments

@rbubley
Copy link

rbubley commented Jul 17, 2018

Under version 2.2.1 and prior pandoc found latex templates in the templates directory under the data directory, but this is no longer working for me under 2.2.2.

pandoc --from=markdown+raw_attribute+smart --pdf-engine=xelatex --template=template-report.latex test.md -o test.tex

gives

File template-report.latex not found in resource path

Working version:

pandoc 2.2.1
Compiled with pandoc-types 1.17.4.2, texmath 0.11, skylighting 0.7.0.2

Non-working version:

pandoc 2.2.2
Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2

In each case this is the version installed using the macOS .pkg installer on the github release page.

@mb21
Copy link
Collaborator

mb21 commented Jul 17, 2018

You shouldn't need --template then, only -s. From the MANUAL:

You can also override the system default templates for a given output format FORMAT by putting a file templates/default.*FORMAT* in the user data directory (see --data-dir

@giovino
Copy link

giovino commented Jul 17, 2018

OS: Mac OS 10.13.5
Pandoc: pandoc 2.2.2
  * Compiled with pandoc-types 1.17.5.1, texmath 0.11.0.1, skylighting 0.7.2
  * Installed using Brew

I am also seeing a regression when using --template. Prior to 2.2.2 the following command worked:

pandoc --template=GitHub.html5 -s test.md -o test.html --metadata pagetitle="asdf"

Now I get the error message:

File GitHub.html5 not found in resource path

  • Location of GitHub.html5:
    /Users/giovino/.pandoc/templates/GitHub.html5

If I specify the full path of the template, the original command works as expected:

pandoc --template=/Users/giovino/.pandoc/templates/GitHub.html5 -s test.md -o test.html --metadata pagetitle="asdf"

@rbubley
Copy link
Author

rbubley commented Jul 17, 2018

Amending title following comments from @mb21 and @giovino.

@rbubley rbubley changed the title Can no longer find latex templates under 2.2.2 Can no longer find custom templates in data-dir/templates under 2.2.2 Jul 17, 2018
@nfleisher
Copy link
Contributor

Same behavior here under 2.2.2, with the Linux packages (.deb and .tar.gz).

Pandoc will find the template if it is in the working directory or if the full path is specified. Specifying the path with ~/.pandoc/templates/ as prefix also generates the "not found in resource path" error.

@mb21
Copy link
Collaborator

mb21 commented Jul 18, 2018

Ah, I understand now. This seems indeed like a bug, since it's documented in the MANUAL:

If the template is not found, pandoc will search for it in the templates subdirectory of the user data directory (see --data-dir).

@mb21 mb21 added the bug label Jul 18, 2018
@jgm
Copy link
Owner

jgm commented Jul 19, 2018

I suspect the culprit is this change:
07bce91

@jgm jgm closed this as completed in d7edfbd Jul 19, 2018
@jgm
Copy link
Owner

jgm commented Jul 19, 2018

I'll do a bugfix release soon, because I hate regressions!

@hoclun-rigsep
Copy link

On Mac OS 10.14.5 installed with homebrew:

$ pandoc --version
pandoc 2.8.1
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.3
Default user data directory: /Users/jim/.local/share/pandoc or /Users/jim/.pandoc

However, this only works for me when files are in .local/share/pandoc, not ~/.pandoc. This is apparently true even if there is no ~/.local/share/pandoc directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants