Browse Source

org-exp-bibtex.el: More improvements

Better error message, more general citation key matching.
Carsten Dominik 16 years ago
parent
commit
cf71b88515
2 changed files with 16 additions and 6 deletions
  1. 9 0
      contrib/ChangeLog
  2. 7 6
      contrib/lisp/org-exp-bibtex.el

+ 9 - 0
contrib/ChangeLog

@@ -1,3 +1,12 @@
+2009-03-12  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* lisp/org-exp-bibtex.el (org-export-bibtex-preprocess): Analyze
+	return value of the call to bibtex2html.
+	(org-export-bibtex-preprocess): Change Class to ID, there can only
+	be one.
+	(org-exp-bibtex-docites): Generalize the regexp looking for
+	citations.
+
 2009-02-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* lisp/org2rem.el: New version from Shatad Pratap.

+ 7 - 6
contrib/lisp/org-exp-bibtex.el

@@ -86,10 +86,11 @@
 		(setq tmp-files   (cons tmp tmp-files))
 		(setq extra-args (append extra-args `("-citefile" ,tmp)))))
 
-	    (apply 'call-process  (append '("bibtex2html" nil nil nil)
-					  `("-a" "--nodoc"  "--style" ,style "--no-header")
-					  extra-args
-					  (list (concat file ".bib"))))
+	    (when (not (eq 0 (apply 'call-process  (append '("bibtex2html" nil nil nil)
+							   `("-a" "--nodoc"  "--style" ,style "--no-header")
+							   extra-args
+							   (list (concat file ".bib"))))))
+	      (error "Executing bibtex2html failed"))
 
 	    (dolist (f tmp-files) (delete-file f)))
 
@@ -102,7 +103,7 @@
 	      (goto-char (point-min))
 	      (while (re-search-forward "<hr>" nil t)
 		(replace-match "<hr/>" t t))
-	      (concat "\n#+BEGIN_HTML\n<div class=\"bibliography\">\n" (buffer-string) "\n</div>\n#+END_HTML\n"))))
+	      (concat "\n#+BEGIN_HTML\n<div id=\"bibliography\">\n" (buffer-string) "\n</div>\n#+END_HTML\n"))))
 	 (latexp ;; Latex export
 	  (concat "\n#+LATEX: \\\\bibliographystyle{" style "}"
 		  "\n#+LATEX: \\\\bibliography{" file "}\n"))) t t)))
@@ -124,7 +125,7 @@
     (save-match-data
       (goto-char (point-min))
       (when htmlp
-	(while (re-search-forward "\\\\cite{\\(\\w+\\)}" nil t)
+	(while (re-search-forward "\\\\cite{\\([^}\n]+\\)}" nil t)
 	  (apply fun nil))))))