unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* bibtex-mode wishes
@ 2003-01-08 17:21 Michael Below
  2003-01-08 18:16 ` Roland Winkler
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Below @ 2003-01-08 17:21 UTC (permalink / raw)



Hi,

I have a couple of issues regarding the bibtex-mode:

 - Entries should be sorted w/o regard to the case of their key.  

 - If I crossreference an entry, the referencing entry should be
   sorted before the entry referenced to, otherwise bibtex wont be
   able to solve the reference.

 - I would like to make publisher optional, instead year and address
   should become mandatory for @book, @collection, @proceedings,
   @commented, @inbook, @incollection and @inproceedings. For @book
   school and dissyear should be optional. For @book, @commented,
   @collection, @proceedings, @incollection, @inbook and
   @inproceedings location should be optional.

By now, all I managed to do is setting:
 '(bibtex-user-optional-fields (quote (("abstract" "Zusammenfassung")
 ("school" "Bei Diss: Uni, an der sie angenommen wurde") ("dissyear"
 "Bei Diss: Jahr der Promotion") ("location" "Standort des Buches"))))
in my .emacs, this makes a number of fields optional for all kinds of
entries... 

Any ideas?

Michael

-- 
Der hohe Anteil an Dienstreisen fällt auf.
			Niklas Luhmann, Die Weltgesellschaft, ARSP 1971, 8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bibtex-mode wishes
  2003-01-08 17:21 bibtex-mode wishes Michael Below
@ 2003-01-08 18:16 ` Roland Winkler
  2003-01-08 20:35   ` Michael Below
  2003-01-10 19:20 ` Jim Ottaway
  2003-01-12 20:25 ` Stefan Monnier <foo@acm.com>
  2 siblings, 1 reply; 6+ messages in thread
From: Roland Winkler @ 2003-01-08 18:16 UTC (permalink / raw)


Michael Below <mbelow@antithese.de> writes:

> I have a couple of issues regarding the bibtex-mode:

Thank you, I'll think about these things.

Roland

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bibtex-mode wishes
  2003-01-08 18:16 ` Roland Winkler
@ 2003-01-08 20:35   ` Michael Below
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Below @ 2003-01-08 20:35 UTC (permalink / raw)



Ah, so you are the maintainer? Thanx for bibtex-mode, its very useful!
But your reply sounds like my wishes are rather complicated... :(

Michael
-- 
Der hohe Anteil an Dienstreisen fällt auf.
			Niklas Luhmann, Die Weltgesellschaft, ARSP 1971, 8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bibtex-mode wishes
  2003-01-08 17:21 bibtex-mode wishes Michael Below
  2003-01-08 18:16 ` Roland Winkler
@ 2003-01-10 19:20 ` Jim Ottaway
  2003-01-12 20:25 ` Stefan Monnier <foo@acm.com>
  2 siblings, 0 replies; 6+ messages in thread
From: Jim Ottaway @ 2003-01-10 19:20 UTC (permalink / raw)


>>>>> "Michael" == Michael Below <mbelow@antithese.de> writes:

    >  - If I crossreference an entry, the referencing entry should be
    >    sorted before the entry referenced to, otherwise bibtex wont be
    >    able to solve the reference.

 I have changed `bibtex-sort-buffer' to achieve this by fiddling with
 the sort keys:

(defun bibtex-sort-buffer ()
  "Sort BibTeX buffer alphabetically by key.
Text outside of BibTeX entries is not affected.  If
`bibtex-sort-ignore-string-entries' is non-nil, @String entries will be
ignored."
  (interactive)
  (save-restriction
    (narrow-to-region
     (bibtex-beginning-of-first-entry)
     (save-excursion
       (goto-char (point-max))
       (bibtex-end-of-entry)))
    (bibtex-skip-to-valid-entry)
    (sort-subr
     nil
     ;; NEXTREC function
     'bibtex-skip-to-valid-entry
     ;; ENDREC function
     'bibtex-end-of-entry
     ;; STARTKEY function
     (lambda ()
       (let* ((case-fold-search t)
	      key entry-end xref-match)
         (re-search-forward bibtex-entry-head)
	 (setq key
	       (buffer-substring-no-properties
		(match-beginning bibtex-key-in-head)
		(match-end bibtex-key-in-head)))
	 (save-excursion
	   (bibtex-end-of-entry)
	   (setq entry-end (point)))
	 (if (re-search-forward
	      "^[ \t]*crossref[ \t]*=[ \t]*"
	      entry-end t)
	     ;; If there is a cross-reference, make a new key that
	     ;; will be less than the cross-referred item's key.
	     (progn
	       (setq xref-match (bibtex-search-forward-field-string entry-end))
	       (concat (buffer-substring-no-properties
			;; Trim the braces/quotes and replace the last
			;; character of the key with a space
			;; (makes it string< than book key). 
			;; Concatenate this with the actual entry key,
			;; so that it is sorted properly with other
			;; entries with the same cross-reference.
			(1+ (car xref-match))
			(- (cdr xref-match) 2))
		       " "
		       key))
	   key))))))

It seems to work; perhaps I should send this to the maintainer.

Regards,

Jim Ottaway

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bibtex-mode wishes
  2003-01-08 17:21 bibtex-mode wishes Michael Below
  2003-01-08 18:16 ` Roland Winkler
  2003-01-10 19:20 ` Jim Ottaway
@ 2003-01-12 20:25 ` Stefan Monnier <foo@acm.com>
  2003-01-17 14:03   ` Jim Ottaway
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-01-12 20:25 UTC (permalink / raw)


>>>>> "Michael" == Michael Below <mbelow@antithese.de> writes:
>  - If I crossreference an entry, the referencing entry should be
>    sorted before the entry referenced to, otherwise bibtex wont be
>    able to solve the reference.

I also would like to see such a thing.
An "easy" way is to make it possible to have several sections
where the sorting only moves entries within their section.

This way you can put the papers in the first section and the
cross-referenced proceedings in which they appear are all in the second
section.

It shouldn't be too hard to implement.


        Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bibtex-mode wishes
  2003-01-12 20:25 ` Stefan Monnier <foo@acm.com>
@ 2003-01-17 14:03   ` Jim Ottaway
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Ottaway @ 2003-01-17 14:03 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> wrote in message news:<5lfzrydskh.fsf@rum.cs.yale.edu>...
> >>>>> "Michael" == Michael Below <mbelow@antithese.de> writes:
> >  - If I crossreference an entry, the referencing entry should be
> >    sorted before the entry referenced to, otherwise bibtex wont be
> >    able to solve the reference.
> 
> I also would like to see such a thing.
> An "easy" way is to make it possible to have several sections
> where the sorting only moves entries within their section.
> 
> This way you can put the papers in the first section and the
> cross-referenced proceedings in which they appear are all in the second
> section.
> 

The solution I posted previously does something slightly different: it
keeps the referencing entries with the referenced entry and sorts on
the referenced entry.  I have been using it for a while, and it is
convenient because you don't have to do anything special in the bibtex
file.

By the way, what is the best way to post to this group?   I have had
some difficulty getting through, hence the google post.

Regards, 

Jim Ottaway

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-17 14:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08 17:21 bibtex-mode wishes Michael Below
2003-01-08 18:16 ` Roland Winkler
2003-01-08 20:35   ` Michael Below
2003-01-10 19:20 ` Jim Ottaway
2003-01-12 20:25 ` Stefan Monnier <foo@acm.com>
2003-01-17 14:03   ` Jim Ottaway

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).