>From c8a97a2d79d349a5d7c55ce052daa0794bde49ad Mon Sep 17 00:00:00 2001 From: thibault Date: Tue, 23 Aug 2016 22:57:19 -0500 Subject: [PATCH] * contrib/lisp/ox-bibtex.el (org-bibtex-process-bib-files): Add support for multiple bibliography files with html export. Combine comma-separated bibliography files into a single one and process it using bibtex2html. This matches the behavior already present for latex export. --- contrib/lisp/ox-bibtex.el | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 56dec38..7e266ab 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -191,13 +191,34 @@ Return new parse tree." (file (org-bibtex-get-file keyword)) temp-file out-file) + (let ((files (org-split-string file ","))) + (when (< 1 (length files)) + (let ((combined-bib-file + (concat + (file-name-sans-extension + (file-name-nondirectory + (buffer-file-name))) "-combined.bib"))) + (with-temp-file combined-bib-file + (dolist (bib files) + (insert-file-contents + (if (equal (file-name-extension bib) "bib") + bib + (concat bib ".bib") + ) + ) + ) + ) + (setq file combined-bib-file) + ) + ) + ) ;; Test if filename is given with .bib-extension and strip ;; it off. Filenames with another extensions will be ;; untouched and will finally rise an error in bibtex2html. (setq file (if (equal (file-name-extension file) "bib") (file-name-sans-extension file) file)) - ;; Outpufiles of bibtex2html will be put into current working directory - ;; so define a variable for this. + ;; Output files of bibtex2html will be put into current + ;; working directory so define a variable for this. (setq out-file (file-name-sans-extension (file-name-nondirectory file))) ;; limit is set: collect citations throughout the document -- 2.8.1