Citation Style Language

From Code4Lib
Revision as of 12:25, 28 April 2010 by JakobVoss (Talk | contribs) (References)

Jump to: navigation, search

The Citation Style Language (CSL) is an XML-Based stylesheet language for formatting of citations and bibliographies. It is used in reference management software such as Zotero, Mendeley, CiteProc and Pandoc. CSL was initiated by Bruce D’Arcus in the XBib project. The CSL 1.0 specification was published in March 2010.

The idea behind CSL

If you know BibTeX you can compare CSL with the BibTeX style file language BAFLL (BibTeX Anonymous Forth-Like). If you know XSL than you can compare it with XSLT. The basic idea is to seperate bibliographic data and a citation styles that can be used to create nicely formatted citations.

                           CSL-Style
                               |
                               v
 Bibliographic record -> CSL-Processor -> Citation

CLS-Processors are available in different programming languages. The most elaborated CSL-Processor is citeproc-js.

Getting started

If you use a reference management software such as Zotero you already use CLS under the hood. If you want to dig your hands into code, have a look at citeproc-js:

 hg clone http://bitbucket.org/fbennett/citeproc-js

Documentation is located in the manual directory or online at http://gsl-nagoya-u.net/http/pub/citeproc-doc.html and a demo that runs in a Browser is available at http://gsl-nagoya-u.net/http/pub/citeproc-demo/demo.html

Bibliographic record format

Of course you cannot throw any bibliographic record format into a CSL-Processor but you must use the field names defined in the CSL 1.0 specification. Some of the fields are repeatable and have an interal structure as described here.

If you want to use some other format (BibTeX, RIS, MARC, MODS, Bibliographic Ontology etc.) you go this way:

 Record in your format -> some miracle occurs -> record in CSL format -> CSL-Processor -> Citation

Please replace "some miracle occurs" with the conversion service of your choice, for instance Zotero or some library software hacks that libraries tend to use. There is nothing wrong with specific bibliographic formats but its not their purpose to create citations (counterexamples: BibTeX and RIS).

Embedding CSL records in twitter annotations

On the Code4lib mailing list it has been discussed to embed bibliographic data in twitter annotations. If this annotations contain CSL records then you could display a bibliographic reference in the citation style of your choice.

A twitter annotation is a JSON object with up to 512 bytes (later more):

The CSL input format is also JSON but you need to specify a root element and how to deal with multiple references.

References

Alternatives

  • http://www.refbase.net/ is open source and contains import filters and citation styles to create citations from bibliographic data

This page is licensed under CC-BA-SA and thus can be used on other pages such as Wikipedia as you like