6
我使用Latex, Emacs: automatically open *TeX Help* buffer on error and close it after correction of the error?下面的函数通过latexmk
编译.tex文件:如何将函数(latexmk变体)添加到AUCTeX中的TeX-command-list?
(defun run-latexmk()
(interactive)
(let ((TeX-save-query nil)
(TeX-process-asynchronous nil)
(master-file (TeX-master-file)))
(TeX-save-document "")
(TeX-run-TeX "latexmk"
(TeX-command-expand "latexmk -pdf %s" 'TeX-master-file); adjusted
master-file)
(if (plist-get TeX-error-report-switches (intern master-file))
(TeX-next-error t)
(progn
(demolish-tex-help)
(minibuffer-message "latexmk: Done")))))
我怎样才能在.tex文件被“添加”这个功能TeX-command-list
使C-c C-c
执行这个功能呢? [当.tex文件被执行C-c C-c
应该使用run-latexmk
为默认]
我试图
(add-hook 'LaTeX-mode-hook
(lambda()
(add-to-list 'TeX-command-list
'("latexmk" #'run-latexmk
TeX-run-command nil t :help "Run latexmk") t)
(setq TeX-command-default "latexmk")))
,但它失败消息:TeX-command-expand: Wrong type argument: stringp, (function run-latexmk)
看起来棒极了,工作太棒了。非常感谢,伊万! – 2012-02-26 23:19:21
我在'LaTeX-mode-hook'的'Tex-command-list'中设置了多个选项,所以我可以在'Cc Cc'中选择任何一个选项,并且将其中的一个设置为'TeX-command-default', LaTeX-mode-hook',但我使用另一个函数来运行整个编译过程,所以我不必从'Cc Cc'中选择一个,我怎样才能使用该函数中的'Tex-command-default'值? – CodyChan 2017-08-23 07:19:34
尝试在其他函数中使用绑定TeX-command-default,例如(defun xxx()(let((TeX-command-default“my command”))...)) – 2017-08-24 02:49:54