【发布时间】:2017-12-03 20:38:34
【问题描述】:
我在 emacs 25.3 上使用了最新的主版本 0.200.10.x Spacemacs。我试图实现一个由orgmodedocumentation 推荐的函数,允许用户定义他/她想要使用的Latex 编译器。我实现了这个功能,但它似乎没有用。乳胶编译步骤继续使用pdflatex,而不是文件头中指定的xelatex。所以我试图弄清楚要进行什么调整。
;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
;; but adapted to use latexmk 4.20 or higher.
(defun my-auto-tex-cmd ()
"When exporting from .org with latex, automatically run latex,
pdflatex, or xelatex as appropriate, using latexmk."
(let ((texcmd)))
;; default command: oldstyle latex via dvi
(setq texcmd "latexmk -dvi -pdfps -quiet %f")
;; pdflatex -> .pdf
(if (string-match "LATEX_CMD: pdflatex" (buffer-string))
(setq texcmd "latexmk -pdf -quiet %f"))
;; xelatex -> .pdf
(if (string-match "LATEX_CMD: xelatex" (buffer-string))
(setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
;; LaTeX compilation command
(setq org-latex-to-pdf-process (list texcmd)))
(add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
根据Spacemacs 问题list 我需要更改spacemacs-configuration-layers 设置a la:
dotspacemacs-configuration-layers '(
(latex :variables latex-build-command "LaTeX"))
问题是在dotspacemacs-configuration-layers 中进行更改似乎不允许我根据文件特定设置应用更改。
有人知道在 spacemacs 中实现上述功能 (my-auto-tex-cmd) 的正确方法吗?
【问题讨论】: