A Bibliography Manager for Microsoft Word
Introduction
The quality and/or usefulness of any information source is often measured in terms of both the accuracy of its contents and the list of references to previous, related work that it includes. For a writer, especially in the academic/scientific world, keeping an up-to-date, well-organized bibliography database is becoming a key part of daily work. However, very few utilities for bibliography management are currently available. Among them, BibTeX [1] is probably the most used due to its portability and seamless integration with LaTeX [2], one of the most accepted text processing systems among the world's scientific community.
In this paper we introduce BibWord, a suite of tools for bibliography management integrated in Microsoft Word that allow an automatic, customized generation of the reference list in a document by inserting items from a bibliographic database developed in Microsoft Access.
In order to make the interchange between Word and TeX users possible, we have chosen the BibTeX data model to define the different kinds of entries in the database. Furthermore, bridges between BibTeX archives and BibWord databases are available; this way, a Word user can import BibTeX collections into the database, and export the BibWord database (in whole or in part) to BibTeX files.
Apart from the bibliographic database, BibWord is composed of a set of macros written in Word Basic that extend the functionality of Word with a new submenu including bibliography management options. While writing a document, a user can at any point insert the key associated to a reference by browsing the collection and selecting the appropriate one. After the document has been written, BibWord generates the bibliography list automatically, using the citation style that the user selects among three choices: a numeric one (i.e., "[1]" "[2]", ... sorted by the order of appearance), and two user-defined (e.g. "[CAN 99]", "[Canós et. al. 1999]").
The purpose of this paper is twofold: first, to report about a solution to the bibliography management for Word users; and second, to illustrate one of the more promising directions of Windows programming: extending the functionality of well-established packages such as Microsoft Office via the integration of different technologies in the development of middleware applications. In our case, BibWord has been created exploiting the extensibility capabilities of Word along with Web technology in a straightforward way, keeping bibliography management as a feature of Word itself rather than as a separate application.
This paper is organized as follows. First we introduce the BibWord database, showing its data model as well as the way it can be queried and updated through a Web browser. Then we describe the bridge between BibWord and BibTeX, which allows importing/exporting bibliographic items from/to BibTeX archives. Next we illustrate the functionality of the BibWord macros to handle bibliography during a sample editing session and we compare BibWord with other bibliography management tools such as EndNote and ProCite. Finally, we enumerate some extensions to BibWordthat are currently under development.
The BibWord database

Figure 1
The BibWord Database (BDB) stores the different kinds of bibliographic items that can be inserted into any document. In order to ensure compatibility with BibTeX archives, the BDB schema is a subset of the BibTeX data model, as shown in Figure 1. The database has two different interfaces. Initially, a set of MS Access forms to query and update the BDB was developed (see Figure 2). However, this restricted the sharing of bibliographic collections between distributed groups because the database should be available in either a local drive or a network unit inside an intranet. To overcome those limitations, a new Web-based interface called BibWordWeb was developed.

Figure 2
The architecture of BibWordWeb is simple: storing the BDB in a machine running a Web server, a set of HTML pages using Active Server Page technology provide access to the database for both querying and updating. Then a user can use a Web browser for accessing the database. Figure 3shows the page used to insert a new book into the database.

Figure 3
Conversion utilities
A BibTeX archive is a plain text file composed of different types of item descriptions, the format of which varies depending on the type of item described. An item description includes a set of tagged fields describing the different attributes of the item. The template for describing a book is as follows:
@BOOK{Fowler-KingsEnglish,
AUTHOR="H. W. Fowler"
and F. G. Fowler",
TITLE="The {K}ing's {E}nglish",
PUBLISHER="Oxford University
Press",
EDITION="3", YEAR="1931"}
The @BOOK tag indicates the type of item; after it, a user-defined identifier for the item (Fowler-KingsEnglish) appears; it will be used in the source document as a reference to the item and will force BibTeX to include it at the bibliography generation phase. The remaining tagged fields are self-explanatory. Some of them are optional, and the order in which they appear in an item description is not relevant to BibTeX.
In order to reuse the large amount of BibTeX collections available, we have developed a conversion utility that a) reads BibTeX archives into the BDB and b) exports (part of) the contents of the BDB to BibTeX format. Figure 4 shows the interface for the importing phase.

Figure 4
The importing process options include the following aspects:
- Selection of the input file and the output database
- Code conversion: inside a TeX document there are many formatting tags like font selection, special characters, etc., which are not directly applicable to Word and are ignored by default. However, a customizable code table permits string replacement during the import process.
- Duplicate key handling: it is not unusual to find either the same bibliographic item in two or more BibTeX archives or two different items with the same key. In order to avoid redundancy and/or loss of information, users can choose between three options: to discard the duplicate item, to insert the item but with a new user-defined key, or to insert the item with a new automatically-generated key.
The exporting procedure is very simple: the user selects the items of the BDB to be extracted to a BibTeX archive through a Query by Example interface. Once selected, a new archive is created including the selected items.
Using BibWord
The main purpose of the BibWord suite is to help Word's users insert references in a document and generate the bibliography automatically. This is achieved by a set of macros written in Visual Basic and incorporated to a Word template, namely BibWord.dot. In this section, we illustrate the use of these macros through a small example.

Figure 5
The first step consists of creating a new document based on the template BibWord.dot; a new option named BibWord appears at the standard menu bar (see Figure 5). Then the user can start to write their document. At any point of the document, a new reference can be inserted by selecting the Insert reference option under the BibWord option. A dialog box allows selection of the desired item, and a reference is inserted at the cursor position (Figure 6).

Figure 6
When the document is finished, the reference list is automatically generated selecting the Generate bibliography option (Figure 7).

Figure 7
Initially, the access to the BDB from Word was implemented using ODBC access through the functions contained in the wbodbc.wll library [3]. However, since the release of BibWordWeb, the access from Word to the BDB has been modified to use the TCP/IP protocol; this way, a remote user can connect from Word to the server containing the database. The server has a program running which continuously explores a TCP/IP port to which remote Word requests are sent. Once a request arrives, it is transformed into a query to the BDB via ODBC, the result of which is sent back to the client machine. The Word user only has to set the IP address of the server through the Configure IP server option of the BiBWord submenu in order to have the database available.
Related Work
There are a number of tools for bibliography management in the marketplace. Among them, we want to mention EndNote and ProCite, both from ISI ResearchSoft. Although they provide interesting features like automatic bibliography generation and bibliography sharing across the Web, with plenty of different collections available, they do not provide importing of BiBTeX archives into their databases. The purpose of BibWord is to overcome this limitation due to the high number of collections available in BiBTeX format (mainly in the fields of Computer Science, Mathematics, Physics and other similar fields).
Finally, we would like to point out that both endNote and ProCite are powerful commercial products developed by software companies, while the scope of BibWord is much more reduced and is the result of students' course work.
Conclusions and future work
In this paper we have introduced BibWord, a bibliography management utility that makes the creation of technical documents easier by automating the bibliography generation phase. Conceived as a middleware application for Microsoft Word, it allows users to insert references from a bibliography database and to generate the list of references in an automated way; since all the features are accessible from Word's main menu, users do not need to learn to use a new tool in order to manage bibliography.
BibWord supports the collaborative work of distributed groups through both a web-based access to the bibliography database for and a TCP/IP based access from Word to the database at the generation phase. In addition, BibTeX archives can be imported/exported into/from the database.
Future work includes a richer model of bibliography generation. Currently, only three predefined formats are available, and some publishers request a particular format for bibliography that does not fit in any of them. We are currently working on the definition of a fully configurable generation through the use of bibliography templates. As soon as this is completed, the BibWord suite will be freely distributed from http://mariachi.dsic.upv.es/bibword
Acknowledgements
BibWord is the result of the work of several third-year students of the Escuela Universitaria de Informática at the Polytechnic University of Valencia, under the supervision of José H. Canós and based on his ideas. J. Armero developed the first release in 1997, which included the BDB and the macros accessing a local BDB through ODBC. BibWordWeb (1999) was built with the collaboration of L. Castillo, D. Colomer, S. Domingo, A. Lafuente and E. Sánchez. The converting utility (1999) was the result of the joint work of S. Sarrias, J. Baeza, A. Sangüesa, L. Martínez, E. Suela and J. Puche. Finally, the remote access from Word to the BDB and the associated server utility (1999) were implemented by A. Moya, M. Arenas, A. Giner, M.D. García and J. Pérez.
References
- 1
- Goossens, M., Mittelbach, F. and Samarin, A. The LaTeX Companion. Addison-Wesley, 1993.
- 2
- Lamport, L. LaTeX: A Document Preparation System, Addison-Wesley, 1986.
- 3
- Microsoft Corporation, Microsoft Word Developer's Kit. Microsoft Press, 1995. (ISBN 1-55615-880-7)
