9/19/2006

在EndNote与BibTeX之间转换(zz)

作者: Rob MacLeod (macleod@cvrti.utah.edu)
来自: http://www.cvrti.utah.edu/~macleod/litbase/endnote.html

Using EndNote with LATEX/BibTEX

Rob MacLeod (macleod@cvrti.utah.edu)


* 1 EndNote to BibTEX
o 1.1 Setting Key Names
* 2 BibTEX to EndNote
* 3 Using EndNote files directly with BibTEX
* 4 Additional links
* About this document ...

EndNote is a nice program on PCs and Macs for managing a database of literature references. There are ways to move records in and out of EndNote so that we sane people who use LATEX and BibTEX can benefit from the user friendly entry of EndNote references. Here I describe what I have learned so far about this topic.

A good place to look for more information is the EndNote web cite at www.endnote.com/ and for technical support and downloads at www.endnote.com/support/ensupport.asp.

1 EndNote to BibTEX

To extract EndNote references into a BibTEX format, you can simply create or use an existing output format from within EndNote and the result should be something BibTEX can handle. There is a section in the Support and Services section about downloading style files and here you can find a style file for BibTEX format called bibtex_export.ens. Note that this link from the EndNote web site actually goes to ftp://support.isiresearchsoft.com/pub/bibtex/ (thanks to Jak Carr for that tip). Insert this file into wherever you keep styles on your Mac/PC and then you can use this style to create an output file that BibTEX should read.

The instructions for exporting the references are as follows:

1. Select the library containing the references to be exported.
2. Select the references you want to export, then choose Show Selected References from the References menu (if you want to export the entire contents of the library, choose Show All References from the References menu).
3. If you want to change the order of the references, choose Sort References from the References menu.
4. Select the desired bibliographic style. Select a style from the list of favorites on the toolbar, or use the Output Styles sub-menu from the Edit menu. For more information about selecting styles, see About Bibliographic Styles.
5. From the File menu, choose Export.
6. Select the file type for the exported file, choose text only.
7. Provide a name for the export file, and select the desired drive and folder-EndNote appends .txt to any filename you provide.
8. Choose Save.

1.1 Setting Key Names

These are not all steps needed to get a usable BibTEX file though. As it comes from EndNote, the file will not have any keys assigned so BibTEX will not know how to refer to any entry in the file. Of course, you can enter the keys manually and it will take some time. To automate the process, I have written an awk script that parses the file and generates keys, then writes out a new .bib file.

This awk program assumes a structure for keys to references and bases the key on the first author's last name and the year of publication along with a set of initials that ensure a unique name, or at least a name that belongs to you. For more background on this standard key system look here

The file that EndNote generates may also be in a format you do not wish to use. On the Mac/OSX, for example, the file comes out in DOS format and also has several strange characters at the start of the file. I usually have to clean with an editor like emacs and also convert the file to Unix format.

If you decide to generate the keys automatically, here are the steps to getting and using the awk program I wrote:

1. Download the awk file by right mouse clicking (control-click) on this link and save the file to your local machine.
2. In line 6 of the file
prefix = "ADM:"
Replace ``ADM'' with whatever prefix is appropriate. Again, this is the prefix we use to make keys unique to a particular owner (and his/her BibTEX file).
3. Then run the awk script on the bibliography file as follows:
awk -f endnotebib.awk filename.txt > filename.bib
4. The result will be a file called output.bib that will be in the same directory and have the proper BibTEX format. To be sure about its integrity, pass bibclean over it and clean up any remnant problems.

2 BibTEX to EndNote

We often want to share references with our unfortunate colleagues who have to use a Mac/PC based WYSIWYG text processing program (aka MS Word). To do this, there is a BibTEX style file that creates output that EndNote can import. The steps are as follows:

1. Make sure you have a copy someplace where BibTEX can find it of the style file called refer.bst. You can download this from EndNote's ftp cite at ftp.endnote.com/pub/bibtex/. If you are on CVRTI machines, we have it already. On the SCI machines, you can find the file at ~macleod/tex/bibtex/refer.bst.
2. Make up a LATEX file with citations for all the references you want to export. If you include the command nocite* in the document, it will actually extract every reference from your BibTEX file so this is an easy way to export an entire file.
3. In the LATEX file, include the usual {\bibliographystyle} command, but as an argument, provide ``refer'', so the command looks like this

\bibliographystyle{refer}

4. Run LATEX on the file.
5. Run BibTEX on the file.
6. The result of these two steps will be a file with the extension .bbl that contains the desired bibliography records in a format that EndNote can import. It is the standard ASCII format for EndNote.
7. Copy the file to your Mac/PC (use ftp or something that converts the file from Unix to Mac or PC format).
8. Open EndNote and then select ``Import'' and the Import Option called ``Refer/BibIX'' and then EndNote should be able to import it into an existing or new endnote database file.

Now to actually replace \cite commands with the required tags in EndNote, you will have to do some manual work. It should be possible to write an awk/perl script that will make a good attempt at guessing at tags, but this will probably not work completely as the EndNote tags seem to include things that only EndNote can know, such as the reference # of the entry in the EndNote database. At present then, you will have to manually hunt for references and replace them with the ones from the EndNote database. If you have used a sensible naming scheme for the keys in your BibTEX database (e.g., the one I made up!), then this will not be so bad. EndNote uses the first author's last name and the publication year as parts of the key so if that matches in some way the naming scheme in BibTEX, then searching is at least facilitated. When in doubt about a match, note that there is a field called ``Label'' in the EndNote database that should contain the key field from the original BibTEX entry.

3 Using EndNote files directly with BibTEX

There are some programs out there that will allow you to read EndNote files directly and use them with BibTEX. I have not tested any of them and so cannot say anything useful about them other than supply the pointer to the EndNote ftp site (ftp.endnote.com/pub/bibtex/). Have fun and let me know what you learn.

4 Additional links

* EndNote web site
* SCI Institute BibTEX support
* General BibTEX support
* LaTeX support
* Searching and managing literature

About this document ...
Using EndNote with LATEX/BibTEX

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 3 -no_white -link 3 -no_navigation -no_math -html_version 3.2,math -show_section_numbers -local_icons endnote

The translation was initiated by Rob Macleod on 2005-07-08
Rob Macleod 2005-07-08

0 Comments: