bibtexbrowser: publication lists with bibtex and PHP

by Martin Monperrus
bibtexbrowser is a PHP script that creates publication lists from Bibtex files. bibtexbrowser is stable, mature and easy to install. It is used in 100+ different universities around the globe (in 329 different domains according to Google).

This documentation is collaborative, you can improve it using a pull request on GitHub (file bibtexbrowser-documentation.wiki).

Features
Download
Bibtexbrowser Ecosystem
Demo and screenshot
Basic installation
FAQ
  How to embed Bibtexbrowser into a website?
  How to embed a publication list in an home page?
  How to change the reference style?
  How to change the link style?
  How to specify the encoding of bibtex files (UTF-8/ISO-8859-1/etc.)?
  How to disable Javascript progressive enhancement?
  How to remove the "[bibtex]" links?
  How to change the reference indices?
  How to use the "Academic style"?
  How to get the individual bib pages embedded as well?
  How to add links to the slides of a conference/workshop paper?
  How to localize bibtexbrowser?
  How to change the default frame?
  How to configure the order of Bibtex entries?
  How to change the title of the result page?
  How to disallow crawler indexing?
  How to load Bibtex from a dynamic string?
  How to load bibliographic data in other formats?
  How to remove fields from the bibtex text?
  How to activate page numbering in the output?
  How to override framesets and headers?
  How to add hyperlink to the authors' web pages?
  How to modify bibtex entries on the command line?
Related tools
Copyright

Features

* (02/2016) support for OpenGraph metadata
* (10/2015) support for filtering bibtex fields
* (10/2013) support for localization (see below)
* (07/2012) new label types (see config value ABBRV_TYPE)
* (10/2011) if a bibtex entry contains a field gsid (like Google Scholar ID), bibtexbrowser includes a link [cites] to the cited-by page of Google Scholar (e.g. http://scholar.google.com/scholar?cites=15080874515065717592)
* (03/2011) bibtexbrowser includes a hide/show mechanism for bibtex entries (in Javascript, see configuration variable BIBTEXBROWSER_USE_PROGRESSIVE_ENHANCEMENT)
* (10/2010) bibtexbrowser now supports cross-references (Bibtex crossref)
* (09/2010) bibtexbrowser now supports multiple bibtex files (bibtexbrowser.php?bib=file1.bib;file2.bib)
* (05/2010) bibtexbrowser adds links to your co-author pages if you define the corresponding @string (see function addHomepageLink)
* (01/2010) bibtexbrowser can handle user-defined bibliographic styles
* bibtexbrowser generates publication RSS feeds (simply add &rss at the end of the URL)! demo
* (10/2009) bibtexbrowser is able to generate a bibtex file containing only the selected entries (simply add &astext at the end of the link)
* (10/2009) bibtexbrowser is now independent of the configuration of register_globals
* (01/2009) bibtexbrowser allows multi criteria search, e.g. demo
* bibtexbrowser generates COinS for automatic import of bibliographic entries with Zotero and Mendeley.
* bibtexbrowser generates Google Scholar metadata so as to improve the visibility of your papers on Google Scholar.
* bibtexbrowser replaces constants defined in @STRING
* bibtexbrowser is very fast because it keeps a compiled version of the bibtex file (PHP object serialized)
* bibtexbrowser is compatible with PHP 4.x and PHP 5.x
* bibtexbrowser can display the menu and all entries with framesets demo
* bibtexbrowser can display all entries out of a bibtex file demo
* bibtexbrowser can display all entries for a given year demo
* bibtexbrowser can display a single bibtex entry demo
* bibtexbrowser can display found entries with a search word (it can be in any bib field) demo
* bibtexbrowser can display all entries with a bib keyword e.g. "?keywords=components". It matches against the "keywords" bibtex field. demo
* bibtexbrowser outputs valid XHTML 1.0 Transitional
* bibtexbrowser can display all entries for an author demo
* bibtexbrowser can be used with different encodings (change the default iso-8859-1 encoding if your bib file is in UTF-8 define('BIBTEX_INPUT_ENCODING','UTF-8') )
* bibtexbrowser is easy to install: just a single file.


Download

For feature requests or bug reports, please comment this page below; patches can be contributed as pull requests on github:)

Stable Version: bibtexbrowser.php
Changelog

Don't hesitate to contact me to be added in the lists of bibtexbrowser users:-)

Bibtexbrowser Ecosystem


The following uses bibtexbrowser under the hood:
* A pretty-printer and cleaner for Bibtex
* A custom citation style for bibtexbrowser adhering to the IEEE citations guidelines (on github)
* Generating publication lists in Latex using http://www.monperrus.net/martin/bibtex2latex
* Feeding a MySQL database from the content of a bibtex file
* Publication lists in Wordpress with wp-publications
* Publication lists with HAL and bibtexbrowser

Demo and screenshot


Demo: Here, you can browse a bibtex file dedicated to software metrics

bibtexbrowser screenshot

Basic installation

Create a bib file with the publication records (e.g. csgroup2008.bib) and upload it to your server.
* Use the link bibtexbrowser.php?bib=csgroup2008.bib (frameset based view)
* Use the link bibtexbrowser.php?bib=csgroup2008.bib&all (pub list sorted by year)
* Use the link bibtexbrowser.php?bib=csgroup2008.bib&all&academic (pub list sorted by publication type, then by year, see "Sectioning in academic mode" below)

Warning: bibtexbrowser maintains a cached version of the parsed bibtex, for high performance, check that PHP can write in the working directory of PHP.

Handling mutliple bibtex files: If you want to include several bibtex files, just give bibtexbrowser the files separated by semi-columns e.g:
bibtexbrowser.php?bib=strings.bib;csgroup2008.bib

FAQ


How to embed Bibtexbrowser into a website?

To embed Bibtexbrowser into a website, you car use it as a library:

<?php
$_GET['library']=1;
define('BIBTEXBROWSER_BIBTEX_LINKS',false); // no [bibtex] link by default
require_once('bibtexbrowser.php');
global $db;
$db = new BibDataBase();
$db->load('biblio.bib');

// printing all 2014 entries
// can also be $query = array('year'=>'.*');
$query = array('year'=>'2014');
$entries=$db->multisearch($query);
uasort($entries, 'compare_bib_entries'); 

foreach ($entries as $bibentry) { 
  echo $bibentry->toHTML()."<br/>"; 
}
?>

How to embed a publication list in an home page?


Sorted by year Sorted by publication type
For a group/team/lab <?php
$_GET['bib']='csgroup2008.bib';
$_GET['all']=1;
include( 'bibtexbrowser.php' );
?>
<?php
$_GET['bib']='csgroup2008.bib';
$_GET['all']=1;
$_GET['academic']=1;
include( 'bibtexbrowser.php' );
?>
For an individual <?php
$_GET['bib']='mybib.bib';
$_GET['author']='Martin Monperrus';
include( 'bibtexbrowser.php' );
?>
<?php
$_GET['bib']='mybib.bib';
$_GET['author']='Martin Monperrus';
$_GET['academic']=1;
include( 'bibtexbrowser.php' );
?>

How to change the reference style?


By modifying the CSS

If bibtexbrowser.css exists, it is used, otherwise bibtexbrowser uses its own embedded CSS style (see function bibtexbrowserDefaultCSS). An example of CSS tailoring is:
.date {   background-color: blue; }
.btb-header { }
.rheader {  font-size: large }
.bibref {  padding:3px; padding-left:15px;  vertical-align:top;}
.bibtitle { font-weight:bold; }
.bibbooktitle { font-style:italic; }
 

For instance, one can tweak the output by disabling the display of some headers and pieces of information.
.bibmenu {display:none} /* disables the [bibtex] and the like */
.bibanchor {display:none} /* disables the index [1] or [Name2010], etc. depending on the value of the configuration value ABBRV_TYPE and BIBTEXBROWSER_LAYOUT
.theader {display:none}
.sheader {display:none} /* disables the year header e.g., 2001 */
 

By setting your own style function
The bibliography style is encapsulated in a function. If you want to modify the bibliography style, you can copy the default style in a new file, say bibtexbrowser-yourstyle.php, and rename the function DefaultBibliographyStyle in say MyFancyBibliographyStyle.
Then, add in the file bibtexbrowser.local.php:
<?php
function MyFancyBibliographyStyle(&$bibentry) {
  return $bibentry->getTitle().' ('.$bibentry->formattedAuthors(.')';
}
define('BIBLIOGRAPHYSTYLE','MyFancyBibliographyStyle');
?>
 

See Janos Tapolcai's style, which looks like IEEE references (see function JanosBibliographyStyle), and Kai's one another custom citation style for bibtexbrowser adhering to the IEEE citations guidelines (on github).

For contributing with a new style, please drop me an email

How to change the link style?


By default each bibliographic entry is followed by
[bibtex] [pdf] [doi], etc.

This can be tailored by configuring as follows (in the file bibtexbrowser.local.php)
getBibLink();
  
  $result .= ' '.$bibentry->getLink('url');
  
  // Google Scholar ID. empty string if no gsid field present
  $result .= ' '.$bibentry->getGSLink();
  
  // returns an empty string if no doi field present
  $result .= ' '.$bibentry->getDoiLink();
  
  return $result;
}
?>
 

You can use your personalized function to add support for new fields in bibtex (pdf, file, etc.). Check-out the documentation of functions getLink(), getBibLink(), getGSLink() and getDoiLink(): they accept an optional argument for providing an image/icon instead of printing text.

  // returns an empty string if no pdf field present
  $result .= $bibentry->getLink('pdf','http://url.to/icons/pdf.png');
  // returns an empty string if no slides field present
  $result .= $bibentry->getLink('slides');
  // returns an empty string if no poster field present
  $result .= $bibentry->getLink('poster');

How to specify the encoding of bibtex files (UTF-8/ISO-8859-1/etc.)?

By default, bibtexbrowser assumes that the bibtex file is UTF-8 encoded. If you want to change it to e.g. ISO-8859-1, add into bibtexbrowser.local.php:
define('BIBTEX_INPUT_ENCODING','ISO-8859-1');
Note that if the bibtex only contains latex-encoded diacritics (e.g. \'e), it does not matter. The encoding of the bibtex file and the one of the generated HTML is identical.


How to disable Javascript progressive enhancement?

add into bibtexbrowser.local.php:
define('BIBTEXBROWSER_USE_PROGRESSIVE_ENHANCEMENT',false);

How to remove the "[bibtex]" links?

@define('BIBTEXBROWSER_BIBTEX_LINKS',false);

How to change the reference indices?

// index => [1] The essence of metamodeling
// year => [2005] The essence of metamodeling
// x-abbrv => [SoSyM] The essence of metamodeling if the bibtex entry contains a field x-abbrv
define('ABBRV_TYPE','year');// may be year/x-abbrv/key/none/index

How to use the "Academic style"?


The default academic mode creates four sections:

- books
- articles and book chapters
- workshop papers (for entries containing "workshop" in the field booktitle)
- others

You may create your own one in bibtexbrowser.local.php (see also "creating a bibtexbrowser.local.php" below):
define('BIBLIOGRAPHYSECTIONS','my_sectioning');
function my_sectioning() {
return  
  array(
  // Books
    array(
      'query' => array(Q_TYPE=>'book'),
      'title' => 'Books'
    ),
  // Articles
    array(
      'query' => array(Q_TYPE=>'article'),
      'title' => 'Refereed Articles'
    ),
  // Conference and Workshop papers
    array(
      'query' => array(Q_TYPE=>'inproceedings'),
      'title' => 'Conference and Workshop  Papers'
    ),
  // others
    array(
      'query' => array(Q_TYPE=>'misc|phdthesis|mastersthesis|bachelorsthesis|techreport'),
      'title' => 'Other Publications'
    )
  );
}

How to get the individual bib pages embedded as well?

define('BIBTEXBROWSER_URL',"");


How to add links to the slides of a conference/workshop paper?

You can simply fill the comment field of the bib entry with an HTML link:
@inproceedings{foo,
author="Jean Dupont",
title="Bibtexbrowser",
year=2009,
booktitle="Proceedings of the BIB conference",
comment={<a href="myslides.pdf">[slides]</a>}
}
This comment field can also be used to add acceptance rates and impact factors.

How to localize bibtexbrowser?

Add in bibtexbrowser.local.php:
<?php
global $BIBTEXBROWSER_LANG;
$BIBTEXBROWSER_LANG=array();
$BIBTEXBROWSER_LANG['Refereed Conference Papers']="Conférences avec comité de lecture";
... 
$BIBTEXBROWSER_LANG['Year']="Année";
?>

How to change the default frame?

Add in bibtexbrowser.local.php:
<?php
// or any valid query: year=2010, author=Jane, etc.
@define('BIBTEXBROWSER_DEFAULT_FRAME','all');
?>

How to configure the order of Bibtex entries?

You can set the default order function in bibtexbrowser.local.php:
<?php
// can be @define('ORDER_FUNCTION','compare_bib_entry_by_title');
define('ORDER_FUNCTION','compare_bib_entry_by_bibtex_order');
?>
Or programmatically:
<?php
$_GET['library']=1;
require_once('bibtexbrowser.php');
$db = new BibDataBase();
$db->load('biblio.bib');
$query = array('year'=>'2014');
$entries=$db->multisearch($query);
uasort($entries, 'compare_bib_entries'); 
foreach ($entries as $bibentry) { 
  echo $bibentry->getYear().'
'; } ?>

How to change the title of the result page?


You may create your own title function in bibtexbrowser.local.php (see "creating a bibtexbrowser.local.php" below):
define('BIBLIOGRAPHYTITLE','my_title_function');
function my_title_function($query) {
  return "Publications of the Nuclear Research Group";
}
See function DefaultBibliographyTitle for inspiration.

How to disallow crawler indexing?


Add in bibtexbrowser.local.php (see "creating a bibtexbrowser.local.php" below):
define('BIBTEXBROWSER_ROBOTS_NOINDEX', true);

How to load Bibtex from a dynamic string?


You can use the special php://memory feature in a new dispatcher.
Add in bibtexbrowser.local.php:
define("BIBTEXBROWSER_MAIN", 'DynamicDispatcher');
and then in bibtexbrowser.after.php:
<?php
class DynamicDispatcher extends Dispatcher {
  function getDB() {
    $data = fopen('php://memory','x+');
    $dynamic_string = "@book{aKey,title={A Book},author={Jan Doe},publisher={Springer},year=2009}\n";
    fwrite($data, $dynamic_string);
    fseek($data,0);
    $db = new BibDataBase();
    $db->update_internal("inline", $data);
    return $db;
  }
}
?>

How to load bibliographic data in other formats?


If your bibliographic data comes from XML or a database, you can still browse it with bibtexbrowser as follows:
Add in bibtexbrowser.local.php:
define("BIBTEXBROWSER_MAIN", 'PgmDispatcher');
and then in bibtexbrowser.after.php:
<?php
class PgmDispatcher extends Dispatcher {
  function getDB() {
    $db = new BibDataBase();
    
    // builds the first entry
    $entry = new BibEntry();
    $entry->setType("article");
    $entry->setField("title", "foo");
    $entry->setField("year", "2014");
    $entry->setKey("kolp");
    $db->addEntry($entry);
    
    // builds the second entry
    $entry2 = new BibEntry();
    $entry2->setType("article");
    $entry2->setField("title", "bar");
    $entry2->setField("year", "2013");
    $entry2->setKey("tili");
    $db->addEntry($entry2);
    
    return $db;
  }
}
?>

How to remove fields from the bibtex text?


If you want to remove some fields (e.g. abbrv and comment) from the resulting bibtex, add in bibtexbrowser.local.php:
<?php
define('BIBTEXBROWSER_BIBTEX_VIEW','reconstructed');
define('BIBTEXBROWSER_BIBTEX_VIEW_FILTEREDOUT','abbrv|comment');
?>

How to activate page numbering in the output?


Add in bibtexbrowser.local.php:
<?php
bibtexbrowser_configure('BIBTEXBROWSER_DEFAULT_DISPLAY','PagedDisplay');
bibtexbrowser_configure('PAGE_SIZE','3');
?>

How to override framesets and headers?


You can customize every view as follows, in particular by playing with BIBTEXBROWSER_URL.

frameset.html:
<html>
<frameset cols="15%,*">
<frame name="menu" src="menu.php" />
<frame name="main" src="output.php" />
</frameset>
</html>
menu.php:
MENU (no header sent)
<?php
define('BIBTEXBROWSER_URL','output.php');
$_GET['menu']=1;
$_GET['bib']='foo.bib';
include('bibtexbrowser.php');
?>
output.php:
OUTPUT (no header sent)
<?php 
define('BIBTEXBROWSER_URL','elem.php');
include('bibtexbrowser.php');
?>
elem.php:
ELEM (no header sent)
<?php 
include('bibtexbrowser.php'); 
?>

How to add hyperlink to the authors' web pages?


You must add a @string block in the bibtex file, which contains the links. The key is a concatenation of hp_ and then FirstNameLastName (no space). For instance:

@String { 
  hp_ericfoo      = {http://www.foo.de/},
  hp_joebar      = {http://www.joebar.me/},
}

How to modify bibtex entries on the command line?


Use bibtexbrowser-cli.php. For instance:

php bibtexbrowser-cli.php mybib.bib --id classical --set-title \"a new title\" --id with_abstract --set-title \"a new title\" --set-year 1990

Related tools


Old-fashioned:
bibhtml, bib2html, bibtohtml, bibtextohtml, bibtex2html, bibtex2web, stratego bibtex module
Unlike them, bibtexbrowser is dynamic, i.e. generates the HTML pages on the fly. Thus, you do not need to regenerate the static HTML files each time the bib file is changed.

Heavyweight:
PHP BibTeX Database Manager, bibadmin, basilic, phpbibman, aigaion, refbase, wikindx, refdb
Unlike them, bibtexbrowser does not need a MySQL database.


Main competitor:
SimplyBibtex has the same spirit, but the project seems dead since 2006

Misc:
This matlab script is similar

Copyright


This script is a fork from an excellent script of Joel Garcia, Leonardo Ruiz, and Yoonsik Cheon from the University of Texas at El Paso.

Bibtexbrowser is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


API Documentation

StateBasedBibtexParser
is a generic parser of bibtex files.
usage:
  $delegate = new XMLPrettyPrinter();// or another delegate such as BibDBBuilder
  $parser = new StateBasedBibtexParser($delegate);
  $parser->parse(fopen('bibacid-utf8.bib','r'));
notes: - It has no dependencies, it can be used outside of bibtexbrowser - The delegate is expected to have some methods, see classes BibDBBuilder and XMLPrettyPrinter

ParserDelegate
a default empty implementation of a delegate for StateBasedBibtexParser
      entryValuePart($key, $value, $type)
called for each sub parts of type {part} of a field value 
 for now, only CURLYTOP and CURLYONE events

XMLPrettyPrinter
is a possible delegate for StateBasedBibParser.
usage:
see snippet of [[#StateBasedBibParser]]
      entryValuePart($key, $value, $type)
called for each sub parts of type {part} of a field value 
 for now, only CURLYTOP and CURLYONE events

StringEntry
represents @string{k=v}

BibDBBuilder
builds arrays of BibEntry objects from a bibtex file.
usage:
  $empty_array = array();
  $db = new BibDBBuilder(); // see also factory method createBibDBBuilder
  $db->build('bibacid-utf8.bib'); // parses bib file
  print_r($db->builtdb);// an associated array key -> BibEntry objects
  print_r($db->stringdb);// an associated array key -> strings representing @string
notes: method build can be used several times, bibtex entries are accumulated in the builder
      entryValuePart($key, $value, $type)
called for each sub parts of type {part} of a field value 
 for now, only CURLYTOP and CURLYONE events

BibEntry
represents a bibliographic entry.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $entry = $db->getEntryByKey('classical');
  echo bib2html($entry);
notes: - BibEntry are usually obtained with getEntryByKey or multisearch
      __toString()
returns a debug string representation
      BibEntry()
Creates an empty new bib entry. Each bib entry is assigned a unique
 identification number.
      setFile($filename)
Sets the name of the file containing this entry
      timestamp()
Adds timestamp to this object
      getTimestamp()
Returns the timestamp of this object
      getType()
Returns the type of this bib entry.
      setKey($value)
Sets the key of this bib entry.
      removeField($name)
removes a field from this bibtex entry
      setField($name, $value)
Sets a field of this bib entry.
      setType($value)
Sets a type of this bib entry.
      getURL()
Tries to build a good URL for this entry. The URL should be absolute (better for the generated RSS)
      bib2links()
@see bib2links(), kept for backward compatibility
      getLink($bibfield, $iconurl, $altlabel)
Read the bibtex field $bibfield and return a link with icon (if $iconurl is given) or text
 e.g. given the bibtex entry: @article{myarticle, pdf={myarticle.pdf}},
 $bibtexentry->getLink('pdf') creates a link to myarticle.pdf using the text '[pdf]'.
 $bibtexentry->getLink('pdf','pdficon.png') returns &lt;a href="myarticle.pdf">&lt;img src="pdficon.png"/>&lt;/a>
 if you want a label that is different from the bibtex field, add a third parameter.
      getBibLink($iconurl)
returns a "[bib]" link
      getUrlLink($iconurl, $label)
same as `getPdfLink`, kept for backward compatibility
      getPdfLink($iconurl, $label)
returns a "[pdf]" link for the entry, if possible.
      Tries to get the target URL from the 'pdf' field first, then from 'url' or 'file'.
      getDoiLink($iconurl)
DOI are a special kind of links, where the url depends on the doi
      getGSLink($iconurl)
GS (Google Scholar) are a special kind of links, where the url depends on the google scholar id
      getIconOrTxt($txt, $iconurl)
replace [$ext] with an icon whose url is defined in a string
  e.g. getIconOrTxt('pdf') will print '[pdf]'
  or   getIconOrTxt('pdf','http://link/to/icon.png') will use the icon linked by the url, or print '[pdf']
  if the url does not point to a valid file (using the "alt" property of the "img" html tag)
      getAbstract()
Reruns the abstract
      getLastName($author)
 Returns the last name of an author name.
      getFirstName($author)
 Returns the first name of an author name.
      hasField($name)
Has this entry the given field?
      getAuthor()
Returns the authors of this entry. If "author" is not given,
 return a string 'Unknown'.
      getKey()
Returns the key of this entry
      getTitle()
Returns the title of this entry?
      getPublisher()
Returns the publisher of this entry
 It encodes a specific logic
      getRawAuthors()
Returns the authors of this entry as an array (split by " and ")
      formatAuthor($author)
 Returns the formated author name w.r.t to the user preference 
 encoded in USE_COMMA_AS_NAME_SEPARATOR_IN_OUTPUT and USE_INITIALS_FOR_NAMES
      formatAuthorCanonical($author)
 Returns the formated author name as "FirstName LastName".
      formatAuthorCommaSeparated($author)
 Returns the formated author name as "LastName, FirstName".
      formatAuthorInitials($author)
 Returns the formated author name as "LastName Initials".
 e.g. for Vancouver-style used by PubMed.
      formattedAuthors()
@deprecated
      getFormattedAuthors()
@deprecated
      getFormattedAuthorsImproved()
@deprecated
      getFormattedAuthorsArray()
Returns the authors as an array of strings (one string per author).
      getFormattedAuthorsString()
Adds to getFormattedAuthors() the home page links and returns a string (not an array). Is configured with BIBTEXBROWSER_AUTHOR_LINKS and USE_COMMA_AS_NAME_SEPARATOR_IN_OUTPUT.
      addAuthorPageLink($author)
adds a link to the author page
      getCanonicalAuthors()
Returns the authors of this entry as an array in a canonical form
      getArrayOfCommaSeparatedAuthors()
Returns the authors of this entry as an array in a comma-separated form
      getCompactedAuthors()
 Returns a compacted string form of author names by throwing away
 all author names except for the first one and appending ", et al."
      addHomepageLink($author)
add the link to the homepage if it is defined in a string
  e.g. @string{hp_MartinMonperrus="http://www.monperrus.net/martin"}
  The string is a concatenation of firstname, lastname, prefixed by hp_
 Warning: by convention @string are case sensitive so please be keep the same case as author names
 @thanks Eric Bodden for the idea
      getEditors()
Returns the editors of this entry as an arry
      getFormattedEditors()
Returns the editors of this entry as an arry
      getYear()
Returns the year of this entry?
      getKeywords()
returns the array of keywords
      getField($name)
Returns the value of the given field?
      getFields()
Returns the fields
      getRawAbbrv()
Returns the raw, undecorated abbreviation depending on ABBRV_TYPE.
      getAbbrv()
Returns the abbreviation, etc [1] if ABBRV_TYPE='index'.
      setAbbrv($abbrv)
Sets the abbreviation (e.g. [OOPSLA] or [1])
      getText()
Returns the verbatim text of this bib entry.
      hasPhrase($phrase, $field)
Returns true if this bib entry contains the given phrase (PREG regexp)
 in the given field. if $field is null, all fields are considered.
 Note that this method is NOT case sensitive
      toHTML($wrapped)
Outputs HTML line according to layout
      toCoins()
Outputs an coins URL: see http://ocoins.info/cobg.html
 Used by Zotero, mendeley, etc.
      anchor()
Returns an anchor for this entry.
      getConstants()
 rebuild the set of constants used if any as a string
      toEntryUnformatted()
 Displays a 
 text of the given bib entry.
 URLs are replaced by HTML links.
      getFullText()
 Gets the raw text of the entry (crossref + strings + entry)
      getPages()
returns the first and last page of the entry as an array ([0]->first,  [2]->last)

IndependentYearMenu
outputs an horizontal  year-based menu
usage:
  $_GET['library']=1;
  $_GET['bib']='bibacid-utf8.bib';
  $_GET['all']=1;
  include( 'bibtexbrowser.php' );
  setDB();
  new IndependentYearMenu($_GET[Q_DB]);

MenuManager
is used for creating menus (by type, by year, by author, etc.).
usage:
  $db = zetDB('bibacid-utf8.bib');
  $menu = new MenuManager();
  $menu->setDB($db);
  $menu->year_size=100;// should display all years :)
  $menu->display();
      setDB($db)
sets the database that is used to create the menu
      display()
function called back by HTMLTemplate
      titleView()
Displays the title in a table.
      searchView()
Displays the search view in a form.
      typeVC()
Displays and controls the types menu in a table.
      authorVC()
Displays and controls the authors menu in a table.
      tagVC()
Displays and controls the tag menu in a table.
      yearVC()
Displays and controls the tag menu in a table.
      mainVC()
Displays the main contents .
      displayMenu($title, $list, $page, $pageSize, $pageKey, $targetKey)
Displays a list menu in a table.

 $title: title of the menu (string)
 $list: list of menu items (string)
 $page: page number to display (number)
 $pageSize: size of each page
 $pageKey: URL query name to send the page number to the server
 $targetKey: URL query name to send the target of the menu item
      menuPageBar($queryKey, $numEntries, $page, $pageSize, $start, $end)
Returns a string to displays forward and reverse page controls.

 $queryKey: key to send the page number as a URL query string
 $page: current page number to display
 $numEntries: number of menu items
 $start: start index of the current page
 $end: end index of the current page
      displayMenuItems($items, $startIndex, $endIndex, $queryKey)
 Displays menu items (anchors) from the start index (inclusive) to
 the end index (exclusive). For each menu, the following form of
 string is printed:

 <a href="...?bib=cheon.bib&author=Yoonsik+Cheon">
    Cheon, Yoonsik</a>
 <div class="mini_se"></div>

NewEntriesDisplay
displays the latest modified bibtex entries.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $d = new NewEntriesDisplay();
  $d->setDB($db);
  $d->setN(7);// optional
  $d->display();
      setEntries($entries)
sets the entries to be shown
      display()
Displays a set of bibtex entries in an HTML table

YearDisplay
displays the entries by year in reverse chronological order.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $d = new YearDisplay();
  $d->setDB($db);
  $d->display();
      setOptions($options)
creates a YearDisplay
      setEntries($entries)
sets the entries to be shown
      display()
Displays a set of bibtex entries in an HTML table

SimpleDisplay
displays the summary information of all bib entries.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $d = new SimpleDisplay();
  $d->setDB($db);
  $d->display();
      setEntries($entries)
sets the entries to be shown
      display()
Displays a set of bibtex entries in an HTML table

NotFoundDisplay
handles queries with no result

AcademicDisplay
displays the publication records sorted by publication types (as configured by constant BIBLIOGRAPHYSECTIONS).
usage:
  $db = zetDB('bibacid-utf8.bib');
  $d = new AcademicDisplay();
  $d->setDB($db);
  $d->display();
      setEntries($entries)
sets the entries to be shown
      search2html($query, $title)
transforms a query to HTML
 $ query is an array (e.g. array(Q_YEAR=>'2005'))
 $title is a string, the title of the section

BibEntryDisplay
displays a single bib entry.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $dis = new BibEntryDisplay($db->getEntryByKey('classical'));
  $dis->display();
notes: - the top-level header (usually &lt;H1>) must be done by the caller. - this view is optimized for Google Scholar
      getTitle()
returns the title
      displayOnSteroids()
2011/10/02: new display, inspired from Tom Zimmermann's home page
      metadata_dict()
Returns a dictionary of metadata. If the same metadata appears multiple times, it is concatenated with ";"
      metadata()
Returns an array containing the metadata for Google Scholar
    array (array('citation_title', 'foo'), ....)
 @see http://scholar.google.com/intl/en/scholar/inclusion.html
 @see http://www.monperrus.net/martin/accurate+bibliographic+metadata+and+google+scholar

BibDataBase
represents a bibliographic database that contains a set of bibliographic entries.
usage:
$db = new BibDataBase();
$db->load('bibacid-utf8.bib');
$query = array('author'=>'martin', 'year'=>2008);
foreach ($db->multisearch($query) as $bibentry) { echo $bibentry->getTitle(); }
      load($filename)
Creates a new database by parsing bib entries from the given
 file. (backward compatibility)
      update($filename)
Updates a database (replaces the new bibtex entries by the most recent ones)
      is_already_loaded($filename)
returns true if this file is already loaded in this BibDataBase object
      update_internal($resource_name, $resource)
See update
      BibDataBase()
Creates a new empty database
      getLatestEntries($n)
Returns the $n latest modified bibtex entries/
      getEntries()
Returns all entries as an array. Each entry is an instance of
 class BibEntry.
      contains($key)
tests wheter the database contains a bib entry with $key
      getEntriesByTypes()
Returns all entries categorized by types. The returned value is
 a hashtable from types to arrays of bib entries.
      getTypes()
Returns an array containing all the bib types (strings).
      authorIndex()
Generates and returns an array consisting of all authors.
 The returned array is a hash table with keys <FirstName LastName>
 and values <LastName, FirstName>.
      tagIndex()
Generates and returns an array consisting of all tags.
      yearIndex()
Generates and returns an array consisting of all years.
      getEntryByKey($key)
Given its key, return the bib entry.
      addEntry($entry)
Adds a new bib entry to the database.
      searchType($type)
 Returns an array containing all bib entries matching the given
 type.
      multisearch($query)
Returns an array of bib entries (BibEntry) that satisfy the query
 $query is an hash with entry type as key and searched fragment as value
      stringEntriesText()
returns the text of all @String entries of this dabatase
      toBibtex()
returns a classical textual Bibtex representation of this database

BibtexDisplay
is used to create an subset of a bibtex file.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $query = array('year'=>2005);
  $dis = new BibtexDisplay();
  $dis->setEntries($db->multisearch($query));
  $dis->display();
      setEntries($entries)
sets the entries to be shown

PagedDisplay
creates paged output, e.g: [[http://localhost/bibtexbrowser/testPagedDisplay.php?page=1]]
usage:
  $_GET['library']=1;
  include( 'bibtexbrowser.php' );
  $db = zetDB('bibacid-utf8.bib');
  $pd = new PagedDisplay();
  $pd->setEntries($db->bibdb);
  $pd->display();
      setEntries($entries)
sets the entries to be shown
      setPage()
sets $this->page from $_GET, defaults to 1

RSSDisplay
is used to create an RSS feed.
usage:
  $db = zetDB('bibacid-utf8.bib');
  $query = array('year'=>2005);
  $rss = new RSSDisplay();
  $entries = $db->getLatestEntries(10);
  $rss->setEntries($entries);
  $rss->display();
      text2rss($desc)
tries to always output a valid XML/RSS string
 based on OUTPUT_ENCODING, HTML tags, and the transformations
 that happened in latex2html
      setEntries($entries)
sets the entries to be shown

Dispatcher
is responsible for transforming a query string of $_GET[..] into a publication list.
usage:
  $_GET['library']=1;
  @require('bibtexbrowser.php');
  $_GET['bib']='bibacid-utf8.bib';
  $_GET['year']='2006';
  $x = new Dispatcher();
  $x->main();
      getDB()
returns the underlying BibDataBase object
      clearQuery()
clears the query string in $_GET so that bibtexbrowser can be called multiple times
      range()
 Allow the user to search for a range of dates

 The query string can comprise several elements separated by commas and
 optionally white-space.
 Each element can either be one number (a year) or two numbers
 (a range of years) separated by anything non-numerical.
      academic()
the academic keyword in URLs switch from a year based viey to a publication type based view
      diagnosis()
is used to remotely analyzed a situation

Tagged as: