Вопрос

I use GNU Emacs in a Mac. After installing the last version of Pandoc I can't create pdf files. Pandoc works well when I use the Terminal. I think that the problem has to do with the fact that Emacs doesn't find the template default.latex. This template is in my ~/.pandoc/templates.

This is the error message I receive when trying to create a pdf: pandoc: /usr/local/share/pandoc-1.10.1/data/templates/default.latex: openBinaryFile: does not exist (No such file or directory)

I don't understand why Emacs is trying to find default.latex here.

Это было полезно?

Решение

(setq pandoc-binary "/usr/local/bin/pandoc")

This answer assumes you do not have a folder named pandoc inside of /usr/local/bin/ and that the actual executable has an absolute path of /usr/local/bin/pandoc. If the executable is buried deeper in another folder or more, then adjust the path in this example accordingly. The code at the top of this answer goes in your .emacs file.

You may also wish to modify this variable depending upon your preferred setup:

(setq pandoc-data-dir "~/.emacs.d/pandoc-mode/")

Другие советы

You could achieve a more general solution using exec-path-from-shell:

A GNU Emacs library to ensure environment variables inside Emacs look the same as in the user's shell.

Just install it, require it (only if your aren't using MELPA) in your .emacs file and add this line to it:

(exec-path-from-shell-initialize)

For more information see the usage section in the README.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top