diff options
author | Rasmus <rasmus@gmx.us> | 2015-07-08 18:32:40 +0200 |
---|---|---|
committer | Rasmus <rasmus@gmx.us> | 2015-09-27 23:49:32 +0200 |
commit | 74da3bc10f68a706653a405e510639ad92590bf7 (patch) | |
tree | e3b4096172a9f943d1325e048da9bf2877b54d7d | |
parent | 1e4b7e4bec6b6d4351b1e23872b66b0fea4e182c (diff) | |
download | org-mode-74da3bc10f68a706653a405e510639ad92590bf7.tar.gz |
ox-latex: Support arbitrary bibtex-like program
* ox-latex.el (org-latex-bib-compiler): New defcustom.
(org-latex-pdf-process): Update docstring.
(org-latex-compile): Use new defcustom.
* org.texi (@LaTeX{} and PDF export): Add documentation.
-rw-r--r-- | lisp/ox-latex.el | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 951e62a..a7058b5 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1064,6 +1064,21 @@ during latex export it will output (defconst org-latex-compilers '("pdflatex" "xelatex" "lualatex") "Known LaTeX programs.") +(defcustom org-latex-bib-compiler "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 . "9.0")) + (defcustom org-latex-pdf-process '("%latex -interaction nonstopmode -output-directory %o %f" "%latex -interaction nonstopmode -output-directory %o %f" @@ -1073,7 +1088,8 @@ This is a list of strings, each of them will be given to the shell as a command. %f in the command will be replaced by the full file name, %b by the file base name (i.e. without directory and extension parts), %o by the base directory of the file, -and %latex is the LaTeX compiler (see `org-latex-compiler'). +%latex is the LaTeX compiler (see `org-latex-compiler'), and %bib +is the BibTeX-like compiler (see `org-latex-bib-compiler'). The reason why this is a list is that it usually takes several runs of `pdflatex', maybe mixed with a call to `bibtex'. Org @@ -1101,7 +1117,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" @@ -3494,13 +3510,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-compiler) (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) |