From 7888cd0b430964d71a15a7867d24ed21868cd95f Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 14 Jan 2014 19:42:01 -0800 Subject: [PATCH] use latexmk for everything; fix package list --- .emacs | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/.emacs b/.emacs index 350375c..d56140b 100644 --- a/.emacs +++ b/.emacs @@ -631,7 +631,7 @@ Argument DESCRIPTION MIME description." ;; default listings package instead, use ;; (setq org-latex-listings t) ;; and change references to "minted" below to "listings" -(setq org-latex-listings 'minted) +; (setq org-latex-listings 'minted) ;; default settings for minted code blocks (setq org-latex-minted-options @@ -675,43 +675,23 @@ Argument DESCRIPTION MIME description." ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432 ;; but adapted to use latexmk 4.22 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: pdflatex - (setq texcmd "latexmk -pdflatex='pdflatex -synctex=1 --shell-escape --' -pdf %f") - ;; pdflatex -> .pdf - (if (string-match "LATEX_CMD: pdflatex" (buffer-string)) - (setq texcmd "latexmk -pdflatex='pdflatex -synctex=1 --shell-escape' -pdf %f")) - ;; xelatex -> .pdf - (if (string-match "LATEX_CMD: xelatex" (buffer-string)) - (setq texcmd "latexmk -pdflatex='xelatex -syntex=1 --shell-escape' -bibtex -use-make -pdf %f")) - ;; LaTeX compilation command - (setq org-latex-to-pdf-process (list texcmd))) - -(add-hook 'org-latex-after-initial-vars-hook 'my-auto-tex-cmd) +(setq org-latex-pdf-process '("latexmk -pdflatex=xelatex -bibtex -use-make -pdf %f")) ;; Default packages included in /every/ tex file, latex, pdflatex or xelatex +(setq org-latex-default-packages-alist + '(("" "fontspec" t) + ("" "xunicode" t) + )) (setq org-latex-packages-alist '(("" "graphicx" t) + ("" "fontspec" t) + ("" "xunicode" t) + ("" "hyperref" t) + ("" "url" t) + ("" "rotating" t) ("" "longtable" nil) ("" "float" ))) -;; Custom packages -(defun my-auto-tex-parameters () - "Automatically select the tex packages to include. See https://github.com/kjhealy/latex-custom-kjh for the support files included here." - ;; default packages for ordinary latex or pdflatex export - (setq org-latex-default-packages-alist - '(("AUTO" "inputenc" t) - ("minted,minion" "org-preamble-pdflatex" t))) - ;; Packages to include when xelatex is used - (if (string-match "LATEX_CMD: xelatex" (buffer-string)) - (setq org-latex-default-packages-alist - '(("minted" "org-preamble-xelatex" t) )))) - -(add-hook 'org-latex-after-initial-vars-hook 'my-auto-tex-parameters) - ; support ignoring headers in org mode export to latex ; from http://article.gmane.org/gmane.emacs.orgmode/67692 (defadvice org-latex-headline (around my-latex-skip-headlines -- 2.39.2