Citation styles

So here’s a crazy idea. I’ve been thinking about how bibliography software generates reference lists that are formatted for a specific journal. Obviously Endnote lets you import styles, but how about all those non-Endnote users? RefDB employs SGML, XML, XSL, Docbook, LaTeX and so on but (a) is broken and (b) that’s a PITA for most people. It would be nice if all journals supplied something like standard XSL that you could use, but they don’t and who wants to define their own? Refbase currently includes a small number of journal styles that are hard-coded in PHP.

So I thought – in a web-based application, couldn’t you design a form that allows the user to define style? There are lots of styles, but a finite number of elements. Text may be bold or italic. Author separators may be commas, semi-colons, with or without ‘and’ for last name. Author names may be full or initials. Article titles may or may not be included. And so on. It shouldn’t be too hard to analyse some journals, figure out all the combinations and let a user specify these in a form, then apply them to the reference list.

10 thoughts on “Citation styles

  1. Bill Hooker

    That’s a bloody good idea. I’ve had a brief go at getting Connotea and RefWorks (my institution subscribes) to play nice together, but only marginal success. Lots of applications, including Connotea, will output a marked-up file that defines an author list, title, journal and so on. A web-based application that does what EndNote does — that is, format the marked-up file into a bibliography with a particular style — would be very useful. Maybe the web app could even read EndNote styles?

  2. neil

    I guess a smart programmer would provide for recognition of style from an example. In other words, you’d paste in a single formatted reference from the journal of your choice and the app would figure out the markup and apply it to your references. Hmm, I’ll have to think more on that one.

  3. Matthias Steffens

    Neil,

    in case of refbase, web-based generation of new citation styles is definitively something that is planned. However, we didn’t want to invent our own solution, since Bruce d’Arcus has done already some significant effort into that direction: Bruce has developed an XML based citation style language (CSL [1]), where users would be allowed to use a web form to generate CSL files. Existing CSL files would be made accessible from a common web repository and would be interchangible between many applications (such as OOo or apps of the Bibliophile initiative).

    Besides using CSL files and external processing logic (such as Bruce’s citeproc), I’ve thought about using a simple placholder snytax for definition of citation styles, similar to what exists in refbase for cite keys, file renaming and in-text citations ([2]). Problems are that citation styles can be very complicated and you’ll need to allow for stuff like conditionals.

    My experience has shown that raw PHP files do achieve the highest quality of output styles. While it’s definition is not user-friendly or straight forward, the hard-coded cite functions can account for a lot of smartness that is not possible with a simple placeholder syntax.

    That said, like with Bruce’s approach, a user-friendly solution could be the *combination* of simple style definitions (defined via a web form) with separate processing logic (such as hard-coded cite functions or an external processor such as citeproc).

    Matthias

    [1]: http://xbiblio.sourceforge.net/csl/
    [2]: http://wiki.refbase.net/index.php/Placeholder_syntax

  4. neil

    CiteProc and CSL look very well designed. I’m happy to consider all solutions to citation style. I admire the function-based code of refbase – it’s certainly how programming should be, but my own grasp of PHP only goes as far as writing simple procedural scripts in a “bad Perl” style, so the cite functions are a little hard for me to follow. I guess that’s incentive for me to improve.

  5. Matthias Steffens

    Neil, I definitively agree that a user should not be required to edit raw PHP code[1]. The process of CSL language definition is not finished yet (AFAIK), which is the reason why we haven’t started supporting it.

    If you require a particular style, I welcome you to send me some examples (covering all resource types like papers, books, book chapters, books within series, online pubs, etc) so that I could setup an appropriate cite style file for you.

    [1]: http://wiki.refbase.net/index.php/Planned_feature_additions#User-customizable_citation_styles

  6. Bruce D'Arcus

    My design goals with CSL were to have it:

    document-format-independent (shoudn’t matter whether you use Word or LaTeX or OpenOffice, as I do, DocBook)
    language-agnostic (shoudn’t matter what code the formatter is implemented in; XSLT, PHP, Python, C++)
    feature-rich (for once, the needs of people in the humanities are considered from the beginning)
    easy-to-use

    This is a tough set of requirements to balance, but I think I’m slowly narrowing it down. The more comments I get, the quicker I’ll get to the 1.0 status that Matthias is waiting for ;-)

    I should add, though, that while things have been in flux recently, I used the current release version to format an entire book manuscript, which has since been published by Routledge. It worked quite well!

  7. Mark Grimshaw

    Hi all,

    WIKINDX has a web-based bibliography/citation style editor that answers most of the questions/requests here. Users can edit the wikindx-supplied styles or create their own which are then saved in XML format. All of this is handled without the user being required to do any programming beyond getting to grips with a simple template-based language (similar to that found in the creation of Endnote templates). Support exists for non-English language formatting conventions.

    It allows for many types of conditionals and not only handles the formatting of bibliographies but also handles in-text and footnote/endnote style citations within the text — as demonstrated when using the word processor within wikindx.

    The code used for the above has been made available at the bibliophile project on sourceforge (OSBIB) and I’m aware of it being used in other OS bibliography managers.

    A quick test of its features can be found at:
    http://bibliophile.sourceforge.net/OSBiB/format/TESTOSBIB.php

    (although I do need to update the code to reflect recent additions and amendments I’ve made in the original wikindx code). It’s all been available for others to use for a year or more.

    The results are good enough for me to write and format my entire PhD thesis wihtin WIKINDX.

    Mark.

  8. neil

    I just installed WIKINDX and am playing with it. First impressions are very positive. Paper writing in a browser feels a little strange, but I’m getting used to it and the RTF export is good.

    If refbase could (1) import a file of references instead of having to paste, (2) reliably interface with OO through ODBC and (3) had better citation styles support, it would be my system of choice. For me it’s currently between refbase and WIKINDX.

  9. Mark Grimshaw

    Glad you like it. v3.4 should be about in a couple of weeks. I should have laTeX exporting of annotated bibliographies in it (being worked on now) and future versions should be able to export to laTeX from the word processor.

    The CHANGELOG is currently:

    v3.4
    Focus: Major feature enhancements and bug fixes.

    NB
    1/ This release UPGRADES the database structure. BACKUP YOUR DATABASE FIRST (and read INSTALL and UPDATEWIKINDX prior to running WIKINDX for the first time).
    2/ Because of additions to the bibliographic/citation templating system, administrators who have created their
    own style should, after installing v3.4, open, edit (with changes if necessary) and save their styles in
    the WIKINDX style editor before using them.

    FEATURE ENHANCEMENTS:
    1/ For in-text citations added new style field: if the template being used contains the title or shortTitle and either of those fields exists in the same sentence, remove those fields from the template so that they do not appear in the citation. Administrators see NB 2/ above.
    2/ For in-text citations added new style field: only use the subsequent citation template if the sentence containing the citation has the creator surname, title or shortTitle in it. Administrators see NB 2/ above.
    3/ When searching or displaying metadata, category, keyword, publisher, collection and creator names are only displayed if they belong to a resource that has metadata.
    4/ Added reset buttons to all forms in export RTF and search/select resources/metadata.
    5/ Added a `timestampAdd` field to store the date of adding a resource. Not having this in previous versions was an oversight and, on first running of v3.4, all resources will have this field set to the current value for the field `timestamp` (which is initialized when the resource is added and is updated for each edit of that resource).
    6/ Added a ‘popularity index’ — a percentage indicating the number of views for each resource compared to the most frequently viewed resource. At first running of v3.4, the view counter for each resource is set to ‘1’. The increment occurs only when viewing from a list/select/search operation or after displaying metadata i.e. not from front page etc.
    7/ Added $WIKINDX_DENY_READONLY to config.php to deny read only access. Although contrary to my philosophy of sharing knowledge, I’ve bowed to the inevitable pressure.
    8/ The admin now has the ability to allow users with write access to import BibTeX or Endnote bibliographies.
    9/ Admins can now chose to display either a set number of added/edited resources on the front page or all added/edited resources from a set number of previous days.
    10/ Added a forgotten password system. Users may store a set of up to three question/answer pairs. If they forget their password and then answer their questions correctly, a temporary password will be emailed to them.
    11/ When displaying a single resource, the bibTeX key displayed is either a unique WIKINDX-generated key or the bibTeX key from the original bibTeX import (if available) according to user preference.
    12/ Write-enabled users now have access to some statistical information about the WIKINDX.
    13/ When exporting to BibTeX, users may now chose either “…” or {…} to enclose field values.
    14/ Added a Category Tree view for resources that displays hyperlinked categories and hyperlinked lists of keywords in each category.

    BUG FIXES:
    1/ Some fixes to the formatting and justification tables and nested DIVs when exporting to RTF in the word processor.
    2/ Fixed a bug whereby it was possible to write empty abstract and note fields to the database. At first running of v3.4, empty rows are deleted from the abstract and note database tables.
    3/ When importing a bibtex bibliography, if all unrecognized fields were mapped to existing wikindx fields, the citation key was never stored despite the user requesting unused fields to be stored. This has been fixed.
    4/ Some improvements to BibTeX export.

    Mark.

  10. keith

    I stumbled on this site looking for a CSL parser for PHP. I guess there isn’t one yet.

    Thought I’d mention that refbase can import files & can export to openoffice now, though.

Comments are closed.