summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-18 09:49:12 +0100
committerBastien Guerry <bzg@altern.org>2011-02-18 09:49:12 +0100
commit68114fb650f4653eb6e71f3004e396c4241e54dd (patch)
treedbcb5546cea9a59de03632c4bb149af027ab6f75
parent373caa4d1cbf3e94edd32519b5bda1ac2d086a76 (diff)
downloadorg-mode-68114fb650f4653eb6e71f3004e396c4241e54dd.tar.gz
Replace remaining htmlp and latexp conditions.
-rw-r--r--contrib/lisp/org-exp-bibtex.el21
1 files changed, 6 insertions, 15 deletions
diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el
index ab6a6b0..de3d662 100644
--- a/contrib/lisp/org-exp-bibtex.el
+++ b/contrib/lisp/org-exp-bibtex.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2009 Taru Karttunen
-;; Author: Taru Karttunen <taruti@taruti.net >
+;; Author: Taru Karttunen <taruti@taruti.net>
;; This file is not currently part of GNU Emacs.
@@ -72,13 +72,12 @@
(opt (org-exp-bibtex-options-to-plist (match-string 3))))
(replace-match
(cond
- (htmlp ;; We are exporting to HTML
+ ((eq backend 'html) ;; We are exporting to HTML
(let (extra-args cite-list end-hook tmp-files)
(dolist (elt opt)
(when (equal "option" (car elt))
(setq extra-args (cons (cdr elt) extra-args))))
-
(when (assoc "limit" opt) ;; Limit is true - collect references
(org-exp-bibtex-docites (lambda ()
(dolist (c (org-split-string (match-string 1) ","))
@@ -107,13 +106,12 @@
(while (re-search-forward "<hr>" nil t)
(replace-match "<hr/>" t t))
(concat "\n#+BEGIN_HTML\n<div id=\"bibliography\">\n" (buffer-string) "\n</div>\n#+END_HTML\n"))))
- (latexp ;; Latex export
+ ((eq backend 'latex) ;; Latex export
(concat "\n#+LATEX: \\bibliographystyle{" style "}"
"\n#+LATEX: \\bibliography{" file "}\n"))) t t)))
-
;; Convert cites to links in html
- (when htmlp
+ (when (eq backend 'html)
;; Split citation commands with multiple keys
(org-exp-bibtex-docites
(lambda ()
@@ -126,28 +124,21 @@
(lambda () (let* ((cn (match-string 1))
(cv (assoc cn oebp-cite-plist)))
;; (message "L: %s" (concat "\[_{}[[" cn "][" (if cv (cdr cv) cn) "]]\]"))
- (replace-match (concat "\[_{}[[#" cn "][" (if cv (cdr cv) cn) "]]\]")) t t))))
-
-
-))
+ (replace-match (concat "\[_{}[[#" cn "][" (if cv (cdr cv) cn) "]]\]")) t t))))))
(defun org-exp-bibtex-docites (fun)
(save-excursion
(save-match-data
(goto-char (point-min))
- (when htmlp
+ (when (eq backend 'html)
(while (re-search-forward "\\\\cite{\\([^}\n]+\\)}" nil t)
(apply fun nil))))))
-
(defun org-exp-bibtex-options-to-plist (options)
(save-match-data
(flet ((f (o) (let ((s (split-string o ":"))) (cons (nth 0 s) (nth 1 s)))))
(mapcar 'f (split-string options nil t)))))
-
-
-
(add-hook 'org-export-preprocess-hook 'org-export-bibtex-preprocess)
(provide 'org-exp-bibtex)