Archive

Archive for the ‘BibTeX’ Category

Managing the Sage publications database

8 January 2010 Leave a comment

The Sage publications page lists publications that cite Sage. Such publications include

  • books
  • journal articles
  • preprints
  • proceedings articles
  • theses

The list of publications is stored in a file called publications-db.txt and the nice HTML formatting is managed by the Python script publications_parser.py. If you want to add or delete items from the publications database, you should edit the file publications-db.txt. Each publication entry is described in a BibTeX format, with some minor extensions. Attribute names of each publication entry are the same as in BibTeX, except for the name url, which is designed for the purpose of this script. The value for url should be a valid URL pointing to an online version of the publication in question. In the publications database, each type of publication is represented as a block of lines. The first line describes the type of that publication and subsequent lines give values for each attribute of that publication entry. Note that each entry is separated by exactly one blank line. If there is no specific value for an attribute, then we use the stub <BLANK>. Whenever possible, entries in the publications database should be sorted alphabetically according to the authors’ last name. Here’s a specification of the format of each entry in the publications database.

The attributes that describe an article should be listed in this order in the publications database:

article
author
title
journal
volume
number
pages
year
note
url

The attributes that describe a book:

<pre style="background-color:#E0FFFF;">
book
author
title
edition
publisher
year
url

The attributes that describe a work in a collection:

incollection
author
title
editor
booktitle
pages
publisher
year
url

The attributes that describe a proceedings paper:

inproceedings
author
title
editor
booktitle
publisher
series
volume
pages
year
note
url

The attributes that describe a Master’s thesis:

mastersthesis
author
title
school
address
year
url

The attributes that describe a miscellaneous item:

misc
author
title
howpublished
year
note
url

The attributes that describe a PhD thesis:

phdthesis
author
title
school
address
year
url

The attributes that describe an unpublished work:

unpublished
author
title
note
month
year
url

By default, a miscellaneous entry can be used to describe a preprint. There are BibTeX formats for describing Master’s and PhD theses, but no format to describe a Bachelor thesis. To describe a Bachelor thesis, we use the format for miscellaneous entries and ensure that the attribute note for misc has the word “thesis” as part of its value.

The following functions of publications_parser.py are responsible for processing the publications database and generating output in HTML or BibTeX formats:

  • process_database(dbfilename) — Process the publications database as stored in the file dbfilename.
  • output_html(publications, filename) — Format each publication entry in HTML format and output the resulting HTML formatted entries to a text file.
  • output_bibtex(publications, filename) — Format each publication entry in BibTeX format and output the resulting BibTeX formatted entries to a text file.

The functions that do the actual work of entry-specific formatting are:

  • format_articles(articles, output=”html”)
  • format_books(books, output=”html”)
  • format_collections(collections, output=”html”)
  • format_masterstheses(masterstheses, output=”html”)
  • format_misc(misc, output=”html”)
  • format_phdtheses(phdtheses, output=”html”)
  • format_proceedings(proceedings, output=”html”)
  • format_unpublished(unpublished, output=”html”)

The parameter output also accepts the value “bibtex” if you want the formatted output to be in BibTeX format. With some work, you can adapt the script publications_parser.py for formatting a list of publications for other software projects.

Updates: 2010-01-24 — the publications parser and publications database is now hosted at bitbucket.org.