如何采用异步的方式将org导出成pdf?

在编写org文档的时候,有时想看看导出效果,快捷键“C-c C-e” 会执行

(org-export-dispatch &optional ARG)

函数,该函数根据你给的参数导出确定的文档格式。在导出成pdf格式时,第一步是转换成对应的.tex文件,然后再调用你机器上的latex系统对其进行编译,在windows上latex的编译速度较慢,这就造成了在导出编译的过程中 emacs 卡死不能编辑的现象,

想问一下各位大佬有没有解决方案?

导出一般格式的文档pdf

(org-latex-export-to-pdf &optional ASYNC SUBTREEP VISIBLE-ONLY
BODY-ONLY EXT-PLIST)

Export current buffer to LaTeX then process through to PDF.

If narrowing is active in the current buffer, only export its
narrowed part.

If a region is active, export that region.

A non-nil optional argument ASYNC means the process should happen
asynchronously.  The resulting file should be accessible through
the ‘org-export-stack’ interface.

导出beamer形式的pdf

org-beamer-export-to-pdf is an autoloaded interactive Lisp closure in
‘ox-beamer.el’.

It is bound to , o b p.

(org-beamer-export-to-pdf &optional ASYNC SUBTREEP VISIBLE-ONLY
BODY-ONLY EXT-PLIST)

Export current buffer as a Beamer presentation (PDF).

If narrowing is active in the current buffer, only export its
narrowed part.

If a region is active, export that region.

A non-nil optional argument ASYNC means the process should happen
asynchronously.  The resulting file should be accessible through
the ‘org-export-stack’ interface.

看这两个函数实际已经实现异步导出了,如果第一位参数非空就应该异步导出 ,在导出栈 org-export-stack 可以看到导出的运行情况,但我试了报错

(org-beamer-export-to-pdf 1 nil nil nil nil)

报错:

Unknown "nil" back-end: Aborting export

试试执行(org-latex-export-to-pdf t)

我测试下来没有问题

1 个赞

C-a

怪了,以上两个方法我都尝试过了都不行,总是报

Unknown "nil" back-end: Aborting export

是不是还需要配置什么?还是windows上不能这样用?