我不知道你是否真的想要一個完整的解決方案,或者寧願多探索一下自己,但這裏有一些應該幫助的東西。如果後再次你堅持:
(FWIW,我想輸出PDF輸出將匹配TeX的主,而不是當前的文件。)
[編輯2011-03-24 - 提供代碼]
這應該工作與一個局部變量的TeX文件阻止像
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% pdf-copy-path: "/pdf/copy/path"
%%% End:
注意周圍的TeX的主值和PDF格式拷貝路徑值雙引號。 TeX-master也可以是t
(defun copy-master-pdf()
"Copies the TeX master pdf file into the path defined by the
file-local variable `pdf-copy-path', given that both exist."
(interactive)
;; make sure we have local variables, and the right ones
(when (and (boundp 'file-local-variables-alist)
(assoc 'pdf-copy-path file-local-variables-alist)
(assoc 'TeX-master file-local-variables-alist))
(let* ((path (cdr (assoc 'pdf-copy-path file-local-variables-alist)))
(master (cdr (assoc 'TeX-master file-local-variables-alist)))
(pdf (cond ((stringp master)
;; When master is a string, it should name another file.
(concat (file-name-sans-extension master) ".pdf"))
((and master (buffer-file-name))
;; When master is t, the current file is the master.
(concat (file-name-sans-extension buffer-file-name) ".pdf"))
(t ""))))
(when (and (file-exists-p pdf)
(file-directory-p path))
;; The 1 tells copy-file to ask before clobbering
(copy-file pdf path 1)))))
啊。很好看TeX主人的事情。謝謝。 – Seamus 2011-02-14 15:41:33