Tuesday, January 31, 2006

XEmacs tip: Add a Webpage entry for BibTeX

A useful BibTeX entry to have is that for BibTeX. The first step is to install the urlbst package. Then, to have the entry play nicely with the BibTeX autocompletion features in XEmacs, add the below code to the file init.el.

(defun my-bibtex-hook ()
(setq bibtex-mode-user-optional-fields '("location" "issn"))
(setq bibtex-entry-field-alist
'("Webpage" ((("url" "The URL of the page")
("title" "The title of the resource"))
(("author" "The author of the webpage")
("editor" "The editor/maintainer of the webpage")
("year" "Year of publication of the page")
("month" "Month of publication of the page")
("lastchecked" "Date when you last verified the page was there")
("note" "Remarks to be put at the end of the entry"))))
(add-hook 'bibtex-mode-hook 'my-bibtex-hook)

1 comment:

  1. I should point out that the above bit of Emacs Lisp is borrowed from a different webpage. Unfortunately, I can't remember which one.