This package provides methods to access information stored in a BibTex file. During parsing it is possible to let the data be validated. In addition. the creation of BibTex Strings as well as RTF Strings is also supported.
Example 55-1. Loading a BibTex File and printing the parsed array
|
The data is stored in the class variable data. This is a a list where each entry is a hash table representing one bibtex-entry. The keys of the hash table correspond to the keys used in bibtex and the values are the corresponding values. Some of these keys are:
cite - The key used in a LaTeX source to do the citing.
type - The type of the entry, like techreport, book and so on.
author - One or more authors of the entry. This entry is also a list with hash tables representing the authors as entries. The author has table is explained later.
title - Title of the entry.
As described before the authors are stored in a list. Every entry representing one author as a has table. The hash table consits of four keys: first, von, last and jr. The keys are explained in the following list:
first - The first name of the author.
von - Some names have a 'von' part in their name. This is usually a sign of nobleness.
last - The last name of the author.
jr - Sometimes a author is the son of his father and has the same name, then the value would be jr. The same is true for the value sen but vice versa.
To add an entry simply create a hash table with the needed keys and values and call the method addEntry().
Example 55-2. Adding an entry
|