>From c365b1e6016b3f11fc64a0fe0ce78e3848d5dfa9 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Wed, 8 Jul 2015 18:32:40 +0200 Subject: [PATCH 3/4] ox-latex: Support arbitrary bibtex-like program. * ox-latex.el (org-latex-bib-process): New defcustom. (org-latex-pdf-process, org-latex-compile): Use new defcustom. --- lisp/ox-latex.el | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 233e9e9..0ee0c15 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1064,6 +1064,21 @@ during latex export it will output ;;;; Compilation +(defcustom org-latex-bib-process "bibtex" + "Command used to process a LaTeX files bibliography. + +The shorthand %bib in `org-latex-pdf-process' is replaced with +this value. + +A better approach is to use a compiler suit such as `latexmk'. +" + :group 'org-export-latex + :type '(choice (const :tag "BibTeX" "bibtex") + (const :tag "Biber" "biber") + (string :tag "Other process")) + :version "25.1" + :package-version '(Org . "8.3")) + (defcustom org-latex-pdf-process '("%latex -interaction nonstopmode -output-directory %o %f" "%latex -interaction nonstopmode -output-directory %o %f" @@ -1101,7 +1116,7 @@ file name as its single argument." "%latex -interaction nonstopmode -output-directory %o %f")) (const :tag "latex,bibtex,latex,latex" ("%latex -interaction nonstopmode -output-directory %o %f" - "bibtex %b" + "%bib %b" "%latex -interaction nonstopmode -output-directory %o %f" "%latex -interaction nonstopmode -output-directory %o %f")) (const :tag "texi2dvi" @@ -3492,13 +3507,15 @@ Return PDF file name or an error if it couldn't be produced." (dolist (command org-latex-pdf-process) (shell-command (replace-regexp-in-string - "%latex" (shell-quote-argument compiler) + "%bib" (shell-quote-argument org-latex-bib-process) (replace-regexp-in-string - "%b" (shell-quote-argument base-name) + "%latex" (shell-quote-argument compiler) (replace-regexp-in-string - "%f" (shell-quote-argument full-name) + "%b" (shell-quote-argument base-name) (replace-regexp-in-string - "%o" (shell-quote-argument out-dir) command t t) t t) t t) t) + "%f" (shell-quote-argument full-name) + (replace-regexp-in-string + "%o" (shell-quote-argument out-dir) command t t) t t) t t) t) t) outbuf)) ;; Collect standard errors from output buffer. (setq warnings (and (not snippet) -- 2.5.1