Topic: Sorting a bibtex file. (1 of 7), Read 72 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Sunday, November 16, 2003 03:35 PM

Hello.

I would like to sort a Latex bibliography file.

This has several entries and each entry starts with a new line having ,"{", the left curly brace and ends on a line
containing, "}", the right curly brace.

My problem is that the number of lines varies fro item to item.

I thought that Fritz is working with large bib files and I would like to know how does he handle this problem.

It is certainly not a major issue, since I can find an author by the usual search command. At the same time I thought there is no harm asking.

Thanks,

-peter.

 


Topic: Re: Sorting a bibtex file. (2 of 7), Read 71 times
Conf: VEDIT User Applications
From: Fritz Heberlein
Date: Sunday, November 16, 2003 05:08 PM

> I would like to sort a Latex bibliography file.
>
> It is certainly not a major issue, since I can find an author by the
> usual search command.

So it's the author field only, on which you want to sort?
In that case, it's straightforward:

1. insert some end-of-line delimiter after each field, say "%#"
(necessary to distinguish end of field brackets from brackets inside
fields)

2. Convert all bib-entries to a single line, using txt-word.vdm

3. determine column # of (end of) longest author field

4. ins_indent all fields after author field past column #

5. sort on col 1-#

6. reformat bib-entries by replacing "%#" with |n

For step 3, you could adapt the code of "find longest line" out of
the standard user.mnu

Or -- be lazy: import your bib file into asksam or zoot! or any
dedicated bibliographic software that can handle bibtex files,
declare "{author " als field name and sort on it.

Regards,

Fritz
--
Dr. Friedrich Heberlein, Akad. Direktor
Seminar für Klassische Philologie, KU Eichstaett-Ingolstadt
Universitaetsallee 1
D-85071 Eichstaett / Bayern

 


Topic: Re: Sorting a bibtex file. (3 of 7), Read 74 times
Conf: VEDIT User Applications
From: Pauli Lindgren
Date: Monday, November 17, 2003 11:35 AM

Or you could format the file so that there is an empty line between each record.
Then use "Edit" -> "Sort" -> "Sort mailing labels".

--
Pauli

 


Topic: Re: Sorting a bibtex file. (4 of 7), Read 61 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Tuesday, November 18, 2003 06:02 AM

On 11/17/2003 11:35:45 AM, Pauli Lindgren wrote:
>Or you could format the file
>so that there is an empty line
>between each record.
>Then use "Edit" -> "Sort" ->
>"Sort mailing labels".

Thanks Pauli,


MAILSORT.VDM is a good old Vedit distribution macro and for some reason I have completely missed it.

I tried it on my bibtex file and it did exactly what you told me. That is to say, it sorted my line separated records by the first line of the record.

It turns out that the first line of a bibtex record is a label, like, "@article", "@book", "etc". So, I am asking for help in replacing "the first line of the record" by the "second line of the record" in this macro. Since this is a delicate macro, I thought not to experiment on my own.

Thanks for everything,

-peter.


P.S. I found a totally harmless typo in this macro. It can no longer be called from the {Misc, More Macros} menu. However, it can be called from Vedit as per your instructions. Ted might be interested in correcting this harmless typo.

 


Topic: Re: Sorting a bibtex file. (6 of 7), Read 52 times
Conf: VEDIT User Applications
From: Christian Ziemski
Date: Friday, November 21, 2003 03:40 AM

On 11/18/2003 6:02:46 AM, Peter Rejto wrote:
>P.S. I found a totally harmless typo in
>this macro. It can no longer be called
>from the {Misc, More Macros} menu.
>However, it can be called from Vedit as
>per your instructions. Ted might be
>interested in correcting this harmless
>typo.

And the online help still points to the old menu entry too.

Christian

 


Topic: Re: Sorting a bibtex file. (5 of 7), Read 63 times
Conf: VEDIT User Applications
From: Peter Rejto
Date: Tuesday, November 18, 2003 06:20 AM

On 11/16/2003 5:08:40 PM, Fritz Heberlein wrote:

>Or -- be lazy: import your bib
>file into asksam or zoot! or
>any
>dedicated bibliographic
>software that can handle
>bibtex files,
>declare "{author " als field
>name and sort on it.
>

Thanks Fritz,

I have chosen the lazy option and went on google and searched for "asksam bibtex". I got quite a few pages of references. Extensions of bibtex allowing you to.

.... add comments, eliminate duplicates, convert, ..

Actually, I would value the option of adding comments. Then I realized that I have seen on the Amer Math Soc website a bibtex replacement which is Tex compatible. I just realized that this implies the comment option.


Now the conversion/import issue: Personally, I have been spoiled by the AMS database, which gives you the option of downloading in bibtex format. So, if I need a reference to a math research paper or monograph, I can get it in bibtex format.

Unfortunately, this does not work for textbooks. There I have to do the editing by hand. You must have the same problem in linguistics. I take that you use bibtex. So, how do you handle the import issue. I would love to know.


-peter

 


Topic: Re: Sorting a bibtex file. (7 of 7), Read 45 times
Conf: VEDIT User Applications
From: Fritz Heberlein
Date: Monday, November 24, 2003 03:00 PM

> Unfortunately, this does not work for textbooks. There I have to do
> the editing by hand. You must have the same problem in linguistics. I
> take that you use bibtex. So, how do you handle the import issue.

Peter:

sorry - above all for me, since there are no linguistic databases
that deliver bibtex format. So, I would be glad if I had your
problem!

A possible approach for your textbook issue would be using a Z39.50
internet gateway, downloading the references in usmarc (approx. the
same as the European unimarc) and formatting with a home made Vedit
macro.

BTW, vendors of Endnote, which has a build-in z39.50 client, claim
that E. has full bibtex export. It has - but without generation of
the citation key!

Fritz