Chapter 16. Bibliography tools

Table of Contents
The runbib shell script
The refdbjade shell script
The refdbxml shell script
The bibdb2tei.dsl stylesheet

This chapter describes the helper tools that simplify the toil of creating bibliographies.

Note: As with all shell scripts that ship with refdb, the scripts described below have a user-customizable section right at the top of each file. You have to provide a few paths or set default values. If one of the scripts behaves strangely, please check again whether these values were correctly adapted to your local installation.

The runbib shell script

This shell script is a wrapper for the bibliography client refdbib to simplify the creation of bibliographies. For SGML and XML documents, runbib first runs Jade/OpenJade to retrieve a list of citations from your source document. Then it runs refdbib to generate the bibliography as an external entity based on the extracted citation information. It will also create stylesheet driver files with the formatting information for subsequent document transformations. For BibTeX documents, runbib uses the information in the .aux file to retrieve a bibliography file that you can use as an input file for bibtex.

runbib [-d database] [-h] [-i includevar...] [-S style] [-t type] {file...}

The command-line switches are:

-d database

Select the default database. This database is used to retrieve the references unless the reference elements specify a database.

-h

Displays a help message and exits.

-i includevar

Specify variable names to include marked sections in the source document.

-S style

Select a bibliography style. This style must have been made available with the refdba command addstyle. To see which styles are available, use the liststyle command of refdba and refdbc.

-t type

Select the output type. This is one of "db31" (DocBook SGML documents), "db31x" (DocBook XML documents), "teix" (TEI XML documents), or "bibtex" (Latex documents).

All other command-line arguments are interpreted as input filenames.

Note: In the spirit of the LaTeX/BibTeX tools you can omit the .aux suffix in the input filename(s) for BibTeX output.

DocBook SGML output

refdbib generates two output files in addition to the ID listing created by Jade/OpenJade. Assuming you have a source file foo.sgml and use the bibliography style J.Biol.Chem. you will get:

J.Biol.Chem.dsl

This is the DSSSL driver file file that encodes some additional formatting information specific for the chosen bibliography style for use in subsequent document transformations. This file will be written to the present working directory. The driver file is a dual-purpose stylesheet for HTML and printable output.

foo.id.xml

This is the intermediate XML file that encodes the citations in foo.sgml.

foo.bib.sgml

This is the file that holds the DocBook bibliography element. You have to include this file as an external entity into your source document to integrate the bibliography into your text.

DocBook and TEI XML output

refdbib again generates two output files as for the DocBook SGML output above, and we also count the ID listing created by Jade/OpenJade. However, runbib does a little post-processing, so you'll get one additional file in the end. Assuming you have a source file foo.xml and use the bibliography style J.Biol.Chem. you will get:

J.Biol.Chem.fo.xsl

This is the XSL driver file used for printable output, containing additional formatting information specific for the chosen bibliography style. This file will be written to the present working directory.

J.Biol.Chem.html.xsl

This is the XSL driver file used for HTML output, containing additional formatting information specific for the chosen bibliography style. This file will be written to the present working directory.

foo.id.xml

This is the intermediate XML file that encodes the citations in foo.xml.

foo.bib.xml

This is the file that holds the DocBook or TEI bibliography. You have to include this file as an external entity into your source document to integrate the bibliography into your text.

BibTeX output

refdbib creates one output file with the reference information. If your document is named foo.tex, latex will create a file foo.aux which refdbib uses as an input file. The refdbib output file will then be named foo.bib and can be used by bibtex as an input file.

Example

You should run this script from the directory where your document files are stored, as all output will be written to the present working directory by default.

The following command will create a DocBook SGML bibliography file together with a DSSSL stylesheet driver file for the DocBook SGML document mypaper.sgml. The output files are tweaked to match the citation and bibliography style of the "Journal of Biological Chemistry", which was added to the database with the name "J.Biol.Chem." previously. All references which do not contain a hard-coded database name are assumed to be in the database bar.

~$ runbib -d bar -S "J.Biol.Chem." -t db31 mypaper.sgml