From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Gray Subject: [PATCH] org-exp-bibtex.el changes Date: Thu, 05 Mar 2009 16:44:25 +0100 Message-ID: <86myc0dleu.fsf@portan.ibr.cs.tu-bs.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfFkW-00081J-T6 for emacs-orgmode@gnu.org; Thu, 05 Mar 2009 10:44:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfFkU-0007yW-2j for emacs-orgmode@gnu.org; Thu, 05 Mar 2009 10:44:39 -0500 Received: from [199.232.76.173] (port=34483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfFkT-0007y6-QC for emacs-orgmode@gnu.org; Thu, 05 Mar 2009 10:44:37 -0500 Received: from main.gmane.org ([80.91.229.2]:34297 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LfFkS-0005CT-Vk for emacs-orgmode@gnu.org; Thu, 05 Mar 2009 10:44:37 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LfFkQ-0000qu-RS for emacs-orgmode@gnu.org; Thu, 05 Mar 2009 15:44:34 +0000 Received: from portan.ibr.cs.tu-bs.de ([134.169.34.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Mar 2009 15:44:34 +0000 Received: from chrismgray by portan.ibr.cs.tu-bs.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Mar 2009 15:44:34 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Hi, Here is a patch that uses the -a switch of bibtex2html to sort the citations as bibtex would. It also changes the invocations of replace-match to set fixedcase and literal to t. This is so that emacs does not try to interpret backslash characters in the bibtex file as it is inserting them. Cheers, Chris --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-exp-bibtex-patch.patch --- contrib/lisp/org-exp-bibtex.el | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el index d27fd59..a2051ff 100644 --- a/contrib/lisp/org-exp-bibtex.el +++ b/contrib/lisp/org-exp-bibtex.el @@ -56,7 +56,7 @@ (replace-match (cond (htmlp ;; We are exporting to HTML - (call-process "bibtex2html" nil nil nil "--nodoc" "--style" style "--no-header" (concat file ".bib")) + (call-process "bibtex2html" nil nil nil "-a" "--nodoc" "--style" style "--no-header" (concat file ".bib")) (with-temp-buffer (save-match-data (insert-file-contents (concat file ".html")) @@ -65,19 +65,19 @@ (setq oebp-cite-plist (cons (cons (match-string 1) (match-string 2)) oebp-cite-plist))) (goto-char (point-min)) (while (re-search-forward "
" nil t) - (replace-match "
")) + (replace-match "
" t t)) (concat "\n#+BEGIN_HTML\n
\n" (buffer-string) "\n
\n#+END_HTML\n")))) (latexp ;; Latex export (concat "\n#+LATEX: \\\\bibliographystyle{" style "}" - "\n#+LATEX: \\\\bibliography{" file "}\n")))))) + "\n#+LATEX: \\\\bibliography{" file "}\n"))) t t))) ;; Convert cites to links in html (goto-char (point-min)) (when htmlp (while (re-search-forward "\\\\cite{\\(\\w+\\)}" nil t) (let* ((cn (match-string 1)) (cv (assoc cn oebp-cite-plist))) - (replace-match - (concat "\[_{}[[" cn "][" (if cv (cdr cv) cn) "]]\]"))))))) + (replace-match + (concat "\[_{}[[" cn "][" (if cv (cdr cv) cn) "]]\]") t t)))))) (add-hook 'org-export-preprocess-hook 'org-export-bibtex-preprocess) -- 1.5.6.3 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--