Manage bibliography styles
Prev | Chapter 10. Bibliographies | Next

## Manage bibliography styles

Bibliography styles are defined as XML documents. Each document contains one or more bibliography styles for a particular journal or publisher. The bibliography styles need to be added to the RefDB database before they can be applied to your documents. The bibliography style controls, among others, characteristics like:

- Numerical vs. author/year vs. citation key citation style

- Bibliography sorting order (as it appears in the text vs. alphabetical or sorted by ascending or descending publication dates)

- Formatting of author names: First and middle initial with or without periods, with or without spaces, before or after the surname

- Appearance of name, volume, and issue number of journals (bold, underlined, italics)

- Formatting of the bibliographic listing: indentation, font sizes.

### Note

The extensive formatting specifications of the RefDB bibliography styles are almost wasted on BibTeX bibliographies currently. You still need one of the native BibTeX styles to do the actual formatting until RefDB bibliography styles can be exported as BibTeX styles. The current implementation uses only the formatting information of the journal name to allow either the full name or one of the abbreviations to appear in the bibliography. So for the current implementation you can get away with just two simple styles that define only the journal name formatting for the “GEN” publication type. These can be found as `bibtex-abbrev.xml` and `bibtex-full.xml` in the `style` directory of the source distribution.

It is admittedly no easy task to write correct bibliography styles from scratch. It may be easier to pick a similar style (if there is one) and modify it to your needs. In this section you will find a brief overview how a bibliograpy style is put together. For more detailed information, please peruse the separate documentation of the CiteStyle XML DTD.

### Write or modify a bibliography style file

It is recommended to use a validating XML editor like Emacs/nXML to write bibliography styles using the CiteStyle XML DTD. This ensures that you end up with a valid style that won't confuse RefDB. If you edit styles with a simpler editor, please run the resulting file through a validating parser like onsgmls or xmllint before adding it to your main database.

The `CITESTYLE` element defines a bibliography style for one particular journal or publisher. You can group several styles in one file with the `STYLESET` wrapper element.

Each `CITESTYLE` element contains exactly four top-level elements (Figure 10.1, “Schematic representation of a `CITESTYLE` element”). The `STYLENAME` defines the name of this style. For the sake of simplicity this could be identical with the name of the journal or publisher whose bibliography style it defines, e.g. “J.Biol.Chem.” or “Elsevier”. The `REFSTYLE` element contains the style definitions for the various publication types that can appear in a bibliography, like books, journals, or personal communications. A special case is the type “GEN” which defines a default bibliography style that is applied whenever no specific definition is available for the requested type. Although the DTD does not enforce this, it is strongly recommended to define a “GEN” definition for each bibliography style. The `CITSTYLE` element defines the citation style, i.e. the appearance of the citations in the main text. Finally, the `BIBSTYLE` element defines the properties of the bibliographic listing.

Figure 10.1. Schematic representation of a `CITESTYLE` element

Each definition for a publication type in turn is basically an ordered list of the elements that make up the rendered bibliographic entry, like authorlists, publication dates, titles, and so on. You can arrange them in any order you like. All available elements can hold a `PRECEEDING` and a `FOLLOWING` element which define strings that are inserted before and after the corresponding element, respectively. This can be used to place punctuation characters or brackets wherever such a non-empty element occurs. A special element is `SEPARATOR` which usually also contains punctuation characters. This element is always inserted even if the preceeding or following element is empty.

The styles also reflect the three-level representation of the bibliographic data themselves. For a discussion of this representation see the description of the risx format. When you write a bibliographic style, you have to make sure to pick the correct level, as indicated with the `role` attribute, for the author lists and the titles. E.g. a chapter entry would typically have `AUTHORLIST` and `TITLE` elements with the `role` attribute set to "PART" to display the chapter author and title, respectively, and additionally `AUTHORLIST` and `TITLE` elements with the `role` attribute set to "PUB" to render the editor and the title of the whole book, respectively.

The `CITSTYLE` element can define three different styles for citations: `INTEXTDEF` for regular citations as well as `AUTHORONLY` and `YEARONLY` for citations that keep the authors in the flow of the text. These elements are equivalent to the definition of a publication type in the `REFSTYLE` element.

Please peruse the separate documentation for the CiteStyle XML DTD for the details about the individual elements, and feel free to consult the styles shipped with RefDB for further guidance.

### Tip

The RefDB project also provides a tool to create citation styles interactively. The refdb-ms Perl script is part of the RefDB sources.

Prev | Up | Next
Chapter 10. Bibliographies | Home | Create SGML and XML bibliographies