Mediawiki citations, references, and bibliography management

InfoDabble > Tech Notes > MediaWiki > Mediawiki citations, references, and bibliography management
Jump to: navigation, search
This project is still under development. Last updated August, 2007

Contents

By Eric Hartwell - last updated August 31, 2007

As a documentation tool, MediaWiki has several way to support citations, references, and bibliographies.

[edit] Citation support

[edit] Requirements

For ease of use, a MediaWiki citation tool should be directly accessible from any page in which a citation is used.

  • The tool should recognize and use information stored in any Wikipedia Citation templates
  • Formatting must be flexible enough to support the standard styles (MLA, APA, Chicago, etc.) and easily customized if required.
  • It would be convenient to have centralized access to all citations in the wiki, with a cross reference by pages used and references per page.
    • It should be possible to view and edit citations in a list format rather than page by page.
  • A specific citation should NEVER be entered more than once. Ideally, the system would detect duplicates as they are input.
  • Citation data should be stored with the corresponding wiki page data for easy import and export, rather than in a separate, additional database table
    • It could be stored within the page contents as Category now is.
    • It could be stored in a separate namespace as Image now is. This approach simplifies the use of citations shared between articles.
  • It would be extremely helpful to have a form-based input mechanism, along with a tool that tries to automatically parse an input string into the citation fields

[edit] Proposal

Based on the requirements above, the cleanest way to integrate formal citation support with MediaWiki is to handle citations like images.

Use a syntax similar to Image:Xxx, such as Cite:Xxx in such a way that it's seamlessly compatible with existing Wikipedia citation templates.

  • Citation data is stored as normal MediaWiki content but in its own namespace
    • Just as with images, the citation reference is displayed as formatted data with a link to the source page
      • Special: and Media: are pseudo-namespaces; no pages actually exist in them
      • Parser.php makeImage() parses image options text and uses it to make an image, called from replaceInternalLinks()
    • Optional parameters can control formatting and display (e.g. Cite:Xxx|MLA|Jones, with alternate caption)
  • One page per citation
    • Contents
    • Additional information
    • Discussion, History, all other MediaWiki tools available
  • Citations may be unique to a page or shared among multiple pages
    • Can borrow code for "The following pages link to this file:"
  • Citation data should be stored in plan-text BibTeX format
    • Citations can be imported and exported from existing BibTeX
    • Can use existing input, parsing, and formatting tools

[edit] Implementation

If at all possible, citation support should be implemented as a standard MediaWiki extension rather than as a patch. This decouples it from the MediaWiki version and simplifies testing and deployment.

As always, the best approach is to use existing code wherever possible.

Current MediaWiki tools:
  • Extension:Cite is a collection of extensions that can be installed independently and operate independently of each other; the only thing that they have in common is that they improve citation support in one way or the other.
    • Cite.php is a Cite extension that adds two parser hooks to MediaWiki, <ref> and <references />; these operate together to add citations to pages.
    • SpecialCite.php is a Cite extension that adds a special page (Special:Cite) and in the main namespace, a toolbox link to it
  • Bibtex is designed to parse bibtex sources and display them in web pages using mediawiki engine. The bibtex code is placed inside <bibtex>...</bibtex> markups.
  • Bibwiki offers a interface to manage bibliographies. Bibwiki is a Special: page where you can collect your bibliographic records. The bibliographies itself are stored a in plain text files in BibTeX format. In contrast to other programs, Bibwiki alters the bibliographic files directly. There's no need to import or export bibliographic information into or from a separate database.
  • Wikicite is a Visual Basic .NET program for Microsoft Windows that helps people to properly add inline references to Wikipedia articles. As of 2006 it is the only program in the world that performs this function.
  • Wikipedia:Citation templates examples of how to use templates to cite books, encyclopedias, journals, theses, papers, websites, comic strips, videos, and editorial comics.
  • Wikicite project to create a card catlog on line, with an entry for each book, and for each article available.
From Wikipedia:Citing sources

We could reuse Bibwiki code for citation input and management and Bibtex code for formatting. Cite implements one way to manage references within an article page, but problems with the MediaWiki parser prevent its use with template pages.

[edit] Wikipedia Citation templates

Wikipedia uses the {{Citation}} template to cite books, encyclopedias, journals, theses, papers, websites, comic strips, videos, and editorial comics. As with most complex templates, the base template calls others. Here's a list of pages you can use to export from Wikipedia and import into your own wiki.

Templates Documentation More docs, interwiki
Template:Citation
Template:Citation/authors 
Template:Citation/core 
Template:Citation/doc 
Template:Citation/patent 
Template:!
Template:CMS
Template:Esoteric
Template:Harvard reference/authors 
Template:Howtoedit
Template:Interwikitmp 
Template:Interwikitmp-grp 
Template:Link
Template:Intricate template
Template:Nowrap
Template:Tl
Template:Tl2 
Template:Tlx
Template:Tlxw 
Template:UF-COinS 
Template:Nowrap/doc
Template:Template doc
Template:Template doc inline
Template:Template doc inline/doc 
Template:Template doc/doc 
Template:Template doc page transcluded 
Template:Template doc page transcluded/doc 
Template:Template doc page viewed directly
Template:Template doc page viewed directly/doc 
Template:Tl/doc 
Template:Tlx/doc 
Template:Pp-template
Template:Lcs 
Template:Ltsany 
Template:Ltswpd 

[edit] Citation data formats

[edit] BibTeX format

The most common and straightforward format for citations is BibTeX.

BibTeX makes it easy to cite sources in a consistent manner, by separating bibliographic information from the presentation of this information. It uses a style-independent text-based file format for lists of bibliography items, such as articles, books, theses. BibTeX bibliography files usually end in .bib.
BibTeX Entry Fields
Bibliography entries each contain some subset of standard data entries: (from Wikipedia:BibTeX)
address Publisher's address (usually just the city, but can be the full address for lesser-known publishers)
annote An annotation for annotated bibliography styles (not typical)
author The name(s) of the author(s) (in the case of more than one author, separated by and)
booktitle The title of the book, if only part of it is being cited
chapter The chapter number
crossref The key of the cross-referenced entry
edition The edition of a book, long form (such as "first" or "second")
editor The name(s) of the editor(s)
eprint A specification of an electronic publication, often a preprint or a technical report
howpublished How it was published, if the publishing method is nonstandard
institution The institution that was involved in the publishing, but not necessarily the publisher
journal The journal or magazine the work was published in
key A hidden field used for specifying or overriding the alphabetical order of entries (when the "author" and "editor" fields are missing). Note that this is very different from the key (mentioned just after this list) that is used to cite or cross-reference the entry.
month The month of publication (or, if unpublished, the month of creation)
note Miscellaneous extra information
number The "number" of a journal, magazine, or tech-report, if applicable. (Most publications have a "volume", but no "number" field.)
organization The conference sponsor
pages Page numbers, separated either by commas or double-hyphens
publisher The publisher's name
school The school where the thesis was written
series The series of books the book was published in (e.g. "The Hardy Boys")
title The title of the work
type The type of tech-report, for example, "Research Note"
url The WWW address
volume The volume of a journal or multi-volume book
year The year of publication (or, if unpublished, the year of creation)
BibTeX Entry Types
Bibliography entries included in a .bib are split by types. The following types are understood by virtually all BibTeX styles: (from Wikipedia:BibTeX)
article An article from a journal or magazine.
Required fields: author, title, journal, year
Optional fields: volume, number, pages, month, note, key
book A book with an explicit publisher.
Required fields: author/editor, title, publisher, year
Optional fields: volume, series, address, edition, month, note, key
booklet A work that is printed and bound, but without a named publisher or sponsoring institution.
Required fields: title
Optional fields: author, howpublished, address, month, year, note, key
conference The same as inproceedings, included for Scribe (markup language) compatibility.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
inbook A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
Required fields: author/editor, title, chapter/pages, publisher, year
Optional fields: volume, series, address, edition, month, note, key
incollection A part of a book having its own title.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
inproceedings An article in a conference proceedings.
Required fields: author, title, booktitle, year
Optional fields: editor, pages, organization, publisher, address, month, note, key
manual Technical documentation.
Required fields: title
Optional fields: author, organization, address, edition, month, year, note, key
mastersthesis A Master's thesis.
Required fields: author, title, school, year
Optional fields: address, month, note, key
misc For use when nothing else fits.
Required fields: none
Optional fields: author, title, howpublished, month, year, note, key
phdthesis A Ph.D. thesis.
Required fields: author, title, school, year
Optional fields: address, month, note, key
proceedings The proceedings of a conference.
Required fields: title, year
Optional fields: editor, publisher, organization, address, month, note, key
techreport A report published by a school or other institution, usually numbered within a series.
Required fields: author, title, institution, year
Optional fields: type, number, address, month, note, key
unpublished A document having an author and title, but not formally published.
Required fields: author, title, note
Optional fields: month, year, key

A .bib file might contain the following entry, which describes a mathematical handbook:

@Book{abramowitz+stegun,
  author =	 "Milton Abramowitz and Irene A. Stegun",
  title = 	 "Handbook of Mathematical Functions with
                  Formulas, Graphs, and Mathematical Tables",
  publisher = 	 "Dover",
  year = 	 1964,
  address =	 "New York",
  edition =	 "ninth Dover printing, tenth GPO printing"
}

[edit] BibTeX tools

  • Son of Citation Machine is an interactive web tool designed to assist high school, college, and university students, their teachers, and independent researchers in their effort to respect other people's intellectual properties. To use Citation Machine, simply...
    1. Click the citation format you need and then the type of resource you wish to cite,
    2. Complete the Web form that appears with information from your source, and
    3. Click Make Citations to generate standard bibliographic and in-text citations.
  • Bibtex is designed to parse bibtex sources and display them in web pages using mediawiki engine. The bibtex code is placed inside <bibtex>...</bibtex> markups.
  • Bibwiki offers a interface to manage bibliographies. Bibwiki is a Special: page where you can collect your bibliographic records. The bibliographies itself are stored a in plain text files in BibTeX format. In contrast to other programs, Bibwiki alters the bibliographic files directly. There's no need to import or export bibliographic information into or from a separate database