annotate lisp/auctex/style/harvard.el @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
1 ;; harvard.el --- Support for Harvard Citation style package for AUC-TeX
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
2
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Berwin Turlach <berwin@core.ucl.ac.be>
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
4
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
5 ;; Version: $Id: harvard.el,v 1.1 1997/02/20 02:15:42 steve Exp $
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
6
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
7 ;; This program is free software; you can redistribute it and/or modify
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
9 ;; the Free Software Foundation; either version 1, or (at your option)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
10 ;; any later version.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
11 ;;
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
12 ;; This program is distributed in the hope that it will be useful,
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
15 ;; GNU General Public License for more details.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
16 ;;
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
18 ;; along with this program; if not, write to the Free Software
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
19 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
20
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
21 ;;; Commentary:
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
22
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
23 ;; Harvard citation style is from Peter Williams available on the CTAN
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
24 ;; servers
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
25
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
26 ;;; Code:
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
27
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
28 (require 'latex)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
29
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
30 (TeX-add-style-hook "harvard"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
31 (function
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
32 (lambda ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
33
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
34 (LaTeX-add-environments
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
35 '("thebibliography" LaTeX-env-harvardbib ignore))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
36
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
37 (TeX-add-symbols
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
38 "harvardand"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
39 '("citeasnoun"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
40 (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
41 TeX-arg-cite)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
42 '("possessivecite"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
43 (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
44 TeX-arg-cite)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
45 '("citeaffixed"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
46 (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
47 TeX-arg-cite "Affix")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
48 '("citeyear"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
49 (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
50 TeX-arg-cite)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
51 '("citename"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
52 (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
53 TeX-arg-cite)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
54 '("citationstyle"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
55 (TeX-arg-eval completing-read "Citation style: " '(("agsm") ("dcu"))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
56 '("citationmode"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
57 (TeX-arg-eval completing-read "Citation mode: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
58 '(("full") ("abbr") ("default"))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
59 '("harvardparenthesis"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
60 (TeX-arg-eval completing-read "Harvardparenthesis: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
61 '(("round") ("curly") ("angle") ("square"))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
62 '("bibliographystyle"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
63 (TeX-arg-eval
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
64 completing-read "Bibliography style: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
65 '(("agsm") ("dcu") ("jmr") ("jphysicsB") ("kluwer") ("nederlands")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
66 ignore)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
67 '("harvarditem" [ "Short citation" ]
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
68 "Complete citation" "Year" TeX-arg-define-cite))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
69
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
70 (setq TeX-complete-list
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
71 (append '(("\\\\citeasnoun{\\([^{}\n\m\\%]*\\)"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
72 1 LaTeX-bibitem-list "}")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
73 ("\\\\citeyear{\\([^{}\n\m\\%]*\\)"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
74 1 LaTeX-bibitem-list "}")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
75 ("\\\\citename{\\([^{}\n\m\\%]*\\)"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
76 1 LaTeX-bibitem-list "}"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
77 TeX-complete-list))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
78
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
79 (setq LaTeX-item-list
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
80 (cons '("thebibliography" . LaTeX-item-harvardbib)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
81 LaTeX-item-list)))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
82
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
83 (defun LaTeX-env-harvardbib (environment &optional ignore)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
84 "Insert ENVIRONMENT with label for harvarditem."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
85 (LaTeX-insert-environment environment
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
86 (concat TeX-grop "xx" TeX-grcl))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
87 (end-of-line 0)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
88 (delete-char 1)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
89 (delete-horizontal-space)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
90 (LaTeX-insert-item))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
91
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
92 ;; Analog to LaTeX-item-bib from latex.el
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
93 (defun LaTeX-item-harvardbib ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
94 "Insert a new harvarditem."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
95 (TeX-insert-macro "harvarditem"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
96
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents:
diff changeset
97 ;; harvard.el ends here