Emacs和Pandoc:无法创建pdf [英] Emacs and Pandoc: can't create a pdf

查看:68
本文介绍了Emacs和Pandoc:无法创建pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac中使用GNU Emacs.安装最新版本的Pandoc后,我无法创建pdf文件.当我使用终端机时,Pandoc效果很好.我认为问题与Emacs找不到模板default.latex有关.这个模板在我的〜/.pandoc/templates 中.

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.

这是我在尝试创建pdf时收到的错误消息:pandoc:/usr/local/share/pandoc-1.10.1/data/templates/default.latex:openBinaryFile:不存在(没有这样的文件或目录)

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)

我不明白为什么Emacs试图在这里找到 default.latex .

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

推荐答案

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

此答案假设您在/usr/local/bin/内没有名为 pandoc 的文件夹,并且实际的可执行文件的绝对路径为/usr/local/bin/pandoc .如果可执行文件更深地埋在另一个文件夹或更多文件夹中,则在此示例中相应地调整路径.此答案顶部的代码位于您的 .emacs 文件中.

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/")

这篇关于Emacs和Pandoc:无法创建pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆