emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chris Gray <chrismgray@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-exp-bibtex.el changes
Date: Thu, 05 Mar 2009 16:44:25 +0100	[thread overview]
Message-ID: <86myc0dleu.fsf@portan.ibr.cs.tu-bs.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-exp-bibtex-patch.patch --]
[-- Type: text/x-diff, Size: 1721 bytes --]

---
 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 "<hr>" nil t)
-		(replace-match "<hr/>"))
+		(replace-match "<hr/>" t t))
 	      (concat "\n#+BEGIN_HTML\n<div class=\"bibliography\">\n" (buffer-string) "\n</div>\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


[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

             reply	other threads:[~2009-03-05 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 15:44 Chris Gray [this message]
2009-03-07 23:13 ` [PATCH] org-exp-bibtex.el changes Taru Karttunen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86myc0dleu.fsf@portan.ibr.cs.tu-bs.de \
    --to=chrismgray@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).